Enum Class TokenKind

java.lang.Object
java.lang.Enum<TokenKind>
com.darkcollective.relix.embed.TokenKind
All Implemented Interfaces:
Serializable, Comparable<TokenKind>, Constable

public enum TokenKind extends Enum<TokenKind>
What a Token is, in the handful of categories a syntax highlighter colours.

Deliberately coarse: an editor wants one colour for every relational operator, not one per operator, and a category here does not change when the language gains an operator.

Since:
1.0
  • 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
    A parenthesis, brace or square bracket.
    A line (--) or block comment.
    A comparison or membership operator: = ≠ < ≤ > ≥, LIKE, IS, ∈, ∉.
    A name, bare or dotted: a relation, a column, a function.
    The rest of the text from the first point it cannot be tokenized: an unterminated string, a half-typed operator, a stray character.
    A reserved word that is not an operator, comparison or connective: COUNT, ASC, TRUE.
    A logical connective: ∧, ∨, ¬, or their keywords.
    A numeric literal.
    A relational operator, in either spelling (σ or SELECT), or arithmetic.
    A separator or binder: a comma, a dot, an arrow, ↔, a colon.
    A string literal, including its quotes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static TokenKind
    Returns the enum constant of this class with the specified name.
    static TokenKind[]
    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

    • OPERATOR

      public static final TokenKind OPERATOR
      A relational operator, in either spelling (σ or SELECT), or arithmetic.
    • KEYWORD

      public static final TokenKind KEYWORD
      A reserved word that is not an operator, comparison or connective: COUNT, ASC, TRUE.
    • IDENTIFIER

      public static final TokenKind IDENTIFIER
      A name, bare or dotted: a relation, a column, a function.
    • STRING

      public static final TokenKind STRING
      A string literal, including its quotes.
    • NUMBER

      public static final TokenKind NUMBER
      A numeric literal.
    • COMPARISON

      public static final TokenKind COMPARISON
      A comparison or membership operator: = ≠ < ≤ > ≥, LIKE, IS, ∈, ∉.
    • LOGICAL

      public static final TokenKind LOGICAL
      A logical connective: ∧, ∨, ¬, or their keywords.
    • BRACKET

      public static final TokenKind BRACKET
      A parenthesis, brace or square bracket.
    • PUNCTUATION

      public static final TokenKind PUNCTUATION
      A separator or binder: a comma, a dot, an arrow, ↔, a colon.
    • COMMENT

      public static final TokenKind COMMENT
      A line (--) or block comment.
    • INCOMPLETE

      public static final TokenKind INCOMPLETE
      The rest of the text from the first point it cannot be tokenized: an unterminated string, a half-typed operator, a stray character. Always the last token.
  • Method Details

    • values

      public static TokenKind[] 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 TokenKind 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