TokenType class

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

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

Annotations
  • @AnalyzerPublicApi.new(message: 'exported by package:analyzer/dart/ast/token.dart')

Constructors

TokenType(int index, String lexeme, String name, int precedence, int kind, {TokenType? binaryOperatorOfCompoundAssignment, bool isBinaryOperator = false, bool isModifier = false, bool isOperator = false, bool isTopLevelKeyword = false, bool isUserDefinableOperator = false, bool stringValueShouldBeNull = false})
const

Properties

binaryOperatorOfCompoundAssignment → TokenType?
The binary operator that is invoked by this compound assignment operator, or null otherwise.
final
hashCode → int
The hash code for this object.
no setterinherited
index → int
A unique index identifying this TokenType.
final
isAdditiveOperator → bool
Return true if this type of token represents an additive operator.
no setter
isAssignmentOperator → bool
Return true if this type of token represents an assignment operator.
no setter
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.
no setter
isBinaryOperator → bool
true if this token type represents a binary operator.
final
isBuiltIn → bool
A flag indicating whether the keyword is a "built-in" identifier.
no setter
isEqualityOperator → bool
Return true if this type of token represents an equality operator.
no setter
isIncrementOperator → bool
Return true if this type of token represents an increment operator.
no setter
isKeyword → bool
Return true if this type of token is a keyword.
no setter
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.
no setter
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.
no setter
isRelationalOperator → bool
Return true if this type of token represents a relational operator.
no setter
isReservedWord → bool
A flag indicating whether the keyword is a "reserved word".
no setter
isSelectorOperator → bool
Return true if this type of token represents a selector operator (starting token of a selector).
no setter
isShiftOperator → bool
Return true if this type of token represents a shift operator.
no setter
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.
no setter
isUnaryPrefixOperator → bool
Return true if this type of token represents a unary prefix operator.
no setter
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.
no setterinherited
stringValue → String?
See Token.stringValue for an explanation.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

all → const List<TokenType>
AMPERSAND → const TokenType
AMPERSAND_AMPERSAND → const TokenType
AMPERSAND_AMPERSAND_EQ → const TokenType
AMPERSAND_EQ → const TokenType
AS → const TokenType
AT → const TokenType
BACKPING → const TokenType
BACKSLASH → const TokenType
BAD_INPUT → const TokenType
Token type used by error tokens.
BANG → const TokenType
BANG_EQ → const TokenType
BANG_EQ_EQ → const TokenType
BAR → const TokenType
BAR_BAR → const TokenType
BAR_BAR_EQ → const TokenType
BAR_EQ → const TokenType
CARET → const TokenType
CARET_EQ → const TokenType
CLOSE_CURLY_BRACKET → const TokenType
CLOSE_PAREN → const TokenType
CLOSE_SQUARE_BRACKET → const TokenType
COLON → const TokenType
COMMA → const TokenType
DOUBLE → const TokenType
DOUBLE_WITH_SEPARATORS → const TokenType
EOF → const TokenType
The type of the token that marks the start or end of the input.
EQ → const TokenType
EQ_EQ → const TokenType
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.
FUNCTION → const TokenType
GT → const TokenType
GT_EQ → const TokenType
GT_GT → const TokenType
GT_GT_EQ → const TokenType
GT_GT_GT → const TokenType
GT_GT_GT_EQ → const TokenType
HASH → const TokenType
HEXADECIMAL → const TokenType
HEXADECIMAL_WITH_SEPARATORS → const TokenType
IDENTIFIER → const TokenType
INDEX → const TokenType
INDEX_EQ → const TokenType
INT → const TokenType
INT_WITH_SEPARATORS → const TokenType
IS → const TokenType
LT → const TokenType
LT_EQ → const TokenType
LT_LT → const TokenType
LT_LT_EQ → const TokenType
MINUS → const TokenType
MINUS_EQ → const TokenType
MINUS_MINUS → const TokenType
MULTI_LINE_COMMENT → const TokenType
OPEN_CURLY_BRACKET → const TokenType
OPEN_PAREN → const TokenType
OPEN_SQUARE_BRACKET → const TokenType
PERCENT → const TokenType
PERCENT_EQ → const TokenType
PERIOD → const TokenType
PERIOD_PERIOD → const TokenType
PERIOD_PERIOD_PERIOD → const TokenType
PERIOD_PERIOD_PERIOD_QUESTION → const TokenType
PLUS → const TokenType
PLUS_EQ → const TokenType
PLUS_PLUS → const TokenType
QUESTION → const TokenType
QUESTION_PERIOD → const TokenType
QUESTION_PERIOD_PERIOD → const TokenType
QUESTION_QUESTION → const TokenType
QUESTION_QUESTION_EQ → const TokenType
RECOVERY → const TokenType
Token type used by synthetic tokens that are created during parser recovery (non-analyzer use case).
SCRIPT_TAG → const TokenType
SEMICOLON → const TokenType
SINGLE_LINE_COMMENT → const TokenType
SLASH → const TokenType
SLASH_EQ → const TokenType
STAR → const TokenType
STAR_EQ → const TokenType
STRING → const TokenType
STRING_INTERPOLATION_EXPRESSION → const TokenType
STRING_INTERPOLATION_IDENTIFIER → const TokenType
TILDE → const TokenType
TILDE_SLASH → const TokenType
TILDE_SLASH_EQ → const TokenType
UNUSED → const TokenType