org.inxar.syntacs.automaton.pushdown
Interface DPA
- All Known Implementing Classes:
- ArrayDPA, MesoArrayDPA
- public interface DPA
The "Deterministic Pushdown Automaton" (DPA) abstracts a state
machine which maintains a stack of Symbol objects used for
recognizing an LR-grammar.
For more information regarding Pushdown Automata, see Chapter 3 in
the Dragon Book or Chapter 5 in "Introduction to Automata Theory,
Languages, and Computation" (Hopcroft, Ullman; 1979).
The term DPA is used somewhat loosely here. Specifically, this
interface really only tries to abstract the automata part of a DPA
and does not do any stack manipulation (the Parser
does this).
Field Summary |
static int |
START_STATE
Constant for the start state of a DPA . |
Method Summary |
Action |
action(int state,
int symbol)
Returns the Action associated by traversing the
path given from the given state over the given symbol. |
int |
go(int state,
int nonterminal)
Returns the state reached upon transition after reduction to
the given nonterminal . |
START_STATE
public static final int START_STATE
- Constant for the start state of a
DPA
.
Parser
s should use this upon state initialization.
action
public Action action(int state,
int symbol)
- Returns the
Action
associated by traversing the
path given from the given state over the given symbol. The
Action
object returned should never be
null
but may be the error
action.
go
public int go(int state,
int nonterminal)
- Returns the state reached upon transition after reduction to
the given
nonterminal
.