classBytePlanCompiler
final class BytePlanCompiler
Decodes bytes at the plan entry point and returns frozen production and lexical instructions.
Constants§
public const MAXIMUM_BUDGET = 5000Largest expansion budget decoded for constraints that carry none of their own.
Methods§
public function compile(
string $input,
PlanBuilder $builder,
GenerationPlan<bool>|null $constraints = null,
): GenerationPlan<bool>No input bytes cross this boundary into the grammar walk or lexical value domains.
Parameters
$input | string | |
$builder | PlanBuilder | |
$constraints | GenerationPlan<bool>|null |
Returns
GenerationPlan<bool>Throws
InvalidArgumentException When the constraints cannot be completed within the configured budgetTest cases 18
CreateTableTarget::__invokecallsRecoverTarget::__invokecallsBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRangecallsBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructionscallsBytePlanCompilerTest::testCompileSeparatesProductionChoicesFromLexemesAndCompletesAnOddInputcallsBytePlanEncoderTest::testEncodeMakesOpenLexicalChoicesTheWayTheCompilerReadsThePaddingcallsBytePlanEncoderTest::testEncodeStopsRecordingLexicalChoicesAtTheFirstNullAnswercallsBytePlanEncoderTest::testEncodeWritesBytesTheCompilerDecodesToTheRecordedChoicescallsBytePlanEncoderTest::testEncodeWritesTheHeaderRelativeToTheConstraintsMinimumAndDefaultMaximumcallsPlanBuilderTest::testMinimumExpansionsIncludesTheConstrainedDescendantBeforeDrawingTheBudgetcallsPlanBuilderTest::testMinimumExpansionsIncludesTheSelectedRootAlternativeBeforeAllocatingInputBudgetcallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsMySqlProviderTest::testGenerateSchemaBoundInsertAndFreezeChoicescallsMySqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsMySqlProviderTest::testPlannerFreezesConstructiveValuesFromFuzzBytescallsPostgreSqlProviderTest::testGenerateSchemaBoundInsertAndFreezeChoicescallsPostgreSqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsSqliteProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcalls
Calls 10
- static-call GenerationPlan::all() line 28
- method-call PlanBuilder::minimumExpansions() line 29
- class-const BytePlanCompiler::MAXIMUM_BUDGET() line 30
- new
InvalidArgumentExceptionline 32 - function-call
ordline 37 - function-call
str_splitline 41 - function-call
substrline 41 - method-call PlanBuilder::build() line 45
- method-call ByteChoices::index() line 48
- new ByteChoices line 48
Test cases 46§
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 43
CreateTableTarget::__invokecallsRecoverTarget::__invokecallsBytePlanEncoderTest::testEncodeMakesOpenLexicalChoicesTheWayTheCompilerReadsThePaddingcallsBytePlanEncoderTest::testEncodeStopsRecordingLexicalChoicesAtTheFirstNullAnswercallsBytePlanEncoderTest::testEncodeWritesBytesTheCompilerDecodesToTheRecordedChoicescallsBytePlanEncoderTest::testEncodeWritesTheHeaderRelativeToTheConstraintsMinimumAndDefaultMaximumcallsPlanBuilderTest::testMinimumExpansionsIncludesTheConstrainedDescendantBeforeDrawingTheBudgetcallsPlanBuilderTest::testMinimumExpansionsIncludesTheSelectedRootAlternativeBeforeAllocatingInputBudgetcallsCompletionFrontierTestcallsCompletionMemoTestcallsCompletionReductionTestcallsConstrainedCompletionTestcallsConstraintDependenciesTestcallsDerivationTestcallsDerivationTraceTestcallsTokenGeneratorTestcallsLexicalExceptionTestcallsLexemeSequenceTestcallsCandidateResolverTestcallsReverseLexemeGeneratorTestcallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsTerminalSequenceTestcallsGenerationContextTestcallsGenerationPlansTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqlGeneratorFactoryTestcallsMySqlProviderTest::testGenerateSchemaBoundInsertAndFreezeChoicescallsMySqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsMySqlProviderTest::testPlannerFreezesConstructiveValuesFromFuzzBytescallsGenerationContextTestcallsGenerationPlansTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqlGeneratorFactoryTestcallsPostgreSqlProviderTest::testGenerateSchemaBoundInsertAndFreezeChoicescallsPostgreSqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsGenerationContextTestcallsGenerationPlansTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcalls