PerCederberg.Grammatica.Runtime
Class TokenMatch
System.Object
|
+--TokenMatch
in TokenMatch.cs
- internal class TokenMatch
- extends System.Object
The token match status. This class contains logic to ensure that
only the longest match is considered. It also prefers lower token
pattern identifiers if two matches have the same length.
- Since:
- 1.5
|
Field Summary |
int |
Length
The length of the longest match found (read-only). |
TokenPattern |
Pattern
The token pattern for the longest match found (read-only). |
|
Method Summary |
void |
Clear()
Clears the current match information. |
void |
Update( int length, TokenPattern pattern )
Updates this match with new values. |
Length
public int Length;
- The length of the longest match found (read-only).
Pattern
public TokenPattern Pattern;
- The token pattern for the longest match found (read-only).
Clear
public void Clear();
- Clears the current match information.
Update
public void Update( int length, TokenPattern pattern );
- Updates this match with new values. The new values will only
be considered if the length is longer than any previous match
found.
- Parameters:
length - the matched length
pattern - the matched pattern