TokenType class

The types of tokens that can be returned by the scanner.

Clients may not extend, implement or mix-in this class.

Implementers

Constructors

TokenType(String lexeme, String name, int precedence, int kind, {bool isModifier: false, bool isOperator: false, bool isTopLevelKeyword: false, bool isUserDefinableOperator: false, String stringValue: 'unspecified'})
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
isAdditiveOperator bool
Return true if this type of token represents an additive operator.
read-only
isAssignmentOperator bool
Return true if this type of token represents an assignment operator.
read-only
isAssociativeOperator bool
Return true if this type of token represents an associative operator. An associative operator is an operator for which the following equality is true: (a * b) * c == a * (b * c). In other words, if the result of applying the operator to multiple operands does not depend on the order in which those applications occur. [...]
read-only
isBuiltIn bool
A flag indicating whether the keyword is a "built-in" identifier.
read-only
isEqualityOperator bool
Return true if this type of token represents an equality operator.
read-only
isIncrementOperator bool
Return true if this type of token represents an increment operator.
read-only
isKeyword bool
Return true if this type of token is a keyword.
read-only
isModifier bool
true if this token type represents a modifier such as abstract or const.
final
isMultiplicativeOperator bool
Return true if this type of token represents a multiplicative operator.
read-only
isOperator bool
true if this token type represents an operator.
final
isPseudo bool
A flag indicating whether the keyword can be used as an identifier in some situations.
read-only
isRelationalOperator bool
Return true if this type of token represents a relational operator.
read-only
isReservedWord bool
A flag indicating whether the keyword is a "reserved word".
read-only
isSelectorOperator bool
Return true if this type of token represents a selector operator (starting token of a selector).
read-only
isShiftOperator bool
Return true if this type of token represents a shift operator.
read-only
isTopLevelKeyword bool
true if this token type represents a keyword starting a top level declaration such as class, enum, import, etc.
final
isUnaryPostfixOperator bool
Return true if this type of token represents a unary postfix operator.
read-only
isUnaryPrefixOperator bool
Return true if this type of token represents a unary prefix operator.
read-only
isUserDefinableOperator bool
true if this token type represents an operator that can be defined by users.
final
kind int
final
lexeme String
The lexeme that defines this type of token, or null if there is more than one possible lexeme for this type of token.
final
name String
The name of the token type.
final
precedence int
The precedence of this type of token, or 0 if the token does not represent an operator.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringValue String
See Token.stringValue for an explanation.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

