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

A %param, %lex-param or %parse-param directive and its braced arguments.

Reading parser parametersdoctest
$file = (new \BisonParser\Parser())->parse("%parse-param {int *nastiness} {int *randomness}\n%%\ns: 'a';\n");
    $file->declarations[0]->kind->value // => 'parse-param'
    $file->declarations[0]->codes // => ['int *nastiness', 'int *randomness']

Properties§

public ParamKind $kind
public list<string> $codes
public Location $location

Methods§

public function __construct(
    public ParamKind $kind,
    public list<string> $codes,
    public Location $location,
)

Parameters

$kindParamKindWhich parser functions receive the arguments
$codeslist<string>Each argument's code without its braces
$locationLocationWhere the directive is written
public function location(): Location

Answers where the declaration begins.

Returns

Location Line and column of the percent sign
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