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

A directive that takes a string, such as %name-prefix "yy" or %require "3.8".

%header and its deprecated spelling %defines may omit the string.

Reading an optiondoctest
$file = (new \BisonParser\Parser())->parse("%name-prefix=\"base_yy\"\n%%\ns: 'a';\n");
    $file->declarations[0]->name // => 'name-prefix'
    $file->declarations[0]->value // => 'base_yy'

Properties§

public string $name
public string $raw
public string|null $value
public Location $location

Methods§

public function __construct(
    public string $name,
    public string $raw,
    public string|null $value,
    public Location $location,
)

Parameters

$namestringCanonical directive name without the percent sign
$rawstringThe directive as written, percent sign included
$valuestring|nullThe decoded string, or null when it was omitted
$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 7§

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 6

Relations§

Instantiated in 1
Constant reads 1
Type declarations 1