classSymbolItem
final class SymbolItem
implements RhsItem
Public API: explicitly declared with
@visibility public.A symbol on a right-hand side, with the [name] reference that may follow it.
$file = (new \BisonParser\Parser())->parse("%%\ns: expr[left] '+' expr[right] ;\n");
$item = $file->rules()[0]->alternatives[0]->items[0];
$item->symbol->value // => 'expr'
$item->namedReference // => 'left'Properties§
public Symbol $symbolpublic string|null $namedReferenceMethods§
public function __construct(public Symbol $symbol, public string|null $namedReference)Parameters
$symbol | Symbol | The symbol |
$namedReference | string|null | The `[name]` after it, or null when none is given |
Test cases 12§
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 11
TreeDumper::itemcallsAlternativeTest::testSymbolscallsBisonGrammarCompilerTestcallsBisonGrammarReaderTestcallsParserTest::testParsecallsPrinterTest::testAlternativecallsPrinterTest::testPrintcallsRhsPrinterTest::testPrintcallsGrammarParserTestcallsRuleParserTest::testCheckEmptycallsRuleParserTest::testItemcalls
Relations§
Instantiated in 1
Constant reads 1
Type checks 4
- instanceof BisonParser\Ast\Rule\Alternative::symbols() packages/bison-parser/src/Ast/Rule/Alternative.php:46
- instanceof BisonParser\Syntax\RuleParser::checkEmpty() packages/bison-parser/src/Syntax/RuleParser.php:108
- instanceof SqlParser\Compiler\BisonGrammarReader::alternative() packages/sql-parser/src/Compiler/BisonGrammarReader.php:143
- instanceof SqlParser\Compiler\BisonGrammarReader::continues() packages/sql-parser/src/Compiler/BisonGrammarReader.php:168