|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.adaptx.xpath.engine.Lexer
public class Lexer
A Lexical Analizer of XPath patterns and expressions
Field Summary | |
---|---|
static char |
ADDITION_OP
|
static char |
AT_SYMBOL
|
static char |
COLON
|
static char |
COMMA
|
static char |
CR
|
static char |
D_QUOTE
|
static char |
DOLLAR_SYMBOL
|
static char |
EQUALS_OP
|
static char |
FORWARD_SLASH
|
static char |
GREATER_THAN_OP
|
static char |
L_BRACKET
|
static char |
L_PAREN
|
static char |
LESS_THAN_OP
|
static char |
LF
|
static char |
MULTIPLY_OP
|
static char |
NEGATION_OP
|
static char |
PERIOD
|
static char |
R_BRACKET
|
static char |
R_PAREN
|
static char |
S_QUOTE
|
static char |
SPACE
|
static char |
SUBTRACTION_OP
|
static char |
TAB
|
static Token[] |
tokenSet
the delimiter set of an ExprLexer |
static char |
VERT_BAR
|
Constructor Summary | |
---|---|
Lexer(java.lang.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 |
java.lang.String |
toString()
|
java.lang.String |
toStringPrevious()
|
java.lang.String |
toStringRemainder()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char FORWARD_SLASH
public static final char L_PAREN
public static final char R_PAREN
public static final char L_BRACKET
public static final char R_BRACKET
public static final char PERIOD
public static final char COMMA
public static final char AT_SYMBOL
public static final char DOLLAR_SYMBOL
public static final char S_QUOTE
public static final char D_QUOTE
public static final char VERT_BAR
public static final char COLON
public static final char SPACE
public static final char TAB
public static final char LF
public static final char CR
public static final char NEGATION_OP
public static final char EQUALS_OP
public static final char ADDITION_OP
public static final char SUBTRACTION_OP
public static final char LESS_THAN_OP
public static final char GREATER_THAN_OP
public static final char MULTIPLY_OP
public static final Token[] tokenSet
Constructor Detail |
---|
public Lexer(java.lang.String pattern) throws ParseException
ParseException
Method Detail |
---|
public int countTokens()
public boolean hasMoreTokens()
public boolean isDelimiter(char ch)
ch
- the char to compare to the delimiters
public boolean isOperator(Token token)
public static boolean isAdditiveOp(Token token)
public static boolean isAxisIdentifier(Token token)
public static boolean isBinaryOp(Token token)
public static boolean isEqualityOp(Token token)
public static boolean isRelationalOp(Token token)
public static boolean isMultiplicativeOp(Token token)
public static boolean isDigit(char ch)
public static boolean isLetter(char ch)
public static boolean isNCNameChar(char ch)
public static boolean isQNameChar(char ch)
public static boolean isWhitespace(char ch)
public Token lookAhead(int offset) throws java.lang.IllegalArgumentException
offset
- the number of tokens to lookAhead
java.lang.IllegalArgumentException
- if offset is less than 0.public Token nextToken()
public void pushBack()
public void resetPosition()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringPrevious()
public java.lang.String toStringRemainder()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |