org.exolab.adaptx.xpath.engine
public class Lexer extends Object
Version: $Revision: 4047 $ $Date: 2004-01-09 18:04:23 -0500 (Fri, 09 Jan 2004) $
| Field Summary | |
|---|---|
| static char | ADDITION_OP |
| static char | AT_SYMBOL |
| static char | COLON |
| static char | COMMA |
| static char | CR |
| static char | DOLLAR_SYMBOL |
| static char | D_QUOTE |
| static char | EQUALS_OP |
| static char | FORWARD_SLASH |
| static char | GREATER_THAN_OP |
| static char | LESS_THAN_OP |
| static char | LF |
| static char | L_BRACKET |
| static char | L_PAREN |
| static char | MULTIPLY_OP |
| static char | NEGATION_OP |
| static char | PERIOD |
| static char | R_BRACKET |
| static char | R_PAREN |
| static char | SPACE |
| static char | SUBTRACTION_OP |
| static char | S_QUOTE |
| static Token[] | tokenSet
the delimiter set of an ExprLexer
|
| static char | TAB |
| static char | VERT_BAR |
| Constructor Summary | |
|---|---|
| Lexer(String pattern)
Creates a new ExprLexer using the given String
| |
| Method Summary | |
|---|---|
| int | countTokens()
Counts the number of times nextToken can be called without
returning null
|
| boolean | hasMoreTokens()
Determines if there are any tokens available |
| static boolean | isAdditiveOp(Token token) |
| static boolean | isAxisIdentifier(Token token) |
| static boolean | isBinaryOp(Token token) |
| boolean | isDelimiter(char ch)
Determines if the specified char is a delimiter |
| static boolean | isDigit(char ch)
Returns true if the char argument is a digit |
| static boolean | isEqualityOp(Token token) |
| static boolean | isLetter(char ch)
Returns true if the char argument is a letter |
| static boolean | isMultiplicativeOp(Token token) |
| static boolean | isNCNameChar(char ch)
Returns true if the char argument is an NCNameChar,
as defined by the XML Namespaces recommendation
http://www.w3c.org/TR/1999/REC-xml-names-199904114 |
| boolean | isOperator(Token token) |
| static boolean | isQNameChar(char ch)
Returns true if the char argument is an QName character,
as defined by the XML Namespaces recommendation
http://www.w3c.org/TR/1999/REC-xml-names-199904114 |
| static boolean | isRelationalOp(Token token) |
| static boolean | isWhitespace(char ch) |
| Token | lookAhead(int offset)
Allows looking ahead for tokens without affecting the
token sequence as called by nextToken or previousToken.
|
| Token | nextToken()
Retrieves the next available token |
| void | pushBack()
Moves the position of this Lexer back one
|
| void | resetPosition()
Resets the position of the token pointer to the beginning
|
| String | toString() |
| String | toStringPrevious() |
| String | toStringRemainder() |
Returns: true if there are tokens available, otherwise false
Parameters: ch the char to compare to the delimiters
Returns: true if the String argument is a delimiter
Returns: true if the char argument is a digit
Returns: true if the char argument is a letter
Returns: true if the char argument is an NCNameChar
Returns: true if the char argument is an QName character
Parameters: offset the number of tokens to lookAhead
Returns: the next token
Throws: IllegalArgumentException if offset is less than 0.
Returns: the next available token or null if there are none