PerCederberg.Grammatica.Runtime
Class NFACharRangeTransition
System.Object
|
+--NFATransition
|
+--NFACharRangeTransition
in TokenNFA.cs
- internal class NFACharRangeTransition
- extends NFATransition
A character range match transition. Used for user-defined
character sets in regular expressions.
|
Field Summary |
protected bool |
ignoreCase
The case-insensitive match flag. |
protected bool |
inverse
The inverse match flag. |
|
Method Summary |
void |
AddCharacter( char c )
Adds a single character to this character set. |
void |
AddRange( char min, char max )
Adds a character range to this character set. |
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. |
ignoreCase
protected bool ignoreCase;
- The case-insensitive match flag.
inverse
protected bool inverse;
- The inverse match flag.
NFACharRangeTransition
public NFACharRangeTransition( bool inverse, bool ignoreCase, NFAState state );
- Creates a new character range transition.
- Parameters:
inverse - the inverse match flag
ignoreCase - the case-insensitive match flag
state - the target state
AddCharacter
public void AddCharacter( char c );
- Adds a single character to this character set.
- Parameters:
c - the character to add
AddRange
public void AddRange( char min, char max );
- Adds a character range to this character set.
- Parameters:
min - the minimum character value
max - the maximum character value
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