TokenReader class abstract

Abstract interface for handling a token list.

Implementers

Constructors

TokenReader()

Properties

column int
getter/setter pair
currrentFileName String?
The file current under processing, used in error message.
getter/setter pair
curTok Token
Get current token.
getter/setter pair
endOfFile Token
getter/setter pair
errors List<HTError>
getter/setter pair
firstTok Token
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
line int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

advance([int distance = 1]) Token
Advance till reach distance, return the token at original position.
expect(List<String> types, {bool consume = false}) bool
Check current token and some tokens after it to see if the types match, return a boolean result. If consume is true, will advance.
match(String type) Token
If the token match the type provided, advance 1 and return the original token. If not, generate an error.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek(int distance) Token
Get a token at a relative distance from current position.
seek(String type) Token
Search for a token type, return the token next to it.
seekGroupClosing(Map<String, String> groupClosings) Token
Search for parentheses end that can close the current one, return the token next to it.
setTokens({required Token token, int? line, int? column}) → void
Set current tokens.
toString() String
A string representation of this object.
inherited

Operators

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