Index

Token

MMO\client\scs · 1 symbol · generated 30 Sep 2026

class

Token

Token.php:7

A single lexical token. Lexer

readonly class MMO\client\scs\Token implements Stringable
Namespace
MMO\client\scs
Implements
Stringable

Properties8

col

readonly
readonly int $col
Type
int

line

readonly
readonly int $line
Type
int

number

readonly
readonly ?float $number
Type
null | float

quote

readonly
readonly string $quote
Type
string

text

readonly
readonly string $text
Type
string

type

readonly
readonly MMO\client\scs\TokenType $type
Type
TokenType

unit

readonly
readonly string $unit
Type
string

ws

readonly
readonly bool $ws
Type
bool

Methods5

is($type, $text)

Token.php:29
function is(MMO\client\scs\TokenType $type, ?string $text = null): bool
$typeTokenType
$text = nullnull | stringwhen given, the text must match too
returnsbool
$token->is(TokenType::Punct, '{');

location($filename)

Token.php:37
function location(string $filename): MMO\client\scs\SourceLocation
$filenamestring
returnsSourceLocationthis token's position, for error reporting

source()

Token.php:44
function source(): string
returnsstringthe token as it was written in the source

__construct($type, $text, $line, $col, $ws, $number, $unit, $quote)

Token.php:8
function __construct( MMO\client\scs\TokenType $type, string $text, int $line = 1, int $col = 1, bool $ws = false, ?float $number = null, string $unit = '', string $quote = '' )
$typeTokenType
$textstring
$line = 1int
$col = 1int
$ws = falsebool
$number = nullnull | float
$unit = ''string
$quote = ''string