public enum TokenRole extends Enum<TokenRole>
Pp2Token.
Roles describe how the lexical island pipeline, the AST overlay
annotator (S33), and the layout rules (S24-S29) should treat a token,
orthogonal to the parser's ETokenType. They are computed by
pp2 stages and stored on Pp2Token.roles; the wrapped
TSourceToken is never mutated.
Stored in an EnumSet per token. A token can carry
multiple roles simultaneously (e.g., KEYWORD_CLAUSE +
STATEMENT_START). Adding a role here is a non-breaking change
for downstream consumers as long as they use EnumSet's
contains / add discipline.
| Enum Constant and Description |
|---|
AST_SELECT_LIST_ITEM
Token belongs to a SELECT-list result column (TResultColumn span).
|
AST_TABLE_REF
Token belongs to a table reference in a FROM clause (TTable span).
|
AST_WHERE_CONDITION
Token belongs to a statement's WHERE clause (TWhereClause span).
|
COMMENT_BLOCK
Block comment: {@code /* ...
|
COMMENT_LINE
Single-line comment:
-- ... or # .... |
ERROR_REGION_BOUNDARY
Boundary of an unrecoverable error region; assembler must preserve verbatim.
|
HINT
Hint comment, typically {@code /*+ ...
|
IDENTIFIER
Plain identifier (table name, column name, alias).
|
INCOMPLETE_SCOPE_MARKER
Marks a position where a scope (paren, BEGIN/END, CASE) is known to be
incomplete in the source.
|
KEYWORD_CLAUSE
Clause keyword (FROM, WHERE, GROUP BY, ORDER BY, HAVING, JOIN, ...).
|
KEYWORD_GENERIC
Generic keyword that is neither master nor clause (e.g., AS, DISTINCT).
|
KEYWORD_MASTER
Master statement keyword (SELECT, INSERT, UPDATE, DELETE, MERGE, ...).
|
LITERAL
Literal value (numeric, string, boolean, NULL).
|
NO_FORMAT_ZONE
Token lies inside a
--BEGIN_NO_FORMAT / --END_NO_FORMAT
block (or any other protected span). |
OPERATOR
Operator: arithmetic, comparison, logical, concatenation, etc.
|
PUNCTUATION
Punctuation: comma, semicolon, parenthesis, brackets.
|
QUOTED_IDENTIFIER
Quoted identifier (backticks, double-quotes, square brackets).
|
STATEMENT_START
Marks the start of a new top-level SQL statement.
|
TEMPLATE_PLACEHOLDER
Template placeholder (
${name}, {{name}}, #{name}). |
| Modifier and Type | Method and Description |
|---|---|
static TokenRole |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TokenRole[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TokenRole KEYWORD_MASTER
public static final TokenRole KEYWORD_CLAUSE
public static final TokenRole KEYWORD_GENERIC
public static final TokenRole IDENTIFIER
public static final TokenRole QUOTED_IDENTIFIER
public static final TokenRole COMMENT_LINE
-- ... or # ....public static final TokenRole COMMENT_BLOCK
/* ... */ (including nested where supported).public static final TokenRole PUNCTUATION
public static final TokenRole OPERATOR
public static final TokenRole NO_FORMAT_ZONE
--BEGIN_NO_FORMAT / --END_NO_FORMAT
block (or any other protected span). The lexical island renderer must
emit it byte-exact.public static final TokenRole TEMPLATE_PLACEHOLDER
${name}, {{name}}, #{name}).public static final TokenRole INCOMPLETE_SCOPE_MARKER
public static final TokenRole ERROR_REGION_BOUNDARY
public static final TokenRole STATEMENT_START
public static final TokenRole AST_SELECT_LIST_ITEM
public static final TokenRole AST_TABLE_REF
public static final TokenRole AST_WHERE_CONDITION
public static TokenRole[] values()
for (TokenRole c : TokenRole.values()) System.out.println(c);
public static TokenRole valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null