- All Implemented Interfaces:
Serializable,Comparable<TokenKind>,Constable
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 ConstantsEnum ConstantDescriptionA 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 (σorSELECT), or arithmetic.A separator or binder: a comma, a dot, an arrow,↔, a colon.A string literal, including its quotes. -
Method Summary
-
Enum Constant Details
-
OPERATOR
A relational operator, in either spelling (σorSELECT), or arithmetic. -
KEYWORD
A reserved word that is not an operator, comparison or connective:COUNT,ASC,TRUE. -
IDENTIFIER
A name, bare or dotted: a relation, a column, a function. -
STRING
A string literal, including its quotes. -
NUMBER
A numeric literal. -
COMPARISON
A comparison or membership operator:= ≠ < ≤ > ≥,LIKE,IS,∈,∉. -
LOGICAL
A logical connective:∧,∨,¬, or their keywords. -
BRACKET
A parenthesis, brace or square bracket. -
PUNCTUATION
A separator or binder: a comma, a dot, an arrow,↔, a colon. -
COMMENT
A line (--) or block comment. -
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
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
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 nameNullPointerException- if the argument is null
-