Token class

A token from the lexer.

Represents a single lexical unit with its type, value, and position.

Constructors

Token({required TokenType type, required String lexeme, Object? value, required int line, required int column})
const

Properties

column int
Column number (1-based).
final
hashCode int
The hash code for this object.
no setteroverride
lexeme String
The lexeme (original text) of this token.
final
line int
Line number (1-based).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type TokenType
The type of this token.
final
value Object?
The parsed value (for numbers and atoms).
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.
override