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 matching(string $name, ?ProductionPattern $pattern): list<Production>Parameters
$name | string | |
$pattern | ?ProductionPattern |
Returns
list<Production>Test cases 1
Called from 2
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::choices() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:101
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:112
Calls 3
- function-call
serializeline 34 - function-call
array_mapline 38 - method-call Symbol::value() line 38
Private surface 2§
Implementation details, listed for orientation only.
private array<string, list<Production>> $cache = []private Grammar $grammarTest cases 26§
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 25
BytePlanCompilerTestcallsPlanBuilderTestcallsCompletionWitnessTest::testChoicesCachesBothOutputPossibilitiesUnderEachDistinctPatterncallsCompletionWitnessTest::testCompleteBoundsTheOptionalProbeWithoutClaimingImpossibilitycallsCompletionWitnessTest::testCompleteWalksOccurrencePatternsAndPreservesPendingOutputcallsCompletionWitnessTest::testCompleteYieldsToTheSolverWhenAGreedyPathNeedsAnotherChoicecallsCompletionWitnessTest::testRememberCachesOnlyTheSuccessfulSuffixAndPreservesExactMinimumIndependencecallsCompletionMemoTestcallsCompletionReductionTestcallsConstrainedCompletionTestcallsConstraintDependenciesTestcallsDerivationTestcallsDerivationTraceTestcallsTokenGeneratorTestcallsLexemeSequenceTestcallsCandidateResolverTestcallsSqlGeneratorTestcallsTerminalSequenceTestcallsGenerationContextTestcallsMySqlProviderTestcallsGenerationContextTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 1
Method calls 2
- method-call SqlFaker\Generation\Derivation\Completion\CompletionWitness::choices() packages/sql-faker/src/Generation/Derivation/Completion/CompletionWitness.php:101
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:112