class Arborist::MutexAlt

Overview

Mutually exclusive terminal alternation A terminal expression, like Terminal, that captures a set of mutually exclusive equal-length strings. If this is ever extended to strings of different length, then none of the strings in the set may be a substring of another string in the set. The range operator can be implemented in terms of this expression. e.g. "a" | "b" | "c" e.g. "abc" | "def" | "xyz"

Defined in:

arborist.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(strings : Set(String)) #

[View source]

Instance Method Detail

def eval(matcher) : ParseTree | Nil #

returns String | Nil


[View source]
def label(label : String) : MutexAlt #

[View source]
def label : String | Nil #

[View source]
def label=(label : String | Nil) #

[View source]
def preorder_traverse(matcher, visit : Expr -> _, visited_nodes : Set(Expr)) #

[View source]
def strings : Set(String) #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]