API reference
python:arx:arx.lexer.Token
class Token
Token(kind: TokenKind, value: Any, location: SourceLocation = SourceLocation(0, 0), source_text: str | None = None)
Source: packages/arx/src/arx/lexer/core.py:138
Declared as: python:arx:arx.lexer.core.Token
Token class store the kind and the value of the token.
Attributes
-
kind — Type: TokenKind
-
value — Type: Any
-
location — Type: SourceLocation
-
source_text — Type: str | None
Methods
-
__eq__ — Overload __eq__ operator.
-
__hash__ — Implement hash method for Token.
-
__init__ — Initialize Token.
-
__str__ — Display the token in a readable way.
-
get_display_value — Return the string representation of a token value.
-
get_name — Get the name of the specified token.