public class Lexer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FAILURE
An index which indicates that no further tokens were found.
|
Constructor and Description |
---|
Lexer(java.lang.CharSequence input,
java.lang.String[] regexps)
Builds a Lexer for the given input with the provided regular expressions.
|
Modifier and Type | Method and Description |
---|---|
int |
getMatchingIndex()
Returns the index of the regular expression which matched the most recent token.
|
int |
getMatchingPosition()
Returns the position in the String just beyond the most recent token.
|
java.lang.String |
getMatchingRule()
Returns the regular expression which matched the most recent token.
|
java.lang.String |
nextToken()
Returns the next token as a string.
|
java.lang.String |
nextToken(boolean trim)
Returns the next token as a string.
|
public static final int FAILURE
public Lexer(java.lang.CharSequence input, java.lang.String[] regexps)
public java.lang.String nextToken(boolean trim)
public java.lang.String nextToken()
public int getMatchingIndex()
public java.lang.String getMatchingRule()
public int getMatchingPosition()