PerCederberg.Grammatica.Runtime
Class TransitionTree
System.Object
|
+--TransitionTree
in TokenStringDFA.cs
- internal class TransitionTree
- 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.
- Since:
- 1.5
|
Constructor Summary |
TransitionTree()
Creates a new empty automaton transition tree. |
|
Method Summary |
void |
Add( char c, bool lowerCase, DFAState state )
Adds a transition to this tree. |
DFAState |
Find( char c, bool lowerCase )
Finds an automaton state from the specified transition
character. |
void |
PrintTo( StringBuilder buffer, String indent )
Prints the automaton tree to the specified string buffer. |
TransitionTree
public TransitionTree();
- Creates a new empty automaton transition tree.
Add
public void Add( char c, bool lowerCase, DFAState state );
- Adds a transition to this tree. If the lower-case flag is
set, the character will be converted to lower-case before
being added.
- Parameters:
c - the character to transition for
lowerCase - the lower-case conversion flag
state - the state to transition to
Find
public DFAState Find( char c, bool lowerCase );
- Finds an automaton state from the specified transition
character. This method searches this transition tree for a
matching transition. The comparison can optionally be done
with a lower-case conversion of the character.
- Parameters:
c - the character to search for
lowerCase - the lower-case conversion flag
- Returns:
- the automaton state found, or
null if no transition exists
PrintTo
public void PrintTo( StringBuilder buffer, String indent );
- Prints the automaton tree to the specified string buffer.
- Parameters:
buffer - the string buffer
indent - the current indentation