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

PerCederberg.Grammatica.Parser
Class TokenMatcher

System.Object
   |
   +--TokenMatcher

   in Tokenizer.cs
Direct Known Subclasses:
RegExpTokenMatcher, StringTokenMatcher

class TokenMatcher
extends System.Object

A token pattern matcher. This class is the base class for the two types of token matchers that exist. The token matcher checks for matches with the tokenizer buffer, and maintains the state of the last match.


Method Summary
 abstract int GetMatchedLength()
          Returns the length of the latest match.
 abstract TokenPattern GetMatchedPattern()
          Returns the latest matched token pattern.
 abstract bool HasReadEndOfString()
          Checks if the end of string was encountered during the last match.
 

Method Detail

GetMatchedLength

public abstract int GetMatchedLength();
Returns the length of the latest match.
Returns:
the length of the latest match, or zero (0) if no match found

GetMatchedPattern

public abstract TokenPattern GetMatchedPattern();
Returns the latest matched token pattern.
Returns:
the latest matched token pattern, or null if no match found

HasReadEndOfString

public abstract bool HasReadEndOfString();
Checks if the end of string was encountered during the last match.
Returns:
true if the end of string was reached, or false otherwise

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