Package com.googlecode.aviator.lexer
Class ExpressionLexer
- java.lang.Object
-
- com.googlecode.aviator.lexer.ExpressionLexer
-
public class ExpressionLexer extends java.lang.Object
Expression Lexer,scan tokens from string
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
expression
private AviatorEvaluatorInstance
instance
private java.text.CharacterIterator
iterator
private int
lineNo
private java.math.MathContext
mathContext
(package private) static char[]
OPS
private static long
OVERFLOW_FLAG
private static long
OVERFLOW_SINGLE
private boolean
parseFloatIntoDecimal
private boolean
parseIntegralNumberIntoDecimal
private char
peek
private SymbolTable
symbolTable
private java.util.LinkedList<Token<?>>
tokenBuffer
(package private) static char[]
VALID_HEX_CHAR
-
Constructor Summary
Constructors Constructor Description ExpressionLexer(AviatorEvaluatorInstance instance, java.lang.String expression)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
getBigNumberLexeme(java.lang.StringBuilder sb)
int
getCurrentIndex()
int
getLineNo()
java.lang.String
getScanString()
SymbolTable
getSymbolTable()
static boolean
isBinaryOP(char ch)
boolean
isValidHexChar(char ch)
void
nextChar()
void
prevChar()
void
pushback(Token<?> token)
Push back tokenToken<?>
scan()
Token<?>
scan(boolean analyse)
void
setLineNo(int lineNo)
-
-
-
Field Detail
-
OVERFLOW_FLAG
private static final long OVERFLOW_FLAG
- See Also:
- Constant Field Values
-
OVERFLOW_SINGLE
private static final long OVERFLOW_SINGLE
- See Also:
- Constant Field Values
-
peek
private char peek
-
iterator
private final java.text.CharacterIterator iterator
-
lineNo
private int lineNo
-
symbolTable
private final SymbolTable symbolTable
-
tokenBuffer
private java.util.LinkedList<Token<?>> tokenBuffer
-
instance
private final AviatorEvaluatorInstance instance
-
expression
private final java.lang.String expression
-
mathContext
private final java.math.MathContext mathContext
-
parseFloatIntoDecimal
private final boolean parseFloatIntoDecimal
-
parseIntegralNumberIntoDecimal
private final boolean parseIntegralNumberIntoDecimal
-
VALID_HEX_CHAR
static final char[] VALID_HEX_CHAR
-
OPS
static final char[] OPS
-
-
Constructor Detail
-
ExpressionLexer
public ExpressionLexer(AviatorEvaluatorInstance instance, java.lang.String expression)
-
-
Method Detail
-
getSymbolTable
public SymbolTable getSymbolTable()
-
setLineNo
public void setLineNo(int lineNo)
-
getLineNo
public int getLineNo()
-
pushback
public void pushback(Token<?> token)
Push back token- Parameters:
token
-
-
scan
public Token<?> scan()
-
nextChar
public void nextChar()
-
prevChar
public void prevChar()
-
isValidHexChar
public boolean isValidHexChar(char ch)
-
getCurrentIndex
public int getCurrentIndex()
-
scan
public Token<?> scan(boolean analyse)
-
getScanString
public java.lang.String getScanString()
-
getBigNumberLexeme
private java.lang.String getBigNumberLexeme(java.lang.StringBuilder sb)
-
isBinaryOP
public static boolean isBinaryOP(char ch)
-
-