Enum Class TokenType

java.lang.Object
java.lang.Enum<TokenType>
technology.sola.script.tokenizer.TokenType
All Implemented Interfaces:
Serializable, Comparable<TokenType>, Constable

public enum TokenType extends Enum<TokenType>
TokenType contains all recognized token types for sola script.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Single or double character token - "&&"
    Single or double character token - "!"
    Single or double character token - "!="
    Single or double character token - "||"
    Single character token - ":"
    Single character token - ","
    Single character token - "."
    Keyword - "else"
    Special end of file
    Single or double character token - "="
    Single or double character token - "=="
    Keyword - "false"
    Keyword - "for"
    Keyword for function declaration - "fun"
    Single or double character token - ">"
    Single or double character token - ">="
    An identifier for a function, variable or value - [a-zA-Z_][a-zA-Z0-9_]*
    Keyword - "if"
    Single character token - "{"
    Single character token - "("
    Single or double character token - "<"
    Single or double character token - "<="
    Single character token - "-"
    Keyword - "null"
    A number value - [1-9][0-9]*(\.[0-9]+)?
    Single character token - "+"
    Single or double character token - "?"
    Single or double character token - "?."
    Single or double character token - "??"
    Keyword - "return"
    Single character token - "}"
    Single character token - ")"
    Single character token - ";"
    Single character token - "/"
    Single character token - "*"
    A string value - \".*\"
    Keyword - "true"
    Keyword for value (constant) declaration - "val"
    Keyword for variable declaration - "var"
    Keyword - "while"
  • Method Summary

    Modifier and Type
    Method
    Description
    static TokenType
    Returns the enum constant of this class with the specified name.
    static TokenType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LEFT_PAREN

      public static final TokenType LEFT_PAREN
      Single character token - "("
    • RIGHT_PAREN

      public static final TokenType RIGHT_PAREN
      Single character token - ")"
    • LEFT_BRACE

      public static final TokenType LEFT_BRACE
      Single character token - "{"
    • RIGHT_BRACE

      public static final TokenType RIGHT_BRACE
      Single character token - "}"
    • COMMA

      public static final TokenType COMMA
      Single character token - ","
    • DOT

      public static final TokenType DOT
      Single character token - "."
    • MINUS

      public static final TokenType MINUS
      Single character token - "-"
    • PLUS

      public static final TokenType PLUS
      Single character token - "+"
    • COLON

      public static final TokenType COLON
      Single character token - ":"
    • SEMICOLON

      public static final TokenType SEMICOLON
      Single character token - ";"
    • SLASH

      public static final TokenType SLASH
      Single character token - "/"
    • STAR

      public static final TokenType STAR
      Single character token - "*"
    • BANG

      public static final TokenType BANG
      Single or double character token - "!"
    • BANG_EQUAL

      public static final TokenType BANG_EQUAL
      Single or double character token - "!="
    • EQUAL

      public static final TokenType EQUAL
      Single or double character token - "="
    • EQUAL_EQUAL

      public static final TokenType EQUAL_EQUAL
      Single or double character token - "=="
    • GREATER

      public static final TokenType GREATER
      Single or double character token - ">"
    • GREATER_EQUAL

      public static final TokenType GREATER_EQUAL
      Single or double character token - ">="
    • LESS

      public static final TokenType LESS
      Single or double character token - "<"
    • LESS_EQUAL

      public static final TokenType LESS_EQUAL
      Single or double character token - "<="
    • AMP_AMP

      public static final TokenType AMP_AMP
      Single or double character token - "&&"
    • BAR_BAR

      public static final TokenType BAR_BAR
      Single or double character token - "||"
    • QUESTION

      public static final TokenType QUESTION
      Single or double character token - "?"
    • QUESTION_QUESTION

      public static final TokenType QUESTION_QUESTION
      Single or double character token - "??"
    • QUESTION_DOT

      public static final TokenType QUESTION_DOT
      Single or double character token - "?."
    • IDENTIFIER

      public static final TokenType IDENTIFIER
      An identifier for a function, variable or value - [a-zA-Z_][a-zA-Z0-9_]*
    • STRING

      public static final TokenType STRING
      A string value - \".*\"
    • NUMBER

      public static final TokenType NUMBER
      A number value - [1-9][0-9]*(\.[0-9]+)?
    • FUN

      public static final TokenType FUN
      Keyword for function declaration - "fun"
    • VAR

      public static final TokenType VAR
      Keyword for variable declaration - "var"
    • VAL

      public static final TokenType VAL
      Keyword for value (constant) declaration - "val"
    • ELSE

      public static final TokenType ELSE
      Keyword - "else"
    • FOR

      public static final TokenType FOR
      Keyword - "for"
    • IF

      public static final TokenType IF
      Keyword - "if"
    • RETURN

      public static final TokenType RETURN
      Keyword - "return"
    • WHILE

      public static final TokenType WHILE
      Keyword - "while"
    • FALSE

      public static final TokenType FALSE
      Keyword - "false"
    • NULL

      public static final TokenType NULL
      Keyword - "null"
    • TRUE

      public static final TokenType TRUE
      Keyword - "true"
    • EOF

      public static final TokenType EOF
      Special end of file
  • 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