all → const List<TokenType>
const <TokenType>[TokenType.EOF, TokenType.DOUBLE, TokenType.HEXADECIMAL, TokenType.IDENTIFIER, TokenType.INT, TokenType.MULTI_LINE_COMMENT, TokenType.SCRIPT_TAG, TokenType.SINGLE_LINE_COMMENT, …
AMPERSAND → const TokenType
const TokenType('&', 'AMPERSAND', BITWISE_AND_PRECEDENCE, AMPERSAND_TOKEN, isOperator: true, isUserDefinableOperator: true)
AMPERSAND_AMPERSAND → const TokenType
const TokenType('&&', 'AMPERSAND_AMPERSAND', LOGICAL_AND_PRECEDENCE, AMPERSAND_AMPERSAND_TOKEN, isOperator: true)
AMPERSAND_AMPERSAND_EQ → const TokenType
const TokenType('&&=', 'AMPERSAND_AMPERSAND_EQ', ASSIGNMENT_PRECEDENCE, AMPERSAND_AMPERSAND_EQ_TOKEN, isOperator: true)
AMPERSAND_EQ → const TokenType
const TokenType('&=', 'AMPERSAND_EQ', ASSIGNMENT_PRECEDENCE, AMPERSAND_EQ_TOKEN, isOperator: true)
AS → const TokenType
Keyword.AS
AT → const TokenType
const TokenType('@', 'AT', NO_PRECEDENCE, AT_TOKEN)
BACKPING → const TokenType
const TokenType('`', 'BACKPING', NO_PRECEDENCE, BACKPING_TOKEN)
BACKSLASH → const TokenType
const TokenType('\\', 'BACKSLASH', NO_PRECEDENCE, BACKSLASH_TOKEN)
BAD_INPUT → const TokenType
Token type used by error tokens.
const TokenType('malformed input', 'BAD_INPUT', NO_PRECEDENCE, BAD_INPUT_TOKEN, stringValue: null)
BANG → const TokenType
const TokenType('!', 'BANG', PREFIX_PRECEDENCE, BANG_TOKEN, isOperator: true)
BANG_EQ → const TokenType
const TokenType('!=', 'BANG_EQ', EQUALITY_PRECEDENCE, BANG_EQ_TOKEN, isOperator: true)
BANG_EQ_EQ → const TokenType
const TokenType('!==', 'BANG_EQ_EQ', EQUALITY_PRECEDENCE, BANG_EQ_EQ_TOKEN)
BAR → const TokenType
const TokenType('|', 'BAR', BITWISE_OR_PRECEDENCE, BAR_TOKEN, isOperator: true, isUserDefinableOperator: true)
BAR_BAR → const TokenType
const TokenType('||', 'BAR_BAR', LOGICAL_OR_PRECEDENCE, BAR_BAR_TOKEN, isOperator: true)
BAR_BAR_EQ → const TokenType
const TokenType('||=', 'BAR_BAR_EQ', ASSIGNMENT_PRECEDENCE, BAR_BAR_EQ_TOKEN, isOperator: true)
BAR_EQ → const TokenType
const TokenType('|=', 'BAR_EQ', ASSIGNMENT_PRECEDENCE, BAR_EQ_TOKEN, isOperator: true)
CARET → const TokenType
const TokenType('^', 'CARET', BITWISE_XOR_PRECEDENCE, CARET_TOKEN, isOperator: true, isUserDefinableOperator: true)
CARET_EQ → const TokenType
const TokenType('^=', 'CARET_EQ', ASSIGNMENT_PRECEDENCE, CARET_EQ_TOKEN, isOperator: true)
CLOSE_CURLY_BRACKET → const TokenType
const TokenType('}', 'CLOSE_CURLY_BRACKET', NO_PRECEDENCE, CLOSE_CURLY_BRACKET_TOKEN)
CLOSE_PAREN → const TokenType
const TokenType(')', 'CLOSE_PAREN', NO_PRECEDENCE, CLOSE_PAREN_TOKEN)
CLOSE_SQUARE_BRACKET → const TokenType
const TokenType(']', 'CLOSE_SQUARE_BRACKET', NO_PRECEDENCE, CLOSE_SQUARE_BRACKET_TOKEN)
COLON → const TokenType
const TokenType(':', 'COLON', NO_PRECEDENCE, COLON_TOKEN)
COMMA → const TokenType
const TokenType(',', 'COMMA', NO_PRECEDENCE, COMMA_TOKEN)
DOUBLE → const TokenType
const TokenType('double', 'DOUBLE', NO_PRECEDENCE, DOUBLE_TOKEN, stringValue: null)
EOF → const TokenType
The type of the token that marks the start or end of the input.
const TokenType('', 'EOF', NO_PRECEDENCE, EOF_TOKEN)
EQ → const TokenType
const TokenType('=', 'EQ', ASSIGNMENT_PRECEDENCE, EQ_TOKEN, isOperator: true)
EQ_EQ → const TokenType
const TokenType('==', 'EQ_EQ', EQUALITY_PRECEDENCE, EQ_EQ_TOKEN, isOperator: true, isUserDefinableOperator: true)
EQ_EQ_EQ → const TokenType
The === operator is not supported in the Dart language but is parsed as such by the scanner to support better recovery when a JavaScript code snippet is pasted into a Dart file.
const TokenType('===', 'EQ_EQ_EQ', EQUALITY_PRECEDENCE, EQ_EQ_EQ_TOKEN)
FUNCTION → const TokenType
const TokenType('=>', 'FUNCTION', NO_PRECEDENCE, FUNCTION_TOKEN)
GT → const TokenType
const TokenType('>', 'GT', RELATIONAL_PRECEDENCE, GT_TOKEN, isOperator: true, isUserDefinableOperator: true)
GT_EQ → const TokenType
const TokenType('>=', 'GT_EQ', RELATIONAL_PRECEDENCE, GT_EQ_TOKEN, isOperator: true, isUserDefinableOperator: true)
GT_GT → const TokenType
const TokenType('>>', 'GT_GT', SHIFT_PRECEDENCE, GT_GT_TOKEN, isOperator: true, isUserDefinableOperator: true)
GT_GT_EQ → const TokenType
const TokenType('>>=', 'GT_GT_EQ', ASSIGNMENT_PRECEDENCE, GT_GT_EQ_TOKEN, isOperator: true)
GT_GT_GT → const TokenType
const TokenType('>>>', 'GT_GT_GT', SHIFT_PRECEDENCE, GT_GT_GT_TOKEN, isOperator: true, isUserDefinableOperator: true)
GT_GT_GT_EQ → const TokenType
const TokenType('>>>=', 'GT_GT_GT_EQ', ASSIGNMENT_PRECEDENCE, GT_GT_GT_EQ_TOKEN, isOperator: true)
HASH → const TokenType
const TokenType('#', 'HASH', NO_PRECEDENCE, HASH_TOKEN)
HEXADECIMAL → const TokenType
const TokenType('hexadecimal', 'HEXADECIMAL', NO_PRECEDENCE, HEXADECIMAL_TOKEN, stringValue: null)
IDENTIFIER → const TokenType
const TokenType('identifier', 'IDENTIFIER', NO_PRECEDENCE, IDENTIFIER_TOKEN, stringValue: null)
INDEX → const TokenType
const TokenType('[]', 'INDEX', SELECTOR_PRECEDENCE, INDEX_TOKEN, isOperator: true, isUserDefinableOperator: true)
INDEX_EQ → const TokenType
const TokenType('[]=', 'INDEX_EQ', NO_PRECEDENCE, INDEX_EQ_TOKEN, isOperator: true, isUserDefinableOperator: true)
INT → const TokenType
const TokenType('int', 'INT', NO_PRECEDENCE, INT_TOKEN, stringValue: null)
IS → const TokenType
Keyword.IS
LT → const TokenType
const TokenType('<', 'LT', RELATIONAL_PRECEDENCE, LT_TOKEN, isOperator: true, isUserDefinableOperator: true)
LT_EQ → const TokenType
const TokenType('<=', 'LT_EQ', RELATIONAL_PRECEDENCE, LT_EQ_TOKEN, isOperator: true, isUserDefinableOperator: true)
LT_LT → const TokenType
const TokenType('<<', 'LT_LT', SHIFT_PRECEDENCE, LT_LT_TOKEN, isOperator: true, isUserDefinableOperator: true)
LT_LT_EQ → const TokenType
const TokenType('<<=', 'LT_LT_EQ', ASSIGNMENT_PRECEDENCE, LT_LT_EQ_TOKEN, isOperator: true)
MINUS → const TokenType
const TokenType('-', 'MINUS', ADDITIVE_PRECEDENCE, MINUS_TOKEN, isOperator: true, isUserDefinableOperator: true)
MINUS_EQ → const TokenType
const TokenType('-=', 'MINUS_EQ', ASSIGNMENT_PRECEDENCE, MINUS_EQ_TOKEN, isOperator: true)
MINUS_MINUS → const TokenType
const TokenType('--', 'MINUS_MINUS', POSTFIX_PRECEDENCE, MINUS_MINUS_TOKEN, isOperator: true)
MULTI_LINE_COMMENT → const TokenType
const TokenType('comment', 'MULTI_LINE_COMMENT', NO_PRECEDENCE, COMMENT_TOKEN, stringValue: null)
OPEN_CURLY_BRACKET → const TokenType
const TokenType('{', 'OPEN_CURLY_BRACKET', NO_PRECEDENCE, OPEN_CURLY_BRACKET_TOKEN)
OPEN_PAREN → const TokenType
const TokenType('(', 'OPEN_PAREN', SELECTOR_PRECEDENCE, OPEN_PAREN_TOKEN)
OPEN_SQUARE_BRACKET → const TokenType
const TokenType('[', 'OPEN_SQUARE_BRACKET', SELECTOR_PRECEDENCE, OPEN_SQUARE_BRACKET_TOKEN)
PERCENT → const TokenType
const TokenType('%', 'PERCENT', MULTIPLICATIVE_PRECEDENCE, PERCENT_TOKEN, isOperator: true, isUserDefinableOperator: true)
PERCENT_EQ → const TokenType
const TokenType('%=', 'PERCENT_EQ', ASSIGNMENT_PRECEDENCE, PERCENT_EQ_TOKEN, isOperator: true)
PERIOD → const TokenType
const TokenType('.', 'PERIOD', SELECTOR_PRECEDENCE, PERIOD_TOKEN)
PERIOD_PERIOD → const TokenType
const TokenType('..', 'PERIOD_PERIOD', CASCADE_PRECEDENCE, PERIOD_PERIOD_TOKEN, isOperator: true)
PERIOD_PERIOD_PERIOD → const TokenType
const TokenType('...', 'PERIOD_PERIOD_PERIOD', NO_PRECEDENCE, PERIOD_PERIOD_PERIOD_TOKEN)
PERIOD_PERIOD_PERIOD_QUESTION → const TokenType
const TokenType('...?', 'PERIOD_PERIOD_PERIOD_QUESTION', NO_PRECEDENCE, PERIOD_PERIOD_PERIOD_QUESTION_TOKEN)
PLUS → const TokenType
const TokenType('+', 'PLUS', ADDITIVE_PRECEDENCE, PLUS_TOKEN, isOperator: true, isUserDefinableOperator: true)
PLUS_EQ → const TokenType
const TokenType('+=', 'PLUS_EQ', ASSIGNMENT_PRECEDENCE, PLUS_EQ_TOKEN, isOperator: true)
PLUS_PLUS → const TokenType
const TokenType('++', 'PLUS_PLUS', POSTFIX_PRECEDENCE, PLUS_PLUS_TOKEN, isOperator: true)
QUESTION → const TokenType
const TokenType('?', 'QUESTION', CONDITIONAL_PRECEDENCE, QUESTION_TOKEN, isOperator: true)
QUESTION_PERIOD → const TokenType
const TokenType('?.', 'QUESTION_PERIOD', SELECTOR_PRECEDENCE, QUESTION_PERIOD_TOKEN, isOperator: true)
QUESTION_PERIOD_PERIOD → const TokenType
const TokenType('?..', 'QUESTION_PERIOD_PERIOD', CASCADE_PRECEDENCE, QUESTION_PERIOD_PERIOD_TOKEN)
QUESTION_QUESTION → const TokenType
const TokenType('??', 'QUESTION_QUESTION', IF_NULL_PRECEDENCE, QUESTION_QUESTION_TOKEN, isOperator: true)
QUESTION_QUESTION_EQ → const TokenType
const TokenType('??=', 'QUESTION_QUESTION_EQ', ASSIGNMENT_PRECEDENCE, QUESTION_QUESTION_EQ_TOKEN, isOperator: true)
RECOVERY → const TokenType
Token type used by synthetic tokens that are created during parser recovery (non-analyzer use case).
const TokenType('recovery', 'RECOVERY', NO_PRECEDENCE, RECOVERY_TOKEN, stringValue: null)
SCRIPT_TAG → const TokenType
const TokenType('script', 'SCRIPT_TAG', NO_PRECEDENCE, SCRIPT_TOKEN)
SEMICOLON → const TokenType
const TokenType(';', 'SEMICOLON', NO_PRECEDENCE, SEMICOLON_TOKEN)
SINGLE_LINE_COMMENT → const TokenType
const TokenType('comment', 'SINGLE_LINE_COMMENT', NO_PRECEDENCE, COMMENT_TOKEN, stringValue: null)
SLASH → const TokenType
const TokenType('/', 'SLASH', MULTIPLICATIVE_PRECEDENCE, SLASH_TOKEN, isOperator: true, isUserDefinableOperator: true)
SLASH_EQ → const TokenType
const TokenType('/=', 'SLASH_EQ', ASSIGNMENT_PRECEDENCE, SLASH_EQ_TOKEN, isOperator: true)
STAR → const TokenType
const TokenType('*', 'STAR', MULTIPLICATIVE_PRECEDENCE, STAR_TOKEN, isOperator: true, isUserDefinableOperator: true)
STAR_EQ → const TokenType
const TokenType('*=', 'STAR_EQ', ASSIGNMENT_PRECEDENCE, STAR_EQ_TOKEN, isOperator: true)
STRING → const TokenType
const TokenType('string', 'STRING', NO_PRECEDENCE, STRING_TOKEN, stringValue: null)
STRING_INTERPOLATION_EXPRESSION → const TokenType
const TokenType('\${', 'STRING_INTERPOLATION_EXPRESSION', NO_PRECEDENCE, STRING_INTERPOLATION_TOKEN)
STRING_INTERPOLATION_IDENTIFIER → const TokenType
const TokenType('\$', 'STRING_INTERPOLATION_IDENTIFIER', NO_PRECEDENCE, STRING_INTERPOLATION_IDENTIFIER_TOKEN)
TILDE → const TokenType
const TokenType('~', 'TILDE', PREFIX_PRECEDENCE, TILDE_TOKEN, isOperator: true, isUserDefinableOperator: true)
TILDE_SLASH → const TokenType
const TokenType('~/', 'TILDE_SLASH', MULTIPLICATIVE_PRECEDENCE, TILDE_SLASH_TOKEN, isOperator: true, isUserDefinableOperator: true)
TILDE_SLASH_EQ → const TokenType
const TokenType('~/=', 'TILDE_SLASH_EQ', ASSIGNMENT_PRECEDENCE, TILDE_SLASH_EQ_TOKEN, isOperator: true)