final class TokenDeclaration
    implements Declaration
Public API: explicitly declared with @visibility public.

%token TOKEN TOKEN... .: terminals named early to fix their numbering.

Reading a token declarationdoctest
$file = (new \LemonParser\Parser())->parse("%token SEMI LP RP.\n");
    array_map(static fn ($symbol) => $symbol->name, $file->declarations()[0]->symbols) // => ['SEMI', 'LP', 'RP']

Properties§

public list<Symbol> $symbols
public Location $location

Methods§

public function __construct(public list<Symbol> $symbols, public Location $location)

Parameters

$symbolslist<Symbol>The terminals, in order
$locationLocationWhere the `%` sign is
public function location(): Location

Test cases 9§

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 8

Relations§

Instantiated in 1
Constant reads 1
Type checks 1