classGrammar
final class Grammar
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Represents a formal grammar for SQL generation.
A formal grammar G = (N, Sigma, P, S) where:
- N: Set of non-terminal symbols (keys of ruleMap)
- Sigma: Set of terminal symbols (implicitly defined by Symbol types)
- P: Set of production rules (ruleMap)
- S: Start symbol (startSymbol)
Properties§
public string $startSymbolpublic array<string, ProductionRule> $ruleMappublic array<string, string> $aliases = []Methods§
public function __construct(
public string $startSymbol,
public array<string, ProductionRule> $ruleMap,
public array<string, string> $aliases = [],
)Parameters
$startSymbol | string | The grammar's start symbol |
$ruleMap | array<string, ProductionRule> | Non-terminal name => ProductionRule |
$aliases | array<string, string> | Specialized rule => original grammar rule |
Throws
InvalidArgumentException When a rule is filed under a name other than its own left-hand sideCalls 1
- new
InvalidArgumentExceptionline 37
public function __unserialize(array{startSymbol: string, ruleMap: array<string, ProductionRule>, aliases?: array<string, string>} $data): voidReads both historical grammar resources and newly specialized grammars.
Parameters
$data | array{startSymbol: string, ruleMap: array<string, ProductionRule>, aliases?: array<string, string>} |
public function sourceRule(string $rule): stringNames the source rule behind a specialized subtree.
Parameters
$rule | string |
Returns
stringCalled from 10
- method-call SqlFaker\Generation\Derivation\Completion\PatternProductions::sourceRule() packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:34
- method-call SqlFaker\Generation\Derivation\Completion\PatternProductions::matching() packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:46
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:109
- method-call SqlFaker\Generation\Derivation\ConstraintDependencies::__construct() packages/sql-faker/src/Generation/Derivation/ConstraintDependencies.php:31
- method-call SqlFaker\Generation\Derivation\ConstraintDependencies::__construct() packages/sql-faker/src/Generation/Derivation/ConstraintDependencies.php:32
- method-call SqlFaker\Generation\Derivation\Derivation::of() packages/sql-faker/src/Generation/Derivation/Derivation.php:85
- method-call SqlFaker\Generation\Derivation\Derivation::alternatives() packages/sql-faker/src/Generation/Derivation/Derivation.php:216
- method-call SqlFaker\Generation\Derivation\Derivation::alternatives() packages/sql-faker/src/Generation/Derivation/Derivation.php:221
- method-call SqlFaker\Generation\Plan\Compilation\PreparedGrammar::restore() packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:37
- method-call SqlFaker\Generation\Plan\Compilation\PreparedGrammar::restore() packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:45
public function sourceOrdinal(string $rule, int $ordinal): intRecovers the alternative index used before plan specialization.
Parameters
$rule | string | |
$ordinal | int |
Returns
intCalled from 3
- method-call SqlFaker\Generation\Derivation\Completion\PatternProductions::matching() packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:46
- method-call SqlFaker\Generation\Derivation\Derivation::alternatives() packages/sql-faker/src/Generation/Derivation/Derivation.php:223
- method-call SqlFaker\Generation\Plan\Compilation\PreparedGrammar::restore() packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:38
public static function loadFromFile(string $path): selfLoad a pre-compiled grammar from a file path.
Parameters
$path | string |
Returns
selfThrows
RuntimeException When the compiled grammar is missing, empty, or is not a grammarTest cases 4
Called from 3
- static-call SqlFaker\MySql\Grammar\MySqlGrammar::load() packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:29
- static-call SqlFaker\PostgreSql\Grammar\PgGrammar::load() packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:29
- static-call SqlFaker\Sqlite\Grammar\SqliteGrammar::load() packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:29
public function identified(): selfAssigns original ordinals before any dialect adapter filters alternatives.
Returns
selfTest cases 47
BytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructionscallsPlanBuilderTest::testBuildPropagatesMissingCandidateFailuresWithoutRetryingcallsPlanBuilderTest::testBuildReportsAnUnknownRequestedRulecallsPlanBuilderTest::testBuildReservesAllPendingSiblingsAndRetainsTheOriginalOrdinalcallsPlanBuilderTest::testRootResolvesOnlyAnExplicitReleaseAliascallsGrammarCoverageInventoryTest::testDifferencesRecordsBothRemovedAndTransformedOriginalProductionscallsGrammarCoverageInventoryTest::testIdKeepsOriginalOrdinalAfterFilteringAndChangesForRewrittenRhscallsGrammarCoverageInventoryTest::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::testDecodeRestoresOnlyWellFormedSnapshotDatacallsSqlGeneratorTest::testGenerateClosesCoverageAfterARejectedEmptyLexicalResultcallsSqlGeneratorTest::testGenerateKeepsRewrittenSourcesReachedWithoutCreditingTheirOutputcallsSqlGeneratorTest::testGenerateRecordsACompleteCoverageObservationcallsSqlGeneratorTest::testGenerateReplacesGrammarCoverageWithTheLatestLexicalTracecallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsSqlGeneratorTest::testRealizeRetainsTheActualTerminalAndLexicalTracecallsGrammarTest::testIdentifiedAssignsOriginalOrdinalsBeforeFilteringcallsGrammarTest::testIdentifiedPreservesTheSourceAndEveryExistingProductionIdentitycalls
Calls 3
- new Production line 105
- new ProductionRule line 111
- new
selfline 113
Test cases 213§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 9
GrammarTest::testExposesTheStartSymbolAndRuleMapcallsGrammarTest::testIdentifiedAssignsOriginalOrdinalsBeforeFilteringcallsGrammarTest::testIdentifiedPreservesTheSourceAndEveryExistingProductionIdentitycallsGrammarTest::testLoadFromFilecallsGrammarTest::testLoadFromFileFailedUnserializecallsGrammarTest::testLoadFromFileInvalidDatacallsGrammarTest::testLoadFromFileNotFoundcallsGrammarTest::testSourceOrdinalUsesAdaptedIndicesUntilAGrammarIsSpecializedcallsGrammarTest::testSourceRuleSurvivesSerializationAndIdentificationcalls
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::testCompletionAllowsAnEmptyProductionWhenItsSiblingEmitsOutputcallsCompletionCostsTest::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::testEstimateProductionLengthEmptycallsTerminationAnalyzerTest::testEstimateProductionLengthMixedcallsTerminationAnalyzerTest::testEstimateProductionLengthNonTerminalscallsTerminationAnalyzerTest::testEstimateProductionLengthTerminalscallsTerminationAnalyzerTest::testEstimateProductionStepsBreaksARecursiveLengthTiecallsTerminationAnalyzerTest::testEstimateProductionStepsRejectsUnsupportedTerminalcallsTerminationAnalyzerTest::testGetMinLengthChoosesShortestAlternativecallsTerminationAnalyzerTest::testGetMinLengthEmptyProductioncallsTerminationAnalyzerTest::testGetMinLengthNestedRulescallsTerminationAnalyzerTest::testGetMinLengthTerminalOnlycallsTerminationAnalyzerTest::testIsProductionViableAcceptsAProductionSomeDerivationFinishescallsTerminationAnalyzerTest::testIsProductionViableRejectsAProductionThatCanNeverBeFinishedcallsTerminationAnalyzerTest::testPropagatesLexicalImpossibilityThroughNonTerminalscallsTerminationAnalyzerTest::testTreatsUnknownSupportedNonTerminalAsOneTokencallsTerminationCostTest::testOfCountsARuleThatCanOnlyExpandIntoItselfAsUnfinishablecallsTerminationCostTest::testOfCountsTheTokensOfTheCheapestAlternativecallsTerminationCostTest::testOfProductionAddsUpWhatEachSymbolCostscallsTerminationCostTest::testOfProductionCountsExpansionsWhenThatIsWhatAStepIscallsTerminationCostTest::testOfRefusesATokenNothingCanWritecallsTerminationCostTest::testOfTreatsASymbolWithNoRuleAsATokencallsTerminationCostTest::testSettledAnswersTheLeastEveryRuleCanCostcallsTerminationCostTest::testSumRefusesASequenceCarryingATokenNothingCanWritecallsTokenGeneratorTest::testDeriveRetainsOriginalRuleIdentityForRepeatedChoicescallsTokenGeneratorTest::testGenerateCanChooseNullableChildrenWhenAnotherSiblingProvidesOutputcallsTokenGeneratorTest::testGenerateReservesVisibleOutputWithoutConsultingLexicalHandlerAvailabilitycallsTokenGeneratorTest::testMinimumExpansionsIncludesEveryPlannedListItemcallsTokenGeneratorTest::testMinimumExpansionsUsesTheCurrentRootPlanAndExplicitBudgetcallsTokenGeneratorTest::testPrepareKeepsPlansAndUnconstrainedCallsIndependentcallsLexemeSequenceTestcallsCandidateResolverTestcallsGrammarCompilerTest::testCompileAppliesProductionConditionsToEachListItemcallsGrammarCompilerTest::testCompileContradictoryProductionConditionsAreRejectedcallsGrammarCompilerTest::testCompileListItemsPreserveOutputOrderForBothRecursionDirectionscallsGrammarCompilerTest::testHasChildrenConditionsPruneIncompatibleProductionscallsGrammarCompilerTest::testHasChildrenRejectsARequiredRoleAbsentFromTheProductioncallsGrammarCompilerTest::testItemRejectsNullableAndBranchingRecursionForOrderedListscallsGrammarCompilerTest::testItemSupportsUnseparatedListsButRejectsRecursionBetweenFieldscallsGrammarCompilerTest::testRuleDoesNotShareACompiledSubtreeBetweenDifferentLexicalScopescallsGrammarCompilerTest::testRuleMemoizesRecursiveScopesBeforeWalkingTheirChildrencallsGrammarCompilerTest::testSymbolsApplyChildConditionsToARecursiveListTailcallsGrammarCompilerTest::testSymbolsKeepInfeasibleBranchesFromInvalidatingOtherAlternativescallsGrammarCompilerTest::testSymbolsPreserveInheritedRulesWhenSelectingAnOperandcallsGrammarCompilerTest::testValidateAcceptsNestedChildAndListDeclarationscallsPreparedGrammarTest::testRestoreKeepsOriginalOrdinalsAndAncestorIdentitycallsPreparedGrammarTest::testRestoreRetainsTheLexicalScopeOfEachSelectedProductioncallsSqlGeneratorTest::testGenerateAllowsEmptyOutputWhenThePlanAllowsItcallsSqlGeneratorTest::testGenerateClearsPreviousGrammarTraceBeforeALexicalPlancallsSqlGeneratorTest::testGenerateClosesCoverageAfterARejectedEmptyLexicalResultcallsSqlGeneratorTest::testGenerateKeepsRewrittenSourcesReachedWithoutCreditingTheirOutputcallsSqlGeneratorTest::testGenerateLexicalPlansBypassGrammarDerivationcallsSqlGeneratorTest::testGeneratePreservesTheFirstLexicalFailureWithoutRetryingcallsSqlGeneratorTest::testGenerateRecordsACompleteCoverageObservationcallsSqlGeneratorTest::testGenerateRejectsUnexpectedEmptyOutputWithoutRetryingcallsSqlGeneratorTest::testGenerateReplacesGrammarCoverageWithTheLatestLexicalTracecallsSqlGeneratorTest::testGenerateReportsOnlyTheLatestRewrittenDerivationcallsSqlGeneratorTest::testGenerateReusesCompletionAnalysisAcrossDifferentPlanscallsSqlGeneratorTest::testGenerateUsesExplicitRulesAndSuppliedParserSemanticscallsSqlGeneratorTest::testGenerateUsesTheGrammarEntryPointWithoutDialectKnowledgecallsSqlGeneratorTest::testGenerateUsesTheSuppliedVersionSpecificRuleResolvercallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsSqlGeneratorTest::testRealizeOffersTheWholeZeroBasedCandidateRangecallsSqlGeneratorTest::testRealizeRetainsTheActualTerminalAndLexicalTracecallsTerminalSequenceTestcallsTerminalInventoryTest::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::testAdaptedLeavesAGrammarWithoutACmdRuleAlonecallsSqlGeneratorFactoryTest::testCreatePreservesTheGrammarEntryPointAndBindsLexicalDefinitionscallsSqliteGrammarTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 4
- new SqlFaker\Compiler\Bison\BisonGrammarCompiler::compile() packages/sql-faker/src/Compiler/Bison/BisonGrammarCompiler.php:79
- new SqlFaker\Compiler\Lemon\LemonGrammarCompiler::compile() packages/sql-faker/src/Compiler/Lemon/LemonGrammarCompiler.php:85
- new SqlFaker\Generation\Plan\Compilation\GrammarCompiler::compile() packages/sql-faker/src/Generation/Plan/Compilation/GrammarCompiler.php:48
- new SqlFaker\Sqlite\Generation\GrammarAdaptation::adapted() packages/sql-faker/src/Sqlite/Generation/GrammarAdaptation.php:27
Static calls 3
- static-call SqlFaker\MySql\Grammar\MySqlGrammar::load() packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:29
- static-call SqlFaker\PostgreSql\Grammar\PgGrammar::load() packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:29
- static-call SqlFaker\Sqlite\Grammar\SqliteGrammar::load() packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:29
Method calls 13
- method-call SqlFaker\Generation\Derivation\Completion\PatternProductions::sourceRule() packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:34
- method-call SqlFaker\Generation\Derivation\Completion\PatternProductions::matching() packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:46
- method-call SqlFaker\Generation\Derivation\Completion\PatternProductions::matching() packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:46
- method-call SqlFaker\Generation\Derivation\ConstrainedCompletion::search() packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:109
- method-call SqlFaker\Generation\Derivation\ConstraintDependencies::__construct() packages/sql-faker/src/Generation/Derivation/ConstraintDependencies.php:31
- method-call SqlFaker\Generation\Derivation\ConstraintDependencies::__construct() packages/sql-faker/src/Generation/Derivation/ConstraintDependencies.php:32
- method-call SqlFaker\Generation\Derivation\Derivation::of() packages/sql-faker/src/Generation/Derivation/Derivation.php:85
- method-call SqlFaker\Generation\Derivation\Derivation::alternatives() packages/sql-faker/src/Generation/Derivation/Derivation.php:216
- method-call SqlFaker\Generation\Derivation\Derivation::alternatives() packages/sql-faker/src/Generation/Derivation/Derivation.php:221
- method-call SqlFaker\Generation\Derivation\Derivation::alternatives() packages/sql-faker/src/Generation/Derivation/Derivation.php:223
- method-call SqlFaker\Generation\Plan\Compilation\PreparedGrammar::restore() packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:37
- method-call SqlFaker\Generation\Plan\Compilation\PreparedGrammar::restore() packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:38
- method-call SqlFaker\Generation\Plan\Compilation\PreparedGrammar::restore() packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:45
Type declarations 36
- type SqlFaker\Compiler\Bison\BisonGrammarCompiler packages/sql-faker/src/Compiler/Bison/BisonGrammarCompiler.php:59
- type SqlFaker\Compiler\Lemon\LemonGrammarCompiler packages/sql-faker/src/Compiler/Lemon/LemonGrammarCompiler.php:58
- type SqlFaker\Generation\Choice\PlanBuilder packages/sql-faker/src/Generation/Choice/PlanBuilder.php:31
- type SqlFaker\Generation\Coverage\GrammarCoverageInventory packages/sql-faker/src/Generation/Coverage/GrammarCoverageInventory.php:45
- type SqlFaker\Generation\Coverage\GrammarCoverageInventory packages/sql-faker/src/Generation/Coverage/GrammarCoverageInventory.php:48
- type SqlFaker\Generation\Coverage\GrammarCoverageInventory packages/sql-faker/src/Generation/Coverage/GrammarCoverageInventory.php:115
- type SqlFaker\Generation\Derivation\Completion\PatternProductions packages/sql-faker/src/Generation/Derivation/Completion/PatternProductions.php:25
- type SqlFaker\Generation\Derivation\CompletionCosts packages/sql-faker/src/Generation/Derivation/CompletionCosts.php:35
- type SqlFaker\Generation\Derivation\ConstrainedCompletion packages/sql-faker/src/Generation/Derivation/ConstrainedCompletion.php:26
- type SqlFaker\Generation\Derivation\ConstraintDependencies packages/sql-faker/src/Generation/Derivation/ConstraintDependencies.php:28
- type SqlFaker\Generation\Derivation\Derivation packages/sql-faker/src/Generation/Derivation/Derivation.php:43
- type SqlFaker\Generation\Derivation\TerminationAnalyzer packages/sql-faker/src/Generation/Derivation/TerminationAnalyzer.php:32
- type SqlFaker\Generation\Derivation\TerminationCost packages/sql-faker/src/Generation/Derivation/TerminationCost.php:42
- type SqlFaker\Generation\Derivation\TerminationCost packages/sql-faker/src/Generation/Derivation/TerminationCost.php:85
- type SqlFaker\Generation\Derivation\TokenGenerator packages/sql-faker/src/Generation/Derivation/TokenGenerator.php:44
- type SqlFaker\Generation\Plan\Compilation\GrammarCompiler packages/sql-faker/src/Generation/Plan/Compilation/GrammarCompiler.php:35
- type SqlFaker\Generation\Plan\Compilation\PreparedGrammar packages/sql-faker/src/Generation/Plan/Compilation/PreparedGrammar.php:21
- type SqlFaker\Generation\SqlGenerator packages/sql-faker/src/Generation/SqlGenerator.php:50
- type SqlFaker\Generation\SqlGenerator packages/sql-faker/src/Generation/SqlGenerator.php:56
- type SqlFaker\Grammar\Model\TerminalInventory packages/sql-faker/src/Grammar/Model/TerminalInventory.php:17
- type SqlFaker\MySql\Generation\GenerationContext packages/sql-faker/src/MySql/Generation/GenerationContext.php:26
- type SqlFaker\MySql\Generation\GenerationContext packages/sql-faker/src/MySql/Generation/GenerationContext.php:51
- type SqlFaker\MySql\Generation\GenerationPlans packages/sql-faker/src/MySql/Generation/GenerationPlans.php:155
- type SqlFaker\MySql\Generation\SqlGeneratorFactory packages/sql-faker/src/MySql/Generation/SqlGeneratorFactory.php:22
- type SqlFaker\MySql\Generation\StartRuleResolver packages/sql-faker/src/MySql/Generation/StartRuleResolver.php:19
- type SqlFaker\MySql\Grammar\MySqlGrammar packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:25
- type SqlFaker\MySql\MySqlProvider packages/sql-faker/src/MySql/MySqlProvider.php:50
- type SqlFaker\PostgreSql\Generation\GenerationContext packages/sql-faker/src/PostgreSql/Generation/GenerationContext.php:26
- type SqlFaker\PostgreSql\Generation\GenerationContext packages/sql-faker/src/PostgreSql/Generation/GenerationContext.php:51
- type SqlFaker\PostgreSql\Generation\SqlGeneratorFactory packages/sql-faker/src/PostgreSql/Generation/SqlGeneratorFactory.php:22
- type SqlFaker\PostgreSql\Grammar\PgGrammar packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:25
- type SqlFaker\Sqlite\Generation\GenerationContext packages/sql-faker/src/Sqlite/Generation/GenerationContext.php:26
- type SqlFaker\Sqlite\Generation\GenerationContext packages/sql-faker/src/Sqlite/Generation/GenerationContext.php:51
- type SqlFaker\Sqlite\Generation\GrammarAdaptation packages/sql-faker/src/Sqlite/Generation/GrammarAdaptation.php:24
- type SqlFaker\Sqlite\Generation\SqlGeneratorFactory packages/sql-faker/src/Sqlite/Generation/SqlGeneratorFactory.php:22
- type SqlFaker\Sqlite\Grammar\SqliteGrammar packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:25