java.lang.Object
meteordevelopment.starscript.compiler.Lexer

public class Lexer extends Object
Takes starscript source code and produces a stream or tokens that are used for parsing.
  • Field Details

    • token

      public Token token
      The type of the token.
    • lexeme

      public String lexeme
      The string representation of the token.
    • line

      public int line
    • character

      public int character
    • ch

      public char ch
    • start

      public int start
    • current

      public int current
  • Constructor Details

    • Lexer

      public Lexer(String source)
  • Method Details

    • next

      public void next()
      Scans for next token storing it in token and lexeme. Produces Token.EOF if the end of source code has been reached and Token.Error if there has been an error.