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

An %initial-action directive and its code.

Reading the initial actiondoctest
$file = (new \BisonParser\Parser())->parse("%initial-action { @\$.begin.filename = 0; }\n%%\ns: 'a';\n");
    $file->declarations[0]->code // => ' @$.begin.filename = 0; '

Properties§

public string $code
public Location $location

Methods§

public function __construct(public string $code, public Location $location)

Parameters

$codestringThe 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