class

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

Initializes this grammar with the given terminals and nonterminals.

Source

Instance methods

add_item(i)

Add an item to the Grammar.

Source
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.

Source
create_lr_pda

Create an LR(1) PDA given a start symbol.

Source
items

The items that belong to this grammar.

Source
nonterminals

The nonterminals that belong to this grammar.

Source
terminals

The terminals that belong to this grammar.

Source