All Packages Class Hierarchy This Package Previous Next Index
Class com.kvisco.xsl.util.ExprLexer
com.kvisco.xsl.util.ExprLexer
- public class ExprLexer
A Lexical Analizer of XSL patterns and expressions
- Author:
- Keith Visco
-
ADDITION_OP
-
-
AT_SYMBOL
-
-
COMMA
-
-
CR
-
-
D_QUOTE
-
-
DOLLAR_SYMBOL
-
-
EQUALS_OP
-
-
FORWARD_SLASH
-
-
GREATER_THAN_OP
-
-
L_BRACKET
-
-
L_PAREN
-
-
LESS_THAN_OP
-
-
LF
-
-
MULTIPLY_OP
-
-
PERIOD
-
-
R_BRACKET
-
-
R_PAREN
-
-
S_QUOTE
-
-
SPACE
-
-
SUBTRACTION_OP
-
-
TAB
-
-
tokenSet
- the delimiter set of an ExprLexer
-
VERT_BAR
-
-
ExprLexer(String)
- Creates a new ExprLexer using the given String
-
advance(int)
- Advances the index of this tokenizer ahead by the given offset
-
countTokens()
- Counts the number of times nextToken can be called without
returning null
-
getPosition()
-
-
hasMoreTokens()
- Determines if there are any tokens available
-
isAdditiveOp(Token)
-
-
isBinaryOp(Token)
-
-
isDelimiter(char)
- Determines if the specified char is a delimiter
-
isDigit(char)
- Returns true if the char argument is a digit
-
isEqualityOp(Token)
-
-
isLetter(char)
- Returns true if the char argument is a letter
-
isMultiplicativeOp(Token)
-
-
isNCNameChar(char)
- 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
-
isOperator(Token)
-
-
isQNameChar(char)
- 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
-
isRelationalOp(Token)
-
-
isWhitespace(char)
-
-
lookAhead(int)
- Allows looking ahead for tokens without affecting the
token sequence as called by nextToken or previousToken
-
main(String[])
-
-
nextToken()
- Retrieves the next available token
-
pushBack()
- Moves the position of this Lexer back one
-
resetPosition()
- Resets the position of the token pointer to the beginning
-
setPosition(int)
- Sets the current position of this tokenizer.
-
toString()
-
FORWARD_SLASH
public static final char FORWARD_SLASH
L_PAREN
public static final char L_PAREN
R_PAREN
public static final char R_PAREN
L_BRACKET
public static final char L_BRACKET
R_BRACKET
public static final char R_BRACKET
PERIOD
public static final char PERIOD
COMMA
public static final char COMMA
AT_SYMBOL
public static final char AT_SYMBOL
DOLLAR_SYMBOL
public static final char DOLLAR_SYMBOL
S_QUOTE
public static final char S_QUOTE
D_QUOTE
public static final char D_QUOTE
VERT_BAR
public static final char VERT_BAR
SPACE
public static final char SPACE
TAB
public static final char TAB
LF
public static final char LF
CR
public static final char CR
EQUALS_OP
public static final char EQUALS_OP
ADDITION_OP
public static final char ADDITION_OP
SUBTRACTION_OP
public static final char SUBTRACTION_OP
LESS_THAN_OP
public static final char LESS_THAN_OP
GREATER_THAN_OP
public static final char GREATER_THAN_OP
MULTIPLY_OP
public static final char MULTIPLY_OP
tokenSet
public static final Token tokenSet[]
- the delimiter set of an ExprLexer
ExprLexer
public ExprLexer(String pattern)
- Creates a new ExprLexer using the given String
advance
public void advance(int offset)
- Advances the index of this tokenizer ahead by the given offset
countTokens
public int countTokens()
- Counts the number of times nextToken can be called without
returning null
getPosition
public int getPosition()
hasMoreTokens
public boolean hasMoreTokens()
- Determines if there are any tokens available
- Returns:
- true if there are tokens available, otherwise false
isDelimiter
public boolean isDelimiter(char ch)
- Determines if the specified char is a delimiter
- Parameters:
- ch - the char to compare to the delimiters
- Returns:
- true if the String argument is a delimiter
isOperator
public boolean isOperator(Token token)
isAdditiveOp
public static boolean isAdditiveOp(Token token)
isBinaryOp
public static boolean isBinaryOp(Token token)
isEqualityOp
public static boolean isEqualityOp(Token token)
isRelationalOp
public static boolean isRelationalOp(Token token)
isMultiplicativeOp
public static boolean isMultiplicativeOp(Token token)
isDigit
public static boolean isDigit(char ch)
- Returns true if the char argument is a digit
- Returns:
- true if the char argument is a digit
isLetter
public static boolean isLetter(char ch)
- Returns true if the char argument is a letter
- Returns:
- true if the char argument is a letter
isNCNameChar
public 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
- Returns:
- true if the char argument is an NCNameChar
isQNameChar
public 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
- Returns:
- true if the char argument is an QName character
isWhitespace
public static boolean isWhitespace(char ch)
lookAhead
public Token lookAhead(int offset)
- Allows looking ahead for tokens without affecting the
token sequence as called by nextToken or previousToken
nextToken
public Token nextToken()
- Retrieves the next available token
- Returns:
- the next available token or null if there are none
pushBack
public void pushBack()
- Moves the position of this Lexer back one
resetPosition
public void resetPosition()
- Resets the position of the token pointer to the beginning
setPosition
public void setPosition(int position)
- Sets the current position of this tokenizer.
- Parameters:
- position - the index value to set the current position to.
if position is greater than the number of tokens, the tokenizer
is advanced to the end. If the given position is less than 0,
the tokenizer is positioned at the beginning
toString
public String toString()
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index