final class SymbolEntry
Public API: explicitly declared with @visibility public.

One symbol of a %token, %nterm, %type or precedence declaration, with what was declared about it.

Reading a numbered tokendoctest
$file = (new \BisonParser\Parser())->parse("%token <str> IDENT 258 \"identifier\" NUM\n%%\ns: NUM;\n");
    $entries = $file->declarations[0]->entries;
    [$entries[0]->tag, $entries[0]->number, $entries[0]->alias?->text] // => ['str', 258, 'identifier']
    [$entries[1]->tag, $entries[1]->number, $entries[1]->alias] // => ['str', null, null]

Properties§

public Symbol $symbol
public string|null $tag
public int|null $number
public Alias|null $alias

Methods§

public function __construct(
    public Symbol $symbol,
    public string|null $tag,
    public int|null $number,
    public Alias|null $alias,
)

Parameters

$symbolSymbolThe symbol
$tagstring|nullThe type tag in force, or null when none was given
$numberint|nullThe token number, or null when none was given
$aliasAlias|nullThe string alias, or null when none was given

Test cases 16§

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

Dedicated tests 1
Other tests reaching this symbol 15

Relations§

Instantiated in 1
Type declarations 1