PerCederberg.Grammatica.Runtime
Class NFAMatcher
System.Object
|
+--TokenMatcher
|
+--NFAMatcher
in Tokenizer.cs
- internal class NFAMatcher
- extends TokenMatcher
A token pattern matcher using a NFA for both string and
regular expression tokens. This class has limited support for
regular expressions and must be complemented with another
matcher providing full regular expression support. Internally
it uses a NFA to provide high performance and low memory
usage.
|
Constructor Summary |
NFAMatcher( bool ignoreCase )
Creates a new NFA token matcher. |
NFAMatcher
public NFAMatcher( bool ignoreCase );
- Creates a new NFA token matcher.
- Parameters:
ignoreCase - the character case ignore flag
AddPattern
public override void AddPattern( TokenPattern pattern );
- Adds a token pattern to this matcher.
- Parameters:
pattern - the pattern to add
- Throws:
Exception - if the pattern couldn't be added to the matcher
Match
public override void Match( ReaderBuffer buffer, TokenMatch match );
- Searches for matching token patterns at the start of the
input stream. If a match is found, the token match object
is updated.
- Parameters:
buffer - the input buffer to check
match - the token match to update
- Throws:
IOException - if an I/O error occurred