Package de.odysseus.el.tree.impl
Class Scanner
java.lang.Object
de.odysseus.el.tree.impl.Scanner
Handcrafted scanner.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classScan exception typestatic enumSymbol typestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringBuilderprivate static final HashMap<Scanner.Symbol, Scanner.Token> private final Stringprivate static final HashMap<String, Scanner.Token> private intprivate Scanner.Token -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddFixToken(Scanner.Token token) private static voidaddKeyToken(Scanner.Token token) protected Scanner.Tokenfixed(Scanner.Symbol symbol) getInput()intgetToken()protected booleanisDigit(char c) protected booleanisEval()protected Scanner.Tokennext()Scan next token.protected Scanner.TokennextEval()token inside an eval expressionprotected Scanner.Tokennumber tokenprotected Scanner.Tokenstring tokenprotected Scanner.TokennextText()text tokenprotected Scanner.Tokenprotected Scanner.Tokentoken(Scanner.Symbol symbol, String value, int length)
-
Field Details
-
KEYMAP
-
FIXMAP
-
token
-
position
private int position -
input
-
builder
-
-
Constructor Details
-
Scanner
Constructor.- Parameters:
input- expression string
-
-
Method Details
-
addFixToken
-
addKeyToken
-
getInput
-
getToken
- Returns:
- current token
-
getPosition
public int getPosition()- Returns:
- current input position
-
isDigit
protected boolean isDigit(char c) - Returns:
trueiff the specified character is a digit
-
keyword
- Parameters:
s- name- Returns:
- token for the given keyword or
null
-
fixed
- Parameters:
symbol-- Returns:
- token for the given symbol
-
token
-
isEval
protected boolean isEval() -
nextText
text token- Throws:
Scanner.ScanException
-
nextString
string token- Throws:
Scanner.ScanException
-
nextNumber
number token- Throws:
Scanner.ScanException
-
nextEval
token inside an eval expression- Throws:
Scanner.ScanException
-
nextToken
- Throws:
Scanner.ScanException
-
next
Scan next token. After calling this method,getToken()andgetPosition()can be used to retreive the token's image and input position.- Returns:
- scanned token
- Throws:
Scanner.ScanException
-