classPatternProductions
final class PatternProductions
Reuses immutable pattern/production matches across all frontiers and occurrences of the same constrained search.
Methods§
public function __construct(private Grammar $grammar)A fixed grammar makes pattern matches independent of search budget and occurrence counters.
Parameters
$grammar | Grammar |
public function sourceRule(string $name): stringKeeps legacy occurrence counters shared across specialized copies of a rule.
Parameters
$name | string |
Returns
stringCalled from 1
Calls 1
- method-call Grammar::sourceRule() line 34
public function matching(string $name, ?ProductionPattern $pattern): list<Production>Parameters
$name | string | |
$pattern | ?ProductionPattern |
Returns
list<Production>Test cases 3
Called from 2
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::choices() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:102
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:113
Calls 5
- function-call
serializeline 42 - function-call
array_mapline 46 - method-call Grammar::sourceRule() line 46
- method-call Symbol::value() line 46
- method-call Grammar::sourceOrdinal() line 46
Private surface 2§
Implementation details, listed for orientation only.
private array<string, list<Production>> $cache = []private Grammar $grammarTest cases 31§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 28
BytePlanCompilerTestcallsBytePlanEncoderTestcallsPlanBuilderTestcallsCompletionWitnessTest::testChoicesCachesBothOutputPossibilitiesUnderEachDistinctPatterncallsCompletionWitnessTest::testCompleteBoundsTheOptionalProbeWithoutClaimingImpossibilitycallsCompletionWitnessTest::testCompleteWalksOccurrencePatternsAndPreservesPendingOutputcallsCompletionWitnessTest::testCompleteYieldsToTheSolverWhenAGreedyPathNeedsAnotherChoicecallsCompletionWitnessTest::testRememberCachesOnlyTheSuccessfulSuffixAndPreservesExactMinimumIndependencecallsCompletionMemoTestcallsCompletionReductionTestcallsConstrainedCompletionTestcallsConstraintDependenciesTestcallsDerivationTestcallsDerivationTraceTestcallsTokenGeneratorTestcallsLexemeSequenceTestcallsCandidateResolverTestcallsSqlGeneratorTestcallsTerminalSequenceTestcallsGenerationContextTestcallsSqlGeneratorFactoryTestcallsMySqlProviderTestcallsGenerationContextTestcallsSqlGeneratorFactoryTestcallsPostgreSqlProviderTestcallsGenerationContextTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 1
Method calls 3
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::complete() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:57
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::choices() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:102
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:113