PerCederberg.Grammatica.Runtime
Class NFACharTransition
System.Object
|
+--NFATransition
|
+--NFACharTransition
in TokenNFA.cs
- internal class NFACharTransition
- extends NFATransition
A single character match transition.
|
Field Summary |
protected char |
match
The character to match. |
|
Method Summary |
override NFATransition |
Copy( NFAState state )
Creates a copy of this transition but with another target
state. |
override bool |
IsAscii()
Checks if this transition only matches ASCII characters. |
override bool |
Match( char ch )
Checks if the specified character matches the transition. |
match
protected char match;
- The character to match.
NFACharTransition
public NFACharTransition( char match, NFAState state );
- Creates a new character transition.
- Parameters:
match - the character to match
state - the target state
Copy
public override NFATransition Copy( NFAState state );
- Creates a copy of this transition but with another target
state.
- Parameters:
state - the new target state
- Returns:
- an identical copy of this transition
IsAscii
public override bool IsAscii();
- Checks if this transition only matches ASCII characters.
I.e. characters with numeric values between 0 and 127.
- Returns:
- true if this transition only matches ASCII, or
false otherwise
Match
public override bool Match( char ch );
- Checks if the specified character matches the transition.
- Parameters:
ch - the character to check
- Returns:
- true if the character matches, or
false otherwise