classFlag
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.
$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 $namepublic string $rawpublic Location $locationMethods§
public function __construct(public string $name, public string $raw, public Location $location)Parameters
$name | string | Canonical directive name without the percent sign |
$raw | string | The directive as written, percent sign included |
$location | Location | Where the directive is written |
Test cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
FlagTest::testLocationcalls
Other tests reaching this symbol 12
TreeDumper::declarationLinecallsDeclarationTest::testLocationcallsGrammarFileTest::testAllDeclarationscallsGrammarFileTest::testRulescallsBisonGrammarCompilerTestcallsBisonGrammarReaderTestcallsDeclarationPrinterTest::testPrintcallsPrinterTest::testPrintcallsDeclarationParserTest::testDirectivecallsDeclarationParserTest::testParsecallsGrammarParserTest::testParsecallsGrammarParserTest::testParseKeepsLineDirectivesAmongTheRulescalls