|
Grammatica 1.3 Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
System.Object
|
+--TokenMatcher
|
+--StringTokenMatcher
in Tokenizer.csA string token pattern matcher. This class is used to match a set of strings with the tokenizer buffer. This class internally uses a DFA for maximum performance. It also maintains the state of the last match.
Constructor Summary | |
StringTokenMatcher()
Creates a new string token matcher. |
Method Summary | |
void |
AddPattern( TokenPattern pattern )
Adds a string token pattern to this matcher. |
override int |
GetMatchedLength()
Returns the length of the latest match. |
override TokenPattern |
GetMatchedPattern()
Returns the latest matched token pattern. |
TokenPattern |
GetPattern( int id )
Returns the token pattern with the specified id. |
override bool |
HasReadEndOfString()
Checks if the end of string was encountered during the last match. |
bool |
MatchFrom( string str, int pos )
Checks if the token pattern matches the tokenizer buffer from the specified position. |
void |
Reset()
Resets the matcher state. |
void |
SetReadEndOfString()
Sets the end of string encountered flag. |
override string |
ToString()
Returns a string representation of this matcher. |
Methods inherited from class TokenMatcher |
GetMatchedPattern, GetMatchedLength, HasReadEndOfString |
Constructor Detail |
public StringTokenMatcher();
Method Detail |
public void AddPattern( TokenPattern pattern );
pattern
- the pattern to addpublic override int GetMatchedLength();
public override TokenPattern GetMatchedPattern();
public TokenPattern GetPattern( int id );
id
- the token pattern idpublic override bool HasReadEndOfString();
public bool MatchFrom( string str, int pos );
str
- the string to match
pos
- the starting positionpublic void Reset();
public void SetReadEndOfString();
public override string ToString();
|
Grammatica 1.3 Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |