Enum Class TokenType

java.lang.Object
java.lang.Enum<TokenType>
tech.ixor.calclox.token.TokenType
All Implemented Interfaces:
Serializable, Comparable<TokenType>, Constable

public enum TokenType extends Enum<TokenType>
Lexical categories recognized by the CalcLox scanner.
  • Enum Constant Details

    • DEFINE

      public static final TokenType DEFINE
      The keyword "define", used to define a user input value (that asks the user to input when running the program).
    • VAR

      public static final TokenType VAR
      The keyword "var", used to declare a in-program variable that is not modifiable by the user directly.
    • OUTPUT

      public static final TokenType OUTPUT
      The keyword output, used to send a value to the host frontend.
    • NIL

      public static final TokenType NIL
      A "nil" value, which is used to represent a null value. Reserved for future use.
    • FUN

      public static final TokenType FUN
      The keyword "fun", used to define a function.
    • IF

      public static final TokenType IF
    • ELSE

      public static final TokenType ELSE
    • WHILE

      public static final TokenType WHILE
    • FOR

      public static final TokenType FOR
    • BREAK

      public static final TokenType BREAK
    • CONTINUE

      public static final TokenType CONTINUE
    • RETURN

      public static final TokenType RETURN
    • TRUE

      public static final TokenType TRUE
    • FALSE

      public static final TokenType FALSE
    • AND

      public static final TokenType AND
    • OR

      public static final TokenType OR
    • IDENTIFIER

      public static final TokenType IDENTIFIER
      An identifier, which is a (variable or function) name.
    • STRING

      public static final TokenType STRING
    • NUMBER

      public static final TokenType NUMBER
    • LEFT_PAREN

      public static final TokenType LEFT_PAREN
    • RIGHT_PAREN

      public static final TokenType RIGHT_PAREN
    • LEFT_BRACE

      public static final TokenType LEFT_BRACE
    • RIGHT_BRACE

      public static final TokenType RIGHT_BRACE
    • COMMA

      public static final TokenType COMMA
    • DOT

      public static final TokenType DOT
    • MINUS

      public static final TokenType MINUS
    • PLUS

      public static final TokenType PLUS
    • SEMICOLON

      public static final TokenType SEMICOLON
    • SLASH

      public static final TokenType SLASH
    • STAR

      public static final TokenType STAR
    • BANG

      public static final TokenType BANG
    • BANG_EQUAL

      public static final TokenType BANG_EQUAL
    • EQUAL

      public static final TokenType EQUAL
    • EQUAL_EQUAL

      public static final TokenType EQUAL_EQUAL
    • GREATER

      public static final TokenType GREATER
    • GREATER_EQUAL

      public static final TokenType GREATER_EQUAL
    • LESS

      public static final TokenType LESS
    • LESS_EQUAL

      public static final TokenType LESS_EQUAL
    • EOF

      public static final TokenType EOF
  • Method Details

    • values

      public static TokenType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TokenType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null