class Pegasus::Language::RuleAlternative
- Pegasus::Language::RuleAlternative
- Reference
- Object
Overview
One of the alternatives of a rule.
Defined in:
pegasus/language_def.crConstructors
Instance Method Summary
- #==(other : RuleAlternative)
-
#compute_optional_variants
Computes the variants created by optionals.
-
#compute_optional_variants(&)
Same as compute_optional_variants, but what's optional is now decided by the block.
-
#derives_lambda?
Determines if this rule alternative can be empty, or derive lambda.
-
#derives_lambda?(&)
Determines if the rule alternative can be empty, using the block to check whether each element can be empty or not.
-
#elements : Array(RuleElement)
The elements of the rule.
-
#lambda?
Checks if this specific alternative is the lambda alternative.
Constructor Detail
Instance Method Detail
def compute_optional_variants
#
Computes the variants created by optionals.
For example, a? b? has four variants, a b, a, b,
def compute_optional_variants(&)
#
Same as compute_optional_variants, but what's optional is now decided by the block.
def derives_lambda?(&)
#
Determines if the rule alternative can be empty, using the block to check whether each element can be empty or not.