Overview   Project   Class   Tree   Deprecated   Index 
Grammatica 1.5 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

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.


Inner Classes, Typedefs, and Enums
class NFACharRangeTransition.Range
          A character range class.
 
Field Summary
protected bool ignoreCase
          The case-insensitive match flag.
protected bool inverse
          The inverse match flag.
   
Fields inherited from class NFATransition
state
 
Constructor Summary
NFACharRangeTransition( bool inverse, bool ignoreCase, NFAState state )
          Creates a new character range transition.
 
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.
   
Methods inherited from class NFATransition
IsAscii, Match, Copy
 

Field Detail

ignoreCase

protected bool ignoreCase;
The case-insensitive match flag.

inverse

protected bool inverse;
The inverse match flag.


Constructor Detail

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


Method Detail

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

 Overview   Project   Class   Tree   Deprecated   Index 
Grammatica 1.5 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD