com.inxar.syntacs.automaton.pushdown
Class ArrayDPA
java.lang.Object
|
+--com.inxar.syntacs.automaton.pushdown.ArrayDPA
- All Implemented Interfaces:
- DPA
- public class ArrayDPA
- extends Object
- implements DPA
Concrete implementation of DPA
which uses full-length
array parse tables. In this case (versus the DFA
case) this is acceptable since the input range is much smaller than
the Unicode character set.
Fields inherited from interface org.inxar.syntacs.automaton.pushdown.DPA |
START_STATE |
Constructor Summary |
ArrayDPA(int[][] action,
int[][] go,
Action[] actions)
Constructs the ArrayDPA on the given action table,
transition table, production length table, and Action registry. |
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 symbol)
Returns the state reached upon transition after reduction to
the given nonterminal . |
ERROR
public static final Action ERROR
- A standard error
Action
cached here for
convenience.
go
public int[][] go
action
public int[][] action
actions
public Action[] actions
ArrayDPA
public ArrayDPA(int[][] action,
int[][] go,
Action[] actions)
- Constructs the
ArrayDPA
on the given action table,
transition table, production length table, and Action registry.
action
public Action action(int state,
int symbol)
- Description copied from interface:
DPA
- 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.
- Specified by:
action
in interface DPA
go
public int go(int state,
int symbol)
- Description copied from interface:
DPA
- Returns the state reached upon transition after reduction to
the given
nonterminal
.
- Specified by:
go
in interface DPA