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 class
static class
Scan exception typestatic enum
Symbol typestatic class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringBuilder
private static final HashMap
<Scanner.Symbol, Scanner.Token> private final String
private static final HashMap
<String, Scanner.Token> private int
private Scanner.Token
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addFixToken
(Scanner.Token token) private static void
addKeyToken
(Scanner.Token token) protected Scanner.Token
fixed
(Scanner.Symbol symbol) getInput()
int
getToken()
protected boolean
isDigit
(char c) protected boolean
isEval()
protected Scanner.Token
next()
Scan next token.protected Scanner.Token
nextEval()
token inside an eval expressionprotected Scanner.Token
number tokenprotected Scanner.Token
string tokenprotected Scanner.Token
nextText()
text tokenprotected Scanner.Token
protected Scanner.Token
token
(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:
true
iff 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
-