org.springframework.expression.spel.standard
Class Tokenizer
java.lang.Object
org.springframework.expression.spel.standard.Tokenizer
class Tokenizer
- extends java.lang.Object
Lex some input data into a stream of tokens that can then be parsed.
- Since:
- 3.0
- Author:
- Andy Clement
Constructor Summary |
Tokenizer(java.lang.String inputdata)
|
Method Summary |
java.util.List<Token> |
getTokens()
|
private boolean |
isAlphabetic(char ch)
|
private boolean |
isChar(char a,
char b)
|
private boolean |
isDigit(char ch)
|
private boolean |
isDoubleSuffix(char ch)
|
private boolean |
isExponentChar(char ch)
|
private boolean |
isFloatSuffix(char ch)
|
private boolean |
isHexadecimalDigit(char ch)
|
private boolean |
isIdentifier(char ch)
|
private boolean |
isSign(char ch)
|
private boolean |
isTwoCharToken(TokenKind kind)
Check if this might be a two character token. |
private void |
lexDoubleQuotedStringLiteral()
|
private void |
lexIdentifier()
|
private void |
lexNumericLiteral(boolean firstCharIsZero)
|
private void |
lexQuotedStringLiteral()
|
void |
process()
|
private void |
pushCharToken(TokenKind kind)
Push a token of just one character in length. |
private void |
pushHexIntToken(char[] data,
boolean isLong,
int start,
int end)
|
private void |
pushIntToken(char[] data,
boolean isLong,
int start,
int end)
|
private void |
pushOneCharOrTwoCharToken(TokenKind kind,
int pos)
|
private void |
pushPairToken(TokenKind kind)
Push a token of two characters in length. |
private void |
pushRealToken(char[] data,
boolean isFloat,
int start,
int end)
|
private char[] |
subarray(int start,
int end)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
expressionString
java.lang.String expressionString
toProcess
char[] toProcess
pos
int pos
max
int max
tokens
java.util.List<Token> tokens
alternativeOperatorNames
private static final java.lang.String[] alternativeOperatorNames
flags
private static final byte[] flags
IS_DIGIT
private static final byte IS_DIGIT
- See Also:
- Constant Field Values
IS_HEXDIGIT
private static final byte IS_HEXDIGIT
- See Also:
- Constant Field Values
IS_ALPHA
private static final byte IS_ALPHA
- See Also:
- Constant Field Values
Tokenizer
public Tokenizer(java.lang.String inputdata)
process
public void process()
getTokens
public java.util.List<Token> getTokens()
lexQuotedStringLiteral
private void lexQuotedStringLiteral()
lexDoubleQuotedStringLiteral
private void lexDoubleQuotedStringLiteral()
lexNumericLiteral
private void lexNumericLiteral(boolean firstCharIsZero)
lexIdentifier
private void lexIdentifier()
pushIntToken
private void pushIntToken(char[] data,
boolean isLong,
int start,
int end)
pushHexIntToken
private void pushHexIntToken(char[] data,
boolean isLong,
int start,
int end)
pushRealToken
private void pushRealToken(char[] data,
boolean isFloat,
int start,
int end)
subarray
private char[] subarray(int start,
int end)
isTwoCharToken
private boolean isTwoCharToken(TokenKind kind)
- Check if this might be a two character token.
pushCharToken
private void pushCharToken(TokenKind kind)
- Push a token of just one character in length.
pushPairToken
private void pushPairToken(TokenKind kind)
- Push a token of two characters in length.
pushOneCharOrTwoCharToken
private void pushOneCharOrTwoCharToken(TokenKind kind,
int pos)
isIdentifier
private boolean isIdentifier(char ch)
isChar
private boolean isChar(char a,
char b)
isExponentChar
private boolean isExponentChar(char ch)
isFloatSuffix
private boolean isFloatSuffix(char ch)
isDoubleSuffix
private boolean isDoubleSuffix(char ch)
isSign
private boolean isSign(char ch)
isDigit
private boolean isDigit(char ch)
isAlphabetic
private boolean isAlphabetic(char ch)
isHexadecimalDigit
private boolean isHexadecimalDigit(char ch)