Class LexerContext<Token>

java.lang.Object
com.hypixel.hytale.server.npc.util.expression.compile.LexerContext<Token>

public class LexerContext<Token> extends Object
  • Field Details

    • expression

      private String expression
    • length

      private int length
    • position

      private int position
    • token

      private Token token
    • tokenPosition

      private int tokenPosition
    • tokenString

      @Nonnull private StringBuilder tokenString
    • tokenNumber

      private double tokenNumber
  • Constructor Details

    • LexerContext

      public LexerContext()
  • Method Details

    • init

      public void init(@Nonnull String expression)
    • resetToken

      public void resetToken()
    • setToken

      public Token setToken(Token token)
    • getExpression

      public String getExpression()
    • getToken

      public Token getToken()
    • getTokenPosition

      public int getTokenPosition()
    • getTokenString

      @Nonnull public String getTokenString()
    • getTokenNumber

      public double getTokenNumber()
    • nextChar

      protected char nextChar(String error) throws ParseException
      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

      protected void parseNumber(char firstChar) throws ParseException
      Throws:
      ParseException
    • copyDigits

      private char copyDigits(char ch)
    • parseIdent

      protected void parseIdent(char firstLetter)
    • parseString

      protected void parseString(char delimiter) throws ParseException
      Throws:
      ParseException