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

PerCederberg.Grammatica.Runtime
Class NFATransition

System.Object
   |
   +--NFATransition

   in TokenNFA.cs
Direct Known Subclasses:
NFACharRangeTransition, NFACharTransition, NFADigitTransition, NFADotTransition, NFAEpsilonTransition, NFANonDigitTransition, NFANonWhitespaceTransition, NFANonWordTransition, NFAWhitespaceTransition, NFAWordTransition

internal abstract class NFATransition
extends System.Object

An NFA state transition. A transition checks a single character of input an determines if it is a match. If a match is encountered, the NFA should move forward to the transition state.


Field Summary
 internal NFAState state
          The target state of the transition.
 
Constructor Summary
NFATransition( NFAState state )
          Creates a new state transition.
 
Method Summary
 abstract NFATransition Copy( NFAState state )
          Creates a copy of this transition but with another target state.
 abstract bool IsAscii()
          Checks if this transition only matches ASCII characters.
 abstract bool Match( char ch )
          Checks if the specified character matches the transition.
 

Field Detail

state

 internal NFAState state;
The target state of the transition.


Constructor Detail

NFATransition

public NFATransition( NFAState state );
Creates a new state transition.
Parameters:
state - the target state


Method Detail

Copy

public abstract 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 abstract 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 abstract 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