Class LexerContext<Token>
java.lang.Object
com.hypixel.hytale.server.npc.util.expression.compile.LexerContext<Token>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate intprivate intprivate Tokenprivate doubleprivate intprivate StringBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected charaddTokenCharacter(char ch) protected voidadjustPosition(int newPosition) private charcopyDigits(char ch) protected charprotected booleanprotected intgetToken()doubleintprotected booleanhaveChar()voidprotected booleanisNumber(char firstLetter) protected charprotected voidparseIdent(char firstLetter) protected voidparseNumber(char firstChar) protected voidparseString(char delimiter) protected charpeekChar()protected charpeekChar(char defaultChar) protected charpeekChar(int lookahead) protected charpeekChar(int lookahead, char defaultChar) voidprotected voidsetPosition(int position)
-
Field Details
-
expression
-
length
private int length -
position
private int position -
token
-
tokenPosition
private int tokenPosition -
tokenString
-
tokenNumber
private double tokenNumber
-
-
Constructor Details
-
LexerContext
public LexerContext()
-
-
Method Details
-
init
-
resetToken
public void resetToken() -
setToken
-
getExpression
-
getToken
-
getTokenPosition
public int getTokenPosition() -
getTokenString
-
getTokenNumber
public double getTokenNumber() -
nextChar
- Throws:
ParseException
-
haveChar
protected boolean haveChar() -
currentChar
protected char currentChar() -
peekChar
protected char peekChar(char defaultChar) -
peekChar
protected char peekChar() -
peekChar
protected char peekChar(int lookahead, char defaultChar) -
peekChar
protected char peekChar(int lookahead) -
eatWhiteSpace
protected boolean eatWhiteSpace() -
addTokenCharacter
protected char addTokenCharacter(char ch) -
getPosition
protected int getPosition() -
setPosition
protected void setPosition(int position) -
adjustPosition
protected void adjustPosition(int newPosition) -
isNumber
protected boolean isNumber(char firstLetter) -
parseNumber
- Throws:
ParseException
-
copyDigits
private char copyDigits(char ch) -
parseIdent
protected void parseIdent(char firstLetter) -
parseString
- Throws:
ParseException
-