class Arborist::Choice
- Arborist::Choice
- Reference
- Object
Overview
Ordered choice e.g. "foo bar baz" / "foo bar" / "foo"
Defined in:
arborist.crConstructors
Instance Method Summary
-
#eval(matcher) : ParseTree | Nil
def eval(matcher, retry_on_failure_if_seed_grew : Bool) : ParseTree?
- #label(label : String) : Choice
- #label : String | Nil
- #label=(label : String | Nil)
- #preorder_traverse(matcher, visit : Expr -> _, visited_nodes : Set(Expr))
-
#to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
Constructor Detail
def self.new(exps : Array(Arborist::Apply | Arborist::Choice | Arborist::Dot | Arborist::MutexAlt | Arborist::NegLookAhead | Arborist::Optional | Arborist::PosLookAhead | Arborist::Repetition | Arborist::RepetitionOnePlus | Arborist::Sequence | Arborist::Terminal))
#
Instance Method Detail
def eval(matcher, retry_on_failure_if_seed_grew : Bool) : ParseTree?
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
.