Pegasus::Pda::Grammar
Inherits Reference / Object
A Grammar associated with the language, contianing a list of terminals,
nonterminals, and the context-free production rules given by the Item class.
Constructors
new(terminals : Array(Pegasus::Elements::TerminalId), nonterminals : Array(Pegasus::Elements::NonterminalId))
Initializes this grammar with the given terminals and nonterminals.
Instance methods
create_lalr_pda(lr_pda)
Converts an LR(1) PDA to an LALR(1) PDA by merging states with the corresponding bodies, and combining the lookahead sets of every matching item.