org.inxar.syntacs.automaton.finite
Interface DFA
- All Known Implementing Classes:
- TreeDFA, MesoArrayDFA
- public interface DFA
The "Deterministic Finite Automaton" (DFA
) interface
abstracts a Moore state machine used to recognize discrete
sequences of symbols (usually character symbols). More information
about DFA
's can be found pretty much anywhere, but
chapter 3 of the Dragon Book is a good place to start.
Field Summary |
static int |
DEAD_STATE
The DEAD_STATE is the state where all exit paths
lead back to the DEAD_STATE . |
static int |
START_STATE
Lexical analyzers or other tools should synchronize to the
START_STATE constant upon initialization. |
Method Summary |
int |
go(int state,
int input)
Returns the next state for the given state and given input symbol. |
int |
output(int state)
Returns the output at the given state. |
START_STATE
public static final int START_STATE
- Lexical analyzers or other tools should synchronize to the
START_STATE constant upon initialization.
DEAD_STATE
public static final int DEAD_STATE
- The
DEAD_STATE
is the state where all exit paths
lead back to the DEAD_STATE
.
go
public int go(int state,
int input)
- Returns the next state for the given state and given input symbol.
output
public int output(int state)
- Returns the output at the given state. Output values generally
correspond to to Token ID numbers. If no output has been
defined for the given state,
Token.UNDEF
is
returned.