final class BisonToken
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

One lexeme read out of a Bison grammar file.

The offset is kept alongside the value because the parser reports failures against the grammar source, and a token that has been read is otherwise no longer locatable in the file it came from.

Properties§

public BisonLexeme $type
public string|int $value
public int $offset

Methods§

public function __construct(
    public BisonLexeme $type,
    public string|int $value,
    public int $offset,
)

Parameters

$typeBisonLexemeWhich lexeme was recognised
$valuestring|intThe text it spelled, or its numeric value for a number
$offsetintWhere the lexeme starts in the grammar source
Test cases 83
public function asString(): string

Reads the value as text.

Returns

string The value, with a number rendered as its digits
Test cases 77
Calls 1

Test cases 105§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 8
Other tests reaching this symbol 97

Relations§

Instantiated in 10
Type declarations 16