classProductionRule
final class ProductionRule
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Represents a production rule in a formal grammar.
A production rule defines how a non-terminal symbol (left-hand side) can be expanded into a sequence of symbols (right-hand side alternatives).
Properties§
public string $lhspublic list<Production> $alternativesMethods§
public function __construct(public string $lhs, public list<Production> $alternatives)Parameters
$lhs | string | Left-hand side: non-terminal symbol name |
$alternatives | list<Production> | Right-hand side alternatives |
Test cases 207§
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 204
BisonGrammarCompilerTestcallsLemonGrammarCompilerTestcallsByteChoicesTestcallsBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRangecallsBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructionscallsBytePlanCompilerTest::testCompileSeparatesProductionChoicesFromLexemesAndCompletesAnOddInputcallsBytePlanEncoderTest::testEncodeMakesOpenLexicalChoicesTheWayTheCompilerReadsThePaddingcallsBytePlanEncoderTest::testEncodeStopsRecordingLexicalChoicesAtTheFirstNullAnswercallsBytePlanEncoderTest::testEncodeWritesBytesTheCompilerDecodesToTheRecordedChoicescallsBytePlanEncoderTest::testEncodeWritesTheHeaderRelativeToTheConstraintsMinimumAndDefaultMaximumcallsPlanBuilderTest::testBuildFreezesScopedValuesAndDefaultsWhenChoiceBytesRunOutcallsPlanBuilderTest::testBuildPreservesEmptyMarkerCandidatesWithoutLosingNonEmptyCompletioncallsPlanBuilderTest::testBuildPreservesRepeatedProductionAndLexemeConstraintscallsPlanBuilderTest::testBuildPropagatesMissingCandidateFailuresWithoutRetryingcallsPlanBuilderTest::testBuildReportsAnUnknownRequestedRulecallsPlanBuilderTest::testBuildReservesAllPendingSiblingsAndRetainsTheOriginalOrdinalcallsPlanBuilderTest::testBuildUsesTheSameContextualRewriteAndPinsItsCompleteCandidatecallsPlanBuilderTest::testMinimumExpansionsIncludesTheConstrainedDescendantBeforeDrawingTheBudgetcallsPlanBuilderTest::testMinimumExpansionsIncludesTheSelectedRootAlternativeBeforeAllocatingInputBudgetcallsPlanBuilderTest::testMinimumExpansionsKeepsTheNonEmptyRequirementSeparateFromNullabilitycallsPlanBuilderTest::testMinimumExpansionsRetainsNonEmptyCostsAndTheUnreachableSentinelForRootPatternscallsPlanBuilderTest::testRootResolvesOnlyAnExplicitReleaseAliascallsCoverageSnapshotStoreTestcallsGrammarCoverageInventoryTest::testDifferencesRecordsBothRemovedAndTransformedOriginalProductionscallsGrammarCoverageInventoryTest::testIdKeepsOriginalOrdinalAfterFilteringAndChangesForRewrittenRhscallsGrammarCoverageInventoryTest::testInventoryEntriesRetainOriginalIdentityAndExcludeUnreachableRulesFromTheDenominatorcallsGrammarCoverageInventoryTest::testProductionIdsDistinguishRulesOrdinalsAndGrammarProfilescallsGrammarCoverageInventoryTest::testReachableRulesCanInspectAPlanRootWithoutChangingTheInventorycallsGrammarCoverageInventoryTest::testReachableRulesIncludesRecursionAndEmptyAlternativesButSeparatesUnrelatedRulescallsGrammarCoverageInventoryTest::testRhsDistinguishesTheSymbolKindAndIncludesEmptyProductioncallsGrammarCoverageTest::testBeginAttemptRetainsAnEmptyAttemptBeforeAnyProductionIsSelectedcallsGrammarCoverageTest::testBeginGenerationReplacesThePreviousSuccessfulTracecallsGrammarCoverageTest::testCommitAttemptAndEndGenerationCommitOnlySuccessfulPathscallsGrammarCoverageTest::testDiscardAttemptPreservesFailedReachabilitycallsGrammarCoverageTest::testEndGenerationPreservesFailureBeforeAnyAttemptWasOpenedcallsGrammarCoverageTest::testEndGenerationSavesUnsavedDiscoveriesEveryHundredGenerationscallsGrammarCoverageTest::testFailedReachabilityAndLaterEmissionAreSavedAsSeparateDiscoveriescallsGrammarCoverageTest::testFlushRestoresOnlyCumulativeHistoryAndPreservesCurrentObservationscallsGrammarCoverageTest::testHooksWithoutAGenerationKeepTheTraceEmptycallsGrammarCoverageTest::testLastGenerationStartsEmptyWithoutStoragecallsGrammarCoverageTest::testMergeIsIdempotentAndDoesNotCopyHistoricalCounterscallsGrammarCoverageTest::testMergePreservesDisjointHistoryAndDoesNotResaveIdenticalHistorycallsGrammarCoverageTest::testMergeRejectsChangedImplementationRevisionscallsGrammarCoverageTest::testReadingAMemorySnapshotDoesNotSaveUnflushedObservationscallsGrammarCoverageTest::testRecordIncludesOccurrenceParentsAndOriginalPositionscallsGrammarCoverageTest::testRecordOutputExposesCandidateAndBoundaryDecisionscallsGrammarCoverageTest::testRecordSequenceKeepsTransformedSelectionsOutOfPreservedOutputCoveragecallsGrammarCoverageTest::testRegisterLeavesOldHistoryWhenTheImplementationChangescallsGrammarCoverageTest::testResetKeepsFlushedHistoryAndClearsTraceAndCurrentCounterscallsGrammarCoverageTest::testRestoreRejectsCorruptHistoryOnEveryRegistrationAttemptWithoutOverwritingItcallsGrammarCoverageTest::testSnapshotPublishesTheRegisteredInventoryAndCurrentRunIdentitycallsGrammarCoverageTest::testSnapshotSeparatesReachedFromEmittedAndKeepsTheFullDenominatorcallsSnapshotValidationTest::providerMalformedHistoriescallsSnapshotValidationTest::testCompatibleRejectsAnUntrustedInventoryDigestcallsSnapshotValidationTest::testCompatibleRejectsEmittedProductionsThatWereNeverReachedcallsSnapshotValidationTest::testCompatibleRejectsUnknownProductionIdscallsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponentcallsSnapshotValidationTest::testDecodeRestoresOnlyWellFormedSnapshotDatacallsCompletionWitnessTest::testChoicesCachesBothOutputPossibilitiesUnderEachDistinctPatterncallsCompletionWitnessTest::testCompleteBoundsTheOptionalProbeWithoutClaimingImpossibilitycallsCompletionWitnessTest::testCompleteWalksOccurrencePatternsAndPreservesPendingOutputcallsCompletionWitnessTest::testCompleteYieldsToTheSolverWhenAGreedyPathNeedsAnotherChoicecallsCompletionWitnessTest::testRememberCachesOnlyTheSuccessfulSuffixAndPreservesExactMinimumIndependencecallsPatternProductionsTest::testMatchingSeparatesPatternsAndRuleScopesWhenReusingItsCachecallsPatternProductionsTest::testMatchingUsesSourceSymbolNamesInSpecializedProductionscallsPatternProductionsTest::testSourceRuleAndMatchingUseOriginalNamesAndOrdinalscallsCompletionCostsTest::testAffordableRetainsExactlyTheAlternativesThatCanFinishWithinBudgetcallsCompletionCostsTest::testHasTerminalOutputDistinguishesEmittedTerminalsFromMarkersAndPendingRulescallsCompletionCostsTest::testRuleFindsFiniteCompletionsThroughNullableRecursioncallsCompletionCostsTest::testSequenceCountsMarkersAsEmptyAndReservesAllSiblingscallsCompletionFrontierTest::testOfferPrunesOverBudgetAndEquivalentMoreExpensiveStatescallsCompletionFrontierTest::testOfferRemembersAlreadyEmittedOutputBeforeErasingTerminalscallsCompletionFrontierTest::testTakeOrdersAffordableCompletionsByEstimatedCostcallsCompletionMemoTestcallsCompletionReductionTest::testReduceKeepsBothIndependentOutputPossibilitiesAndTheirExactCostscallsConstrainedCompletionTest::testCompleteCachesNormalizedPendingFormsWithoutLosingAlreadyEmittedOutputcallsConstrainedCompletionTest::testMinimumCountsOnlyTheUnconsumedPatternSuffixcallsConstrainedCompletionTest::testMinimumIncludesDescendantsSiblingsAndRecursiveOccurrenceConstraintscallsConstrainedCompletionTest::testSearchRetainsAFirstWitnessAsFeasibilityInsteadOfAMinimumProofcallsConstrainedCompletionTest::testWithinRejectsARequiredOutputThatIndependentEmptySubtreesCannotSupplycallsConstrainedCompletionTest::testWitnessCachesOnlyTheChosenSuffixAndKeepsMinimumQueriesIndependentcallsConstraintDependenciesTest::testAffectedFindsRecursiveAncestorsAndDropsConsumedConstraintscallsConstraintDependenciesTest::testAffectedPropagatesSourceConstraintsToEverySpecializationAndItsParentscallsDerivationNodeTestcallsDerivationTest::testAffordableAcceptsAnAlternativeThatExactlyUsesTheBudgetcallsDerivationTest::testAffordableAllowsATerminalOnlyProductionWithNoExpansionBudgetLeftcallsDerivationTest::testAffordableCompletionRetainsOnlyProductionsWithAnAffordableNonEmptyContinuationcallsDerivationTest::testAffordableKeepsAnAlternativeThatStillLeavesRoomToFinishcallsDerivationTest::testAffordableRejectsAnAlternativeThatCannotFitAfterTheRemaindercallsDerivationTest::testAffordableRejectsARemainderThatExceedsTheWholeBudgetcallsDerivationTest::testAffordableReturnsAListAfterDiscardingAnOverBudgetAlternativecallsDerivationTest::testAlternativesRespectsTheOccurrenceAndRejectsUnrealizableProductionscallsDerivationTest::testCompletableKeepsAnEmptyAlternativeWhenTheRemainingSiblingSatisfiesNonEmptycallsDerivationTest::testFirstNonTerminalAnswersNothingWhenOnlyTerminalsAreLeftcallsDerivationTest::testFirstNonTerminalAnswersTheLeftmostPositionTheWalkActsOncallsDerivationTest::testOfCountsOccurrencesAcrossSpecializedCopiesOfTheSameRulecallsDerivationTest::testOfOffersTheCandidatesToTheChoicePolicycallsDerivationTest::testOfReportsAPlanNoAlternativeCanSatisfycallsDerivationTest::testOfReportsASymbolTheGrammarDeclaresNoRuleForcallsDerivationTest::testOfRewritesTheStartSymbolUntilOnlyTerminalsAreLeftcallsDerivationTest::testOfSelectsTerminationPolicyFromThePlancallsDerivationTest::testOfStillRejectsAnEntirelyForcedPlanWhoseDescendantCannotSatisfyNonEmptycallsDerivationTest::testSelectProductionChoosesFreelyWhileThePlanStillAllowsDepthcallsDerivationTest::testSelectProductionDrawsUniformlyAmongTheEligibleAlternativesBeforeTheThresholdcallsDerivationTest::testSelectProductionTakesTheShortestAlternativeOncePastThePlanDepthcallsDerivationTraceTestcallsTerminationAnalyzerTest::testComputesAViewThatExcludesUnsupportedTerminalscallsTerminationAnalyzerTest::testEstimateProductionLengthMixedcallsTerminationAnalyzerTest::testEstimateProductionLengthNonTerminalscallsTerminationAnalyzerTest::testEstimateProductionStepsBreaksARecursiveLengthTiecallsTerminationAnalyzerTest::testGetMinLengthChoosesShortestAlternativecallsTerminationAnalyzerTest::testGetMinLengthEmptyProductioncallsTerminationAnalyzerTest::testGetMinLengthNestedRulescallsTerminationAnalyzerTest::testGetMinLengthTerminalOnlycallsTerminationAnalyzerTest::testIsProductionViableAcceptsAProductionSomeDerivationFinishescallsTerminationAnalyzerTest::testIsProductionViableRejectsAProductionThatCanNeverBeFinishedcallsTerminationAnalyzerTest::testPropagatesLexicalImpossibilityThroughNonTerminalscallsTerminationCostTest::testOfCountsARuleThatCanOnlyExpandIntoItselfAsUnfinishablecallsTerminationCostTest::testOfCountsTheTokensOfTheCheapestAlternativecallsTerminationCostTest::testOfProductionAddsUpWhatEachSymbolCostscallsTerminationCostTest::testOfProductionCountsExpansionsWhenThatIsWhatAStepIscallsTerminationCostTest::testOfRefusesATokenNothingCanWritecallsTerminationCostTest::testOfTreatsASymbolWithNoRuleAsATokencallsTerminationCostTest::testSettledAnswersTheLeastEveryRuleCanCostcallsTerminationCostTest::testSumRefusesASequenceCarryingATokenNothingCanWritecallsTokenGeneratorTest::testDeriveRetainsOriginalRuleIdentityForRepeatedChoicescallsTokenGeneratorTest::testGenerateCanChooseNullableChildrenWhenAnotherSiblingProvidesOutputcallsTokenGeneratorTest::testGenerateReservesVisibleOutputWithoutConsultingLexicalHandlerAvailabilitycallsTokenGeneratorTest::testMinimumExpansionsIncludesEveryPlannedListItemcallsTokenGeneratorTest::testMinimumExpansionsUsesTheCurrentRootPlanAndExplicitBudgetcallsTokenGeneratorTest::testPrepareKeepsPlansAndUnconstrainedCallsIndependentcallsLexemeSequenceTestcallsCandidateResolverTestcallsGrammarCompilerTest::testCompileAppliesProductionConditionsToEachListItemcallsGrammarCompilerTest::testCompileContradictoryProductionConditionsAreRejectedcallsGrammarCompilerTest::testCompileListItemsPreserveOutputOrderForBothRecursionDirectionscallsGrammarCompilerTest::testHasChildrenConditionsPruneIncompatibleProductionscallsGrammarCompilerTest::testRuleDoesNotShareACompiledSubtreeBetweenDifferentLexicalScopescallsGrammarCompilerTest::testRuleMemoizesRecursiveScopesBeforeWalkingTheirChildrencallsGrammarCompilerTest::testSymbolsApplyChildConditionsToARecursiveListTailcallsGrammarCompilerTest::testSymbolsKeepInfeasibleBranchesFromInvalidatingOtherAlternativescallsGrammarCompilerTest::testSymbolsPreserveInheritedRulesWhenSelectingAnOperandcallsGrammarCompilerTest::testValidateAcceptsNestedChildAndListDeclarationscallsPreparedGrammarTest::testRestoreKeepsOriginalOrdinalsAndAncestorIdentitycallsPreparedGrammarTest::testRestoreRetainsTheLexicalScopeOfEachSelectedProductioncallsSqlGeneratorTest::testGenerateAllowsEmptyOutputWhenThePlanAllowsItcallsSqlGeneratorTest::testGenerateClearsPreviousGrammarTraceBeforeALexicalPlancallsSqlGeneratorTest::testGenerateClosesCoverageAfterARejectedEmptyLexicalResultcallsSqlGeneratorTest::testGenerateKeepsRewrittenSourcesReachedWithoutCreditingTheirOutputcallsSqlGeneratorTest::testGeneratePreservesTheFirstLexicalFailureWithoutRetryingcallsSqlGeneratorTest::testGenerateRecordsACompleteCoverageObservationcallsSqlGeneratorTest::testGenerateRejectsUnexpectedEmptyOutputWithoutRetryingcallsSqlGeneratorTest::testGenerateReplacesGrammarCoverageWithTheLatestLexicalTracecallsSqlGeneratorTest::testGenerateReportsOnlyTheLatestRewrittenDerivationcallsSqlGeneratorTest::testGenerateReusesCompletionAnalysisAcrossDifferentPlanscallsSqlGeneratorTest::testGenerateUsesExplicitRulesAndSuppliedParserSemanticscallsSqlGeneratorTest::testGenerateUsesTheGrammarEntryPointWithoutDialectKnowledgecallsSqlGeneratorTest::testGenerateUsesTheSuppliedVersionSpecificRuleResolvercallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsSqlGeneratorTest::testRealizeOffersTheWholeZeroBasedCandidateRangecallsSqlGeneratorTest::testRealizeRetainsTheActualTerminalAndLexicalTracecallsTerminalSequenceTestcallsGrammarTest::testExposesTheStartSymbolAndRuleMapcallsGrammarTest::testIdentifiedAssignsOriginalOrdinalsBeforeFilteringcallsGrammarTest::testIdentifiedPreservesTheSourceAndEveryExistingProductionIdentitycallsGrammarTest::testSourceOrdinalUsesAdaptedIndicesUntilAGrammarIsSpecializedcallsGrammarTest::testSourceRuleSurvivesSerializationAndIdentificationcallsTerminalInventoryTest::testDeduplicatesAndSortsWithoutIncludingDefinedRulescallsTerminalInventoryTest::testFromGrammarNamesEveryTerminalTheRulesReachcallsTerminalInventoryTest::testIncludesDeclaredTerminalsAndUnknownLexerSymbolscallsGenerationContextTest::testBindsTheRequestedReleaseAndPreservesTheGrammarStartcallsGenerationContextTest::testLeavesThePlanInControlOfNullableProductionChoicescallsGenerationContextTest::testReportsAnUnknownNonterminalWithoutTreatingItAsSqlTextcallsGenerationContextTest::testReportsMissingLexicalImplementationWhenTheTerminalIsActuallyGeneratedcallsGenerationContextTest::testUsesTheGrammarStartWhenThePlanDoesNotSpecifyOnecallsGenerationPlansTest::testForeignKeyConstraintAdaptsToTheGrammarVersioncallsSqlGeneratorFactoryTest::testCreatePreservesTheGrammarEntryPointAndBindsLexicalDefinitionscallsSqlGeneratorFactoryTest::testCreateRealizesTheDocumentedSelectExamplecallsStartRuleResolverTest::testStartSymbolForFallsBackToTheEntryPointOfTheReleaseItWasAskedOfcallsStartRuleResolverTest::testStartSymbolForHandsBackARequestNothingMatchescallsMySqlGrammarTestcallsMySqlProviderTestcallsGenerationContextTest::testBindsTheRequestedReleaseAndPreservesTheGrammarStartcallsGenerationContextTest::testLeavesThePlanInControlOfNullableProductionChoicescallsGenerationContextTest::testReportsAnUnknownNonterminalWithoutTreatingItAsSqlTextcallsGenerationContextTest::testReportsMissingLexicalImplementationWhenTheTerminalIsActuallyGeneratedcallsGenerationContextTest::testUsesTheGrammarStartWhenThePlanDoesNotSpecifyOnecallsSqlGeneratorFactoryTest::testCreatePreservesTheGrammarEntryPointAndBindsLexicalDefinitionscallsPgGrammarTestcallsPostgreSqlProviderTestcallsGenerationContextTest::testBindsTheRequestedReleaseAndPreservesTheGrammarStartcallsGenerationContextTest::testLeavesThePlanInControlOfNullableProductionChoicescallsGenerationContextTest::testReportsAnUnknownNonterminalWithoutTreatingItAsSqlTextcallsGenerationContextTest::testReportsMissingLexicalImplementationWhenTheTerminalIsActuallyGeneratedcallsGenerationContextTest::testUsesTheGrammarStartWhenThePlanDoesNotSpecifyOnecallsGrammarAdaptationTest::testAdaptedGivesEachStatementKindARuleOfItsOwncallsGrammarAdaptationTest::testAdaptedLeavesAGrammarWithoutACmdRuleAlonecallsGrammarAdaptationTest::testStatementAlternativesKeepsAlterAndDropOnlyWhenTheyActOnATablecallsGrammarAdaptationTest::testStatementAlternativesSortsAnAlternativeByTheKeywordItLeadsWithcallsGrammarAdaptationTest::testStatementAlternativesSortsAnAlternativeThatBeginsWithAnOptionalWithClausecallsGrammarAdaptationTest::testWithStatementRulesPreservesEveryImportedAlternativecallsSqlGeneratorFactoryTest::testCreatePreservesTheGrammarEntryPointAndBindsLexicalDefinitionscallsSqliteGrammarTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 7
- new SqlFaker\Compiler\Bison\BisonGrammarCompiler::compile() packages/sql-faker/src/Compiler/Bison/BisonGrammarCompiler.php:76
- new SqlFaker\Compiler\Lemon\LemonGrammarCompiler::compile() packages/sql-faker/src/Compiler/Lemon/LemonGrammarCompiler.php:77
- new SqlFaker\Compiler\Lemon\LemonGrammarCompiler::compile() packages/sql-faker/src/Compiler/Lemon/LemonGrammarCompiler.php:81
- new SqlFaker\Generation\Plan\Compilation\GrammarCompiler::rule() packages/sql-faker/src/Generation/Plan/Compilation/GrammarCompiler.php:94
- new SqlFaker\Generation\Plan\Compilation\GrammarCompiler::rule() packages/sql-faker/src/Generation/Plan/Compilation/GrammarCompiler.php:114
- new SqlFaker\Grammar\Model\Grammar::identified() packages/sql-faker/src/Grammar/Model/Grammar.php:111
- new SqlFaker\Sqlite\Generation\GrammarAdaptation::withStatementRules() packages/sql-faker/src/Sqlite/Generation/GrammarAdaptation.php:46