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

A directive that takes no argument, such as %debug or %glr-parser.

The name is the canonical spelling with hyphens, %pure-parser for both %pure-parser and %pure_parser; the raw spelling is kept as written.

Reading a flagdoctest
$file = (new \BisonParser\Parser())->parse("%pure_parser\n%%\ns: 'a';\n");
    $file->declarations[0]->name // => 'pure-parser'
    $file->declarations[0]->raw // => '%pure_parser'

Properties§

public string $name
public string $raw
public Location $location

Methods§

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

Parameters

$namestringCanonical directive name without the percent sign
$rawstringThe directive as written, percent sign included
$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 2

Test cases 13§

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 12

Relations§

Instantiated in 1
Constant reads 1