PerCederberg.Grammatica.Parser
Class AutomatonTree
System.Object
|
+--AutomatonTree
in Tokenizer.cs
- class AutomatonTree
- extends System.Object
An automaton state transition tree. This class contains a
binary search tree for the automaton transitions from one
state to another. All transitions are linked to a single
character.
Constructor Summary |
AutomatonTree()
Creates a new empty automaton transition tree. |
Method Summary |
void |
Add( char c, Automaton state )
Adds a transition to this tree. |
Automaton |
Find( char c )
Finds an automaton state from the specified transition
character. |
AutomatonTree
public AutomatonTree();
- Creates a new empty automaton transition tree.
Add
public void Add( char c, Automaton state );
- Adds a transition to this tree.
- Parameters:
c
- the character to transition for
state
- the state to transition to
Find
public Automaton Find( char c );
- Finds an automaton state from the specified transition
character. This method searches this transition tree for
a matching transition.
- Parameters:
c
- the character to search for
- Returns:
- the automaton state found, or
null if no transition exists