Token class abstract
- Implementers
Constructors
- Token()
Properties
- beforeSynthetic ↔ Token?
-
The token before this synthetic token,
or
null
if this is not a synthetic)
,]
,}
, or>
token.getter/setter pair - charEnd → int
-
The character offset of the end of this token within the source text.
no setter
- charOffset → int
-
The character offset of the start of this token within the source text.
no setter
- end → int
-
Return the offset from the beginning of the file to the character after the
last character of the syntactic entity.
no setterinherited
- endGroup → Token?
-
The token that corresponds to this token, or
null
if this token is not the first of a pair of matching tokens (such as parentheses).no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isEof → bool
-
Return
true
if this token represents an end of file.no setter - isIdentifier → bool
-
True if this token is an identifier. Some keywords allowed as identifiers,
see implementation in
KeywordToken
.no setter - isKeyword → bool
-
True if this token is a keyword. Some keywords allowed as identifiers,
see implementation in
KeywordToken
.no setter - isKeywordOrIdentifier → bool
-
True if this token is a keyword or an identifier.
no setter
- isOperator → bool
-
Return
true
if this token represents an operator.no setter - isSynthetic → bool
-
Return
true
if this token is a synthetic token. A synthetic token is a token that was introduced by the parser in order to recover from an error in the code.no setter - kind → int
-
The kind enum of this token as determined by its type.
no setter
- length → int
-
Return the number of characters in the syntactic entity's source range.
no setterinherited
- lexeme → String
-
Return the lexeme that represents this token.
no setter
- next ↔ Token?
-
Return the next token in the token stream.
getter/setter pair
- offset ↔ int
-
Return the offset from the beginning of the file to the first character in
the syntactic entity.
getter/setter pairinherited-getter
- precedingComments → CommentToken?
-
Return the first comment in the list of comments that precede this token,
or
null
if there are no comments preceding this token. Additional comments can be reached by following the token stream using next untilnull
is returned.no setter - previous ↔ Token?
-
Return the previous token in the token stream.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → TokenType
-
Return the type of the token.
no setter
Methods
-
copy(
) → Token -
Return a newly created token that is a copy of this tokens
including any
preceedingComment
tokens, but that is not a part of any token stream. -
copyComments(
CommentToken? token) → CommentToken? - Copy a linked list of comment tokens identical to the given comment tokens.
-
matchesAny(
List< TokenType> types) → bool -
Return
true
if this token has any one of the giventypes
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setNext(
Token token) → Token -
Set the next token in the token stream to the given
token
. This has the side-effect of setting this token to be the previous token for the given token. Return the token that was passed in. -
setNextWithoutSettingPrevious(
Token? token) → Token? - Set the next token in the token stream to the given token without changing which token is the previous token for the given token. Return the token that was passed in.
-
toString(
) → String -
A string representation of this object.
inherited
-
value(
) → Object - Return the value of this token. For keyword tokens, this is the keyword associated with the token, for other tokens it is the lexeme associated with the token.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited