class Pegasus::Language::Rule
- Pegasus::Language::Rule
- Pegasus::Language::OptionObject
- Reference
- Object
Overview
A single rule. This can have one or more alternatives, but has the same options (zero or more) applied to them.
Defined in:
pegasus/language_def.crConstructors
Instance Method Summary
- #==(other : Rule)
- #alternatives : Array(RuleAlternative)
-
#compute_optional_variants
Creates a new rule with the same options, but with alternatives expanded for optional values.
-
#compute_optional_variants(&block)
Creates a new rule with the same options, but with alternatives expanded for optional values.
-
#derives_lambda?
Checks if this rule has any alternatives that can derive lambda.
-
#derives_lambda?(&)
Checks if this rule has any alternatives that can derive lambda, using a custom block for checking if an element can derive lambda.
-
#hash(hasher)
See
Object#hash(hasher)
Instance methods inherited from class Pegasus::Language::OptionObject
options : Array(Option)
options
Constructor methods inherited from class Pegasus::Language::OptionObject
new
new
Constructor Detail
Instance Method Detail
Creates a new rule with the same options, but with alternatives expanded for optional values.
Creates a new rule with the same options, but with alternatives expanded for optional values. Uses a custom block to check if the elements can be empty or not.
Checks if this rule has any alternatives that can derive lambda, using a custom block for checking if an element can derive lambda.