classOption
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.
$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 $namepublic string $rawpublic string|null $valuepublic Location $locationMethods§
public function __construct(
public string $name,
public string $raw,
public string|null $value,
public Location $location,
)Parameters
$name | string | Canonical directive name without the percent sign |
$raw | string | The directive as written, percent sign included |
$value | string|null | The decoded string, or null when it was omitted |
$location | Location | Where the directive is written |
public function location(): LocationAnswers where the declaration begins.
Returns
Location Line and column of the percent signTest cases 1
OptionTest::testLocationcalls
Test cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
OptionTest::testLocationcalls