classPredicate
final class Predicate
implements RhsItem
Public API: explicitly declared with
@visibility public.A semantic predicate %?{ ... } on a right-hand side.
$file = (new \BisonParser\Parser())->parse("%%\ns: %?{ new_syntax } 'a' ;\n");
$file->rules()[0]->alternatives[0]->items[0]->code // => ' new_syntax 'Properties§
public string $codepublic Location $locationMethods§
public function __construct(public string $code, public Location $location)Parameters
$code | string | The code without its braces |
$location | Location | Where the `%?` is written |
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
TreeDumper::itemcallsBisonGrammarCompilerTestcallsBisonGrammarReaderTestcallsRhsPrinterTest::testPrintcallsRuleParserTest::testCheckEmptycallsRuleParserTest::testItemcalls
Relations§
Instantiated in 1
Constant reads 1
Type checks 3
- instanceof BisonParser\Syntax\RuleParser::checkEmpty() packages/bison-parser/src/Syntax/RuleParser.php:108
- instanceof BisonParser\Syntax\RuleParser::checkEmpty() packages/bison-parser/src/Syntax/RuleParser.php:112
- instanceof SqlParser\Compiler\BisonGrammarReader::continues() packages/sql-parser/src/Compiler/BisonGrammarReader.php:168