classPreparedGrammar
final class PreparedGrammar
Restores source grammar identities before dialect rewrites and retains scoped lexical conditions.
Properties§
public Grammar $grammarMethods§
public function __construct(
public Grammar $grammar,
private array<string, array<int, array<string, LexemeConstraint>>> $lexemes,
)Parameters
$grammar | Grammar | |
$lexemes | array<string, array<int, array<string, LexemeConstraint>>> |
public function restore(TerminalSequence $sequence): ScopedGenerationThe dialect sees only original productions and names, including their unfiltered ordinals.
Parameters
$sequence | TerminalSequence |
Returns
Test cases 2
Calls 7
- new ProductionOccurrence line 34
- method-call Grammar::sourceRule() line 37
- method-call Grammar::sourceOrdinal() line 38
- function-call
array_mapline 41 - new TerminalOccurrence line 41
- new ScopedGeneration line 48
- new TerminalSequence line 48
Private surface 1§
Implementation details, listed for orientation only.
private array<string, array<int, array<string, LexemeConstraint>>> $lexemesTest cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 5
PlanBuilderTestcallsTokenGeneratorTestcallsGrammarCompilerTestcallsMySqlProviderTestcallsPostgreSqlProviderTestcalls