Public Member Functions | |
| State (String name) | |
| State (String name, int type) | |
| void | addRule (char character, State newState) |
| void | addRule (TokenSet set, State newState) |
| Hashtable | getRules () |
| Vector | getSets () |
| TokenSet | containsSymbolInSet (Character character) |
Public Attributes | |
| String | returnValue |
| String | returnType |
| int | type |
| String | name |
Static Public Attributes | |
| static final int | NORMAL_STATE = 0 |
| static final int | GOAL_STATE = 1 |
Protected Member Functions | |
| boolean | compute (String sym) |
|
|
Creates a new State object of a NORMAL_STATE type.
|
|
||||||||||||
|
Creates a new State object of a specific type - NORMAL_STATE or GOAL_STATE.
|
|
||||||||||||
|
This method creates a new rule stating that "if any character in 'a' is encountered then move to state 's'".
|
|
||||||||||||
|
This method creates a new rule stating that "if character 'c' is encountered then move to state 's'".
|
|
|
This method works out if a given character triggers a move to another state from this one. If this is possible it initiates a recursive algorithm by calling the same method in the new state.
|
|
|
Checks to see if the specified character is already contained within any TokenSet used by the state.
|
|
|
Returns a hashtable of all the transition rules for the state in the form Character->Next State.
|
|
|
Returns a vector of all the token groups that trigger transitions from this state.
|
|
|
Constant indicating a goal type of state. |
|
|
The name of the state. As a convention states in a DFA are labeled q0, q1... but this can be adjusted for any purpose. |
|
|
Constant indicating a standard type of state. |
|
|
The return type of the DFA. Can be an arbitrary string indicating the form of the data. |
|
|
If an input string matches the DFA this will hold the part of that string processed by the state. |
|
|
The type of the state - can be GOAL_STATE or NORMAL_STATE. |
1.4.1