class Pegasus::Pda::Pda

Overview

A class that represents the (LA)LR Push Down Automaton.

Defined in:

pegasus/pda.cr
pegasus/table.cr

Constructors

Instance Method Summary

Instance methods inherited from class Pegasus::Automata::UniqueAutomaton(Set(Pegasus::Pda::LookaheadItem), Pegasus::Elements::NonterminalId | Pegasus::Elements::TerminalId)

state_for(*, data : V(Pegasus::Pda::LookaheadItem)) state_for

Constructor methods inherited from class Pegasus::Automata::UniqueAutomaton(Set(Pegasus::Pda::LookaheadItem), Pegasus::Elements::NonterminalId | Pegasus::Elements::TerminalId)

new new

Instance methods inherited from class Pegasus::Automata::Automaton(Set(Pegasus::Pda::LookaheadItem), Pegasus::Elements::NonterminalId | Pegasus::Elements::TerminalId)

last_id : Int64 last_id, start : State(V(Pegasus::Pda::LookaheadItem), T | T) | Nil start, start=(start : State(V(Pegasus::Pda::LookaheadItem), T | T) | Nil) start=, state_for(*, data : V(Pegasus::Pda::LookaheadItem)) state_for, states : Set(State(V(Pegasus::Pda::LookaheadItem), T | T)) states

Constructor methods inherited from class Pegasus::Automata::Automaton(Set(Pegasus::Pda::LookaheadItem), Pegasus::Elements::NonterminalId | Pegasus::Elements::TerminalId)

new new

Constructor Detail

def self.new(items : Array(Item)) #

[View source]

Instance Method Detail

def action_table #

Creates an action table, determing what the parser should do at the given state and the lookhead token.


[View source]
def state_table #

Creates a transition table that is indexed by both Terminals and Nonterminals.


[View source]