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

%type symbol { type }: the C type of a nonterminal's value.

Reading a typedoctest
$file = (new \LemonParser\Parser())->parse("%type expr {Expr*}\n");
    $type = $file->declarations()[0];
    [$type->symbol->name, $type->value] // => ['expr', 'Expr*']

Properties§

public Symbol $symbol
public string $value
public Location $location

Methods§

public function __construct(
    public Symbol $symbol,
    public string $value,
    public ArgumentForm $form,
    public Location $location,
)

Parameters

$symbolSymbolThe symbol being typed
$valuestringThe argument without its delimiters
$formArgumentFormHow the argument was written
$locationLocationWhere the `%` sign is
public function location(): Location

{@inheritDoc}

Returns

Test cases 1

Test cases 6§

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 5

Relations§

Instantiated in 1
Constant reads 1
Type declarations 1