class Pegasus::Language::RuleAlternative

Overview

One of the alternatives of a rule.

Defined in:

pegasus/language_def.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(elements : Array(Pegasus::Language::RuleElement)) #

[View source]

Instance Method Detail

def ==(other : RuleAlternative) #

[View source]
def compute_optional_variants #

Computes the variants created by optionals. For example, a? b? has four variants, a b, a, b, .


[View source]
def compute_optional_variants(&) #

Same as compute_optional_variants, but what's optional is now decided by the block.


[View source]
def derives_lambda? #

Determines if this rule alternative can be empty, or derive lambda.


[View source]
def derives_lambda?(&) #

Determines if the rule alternative can be empty, using the block to check whether each element can be empty or not.


[View source]
def elements : Array(RuleElement) #

The elements of the rule.


[View source]
def lambda? #

Checks if this specific alternative is the lambda alternative.


[View source]