classBytePlanCompiler
final class BytePlanCompiler
Decodes bytes at the plan entry point and returns frozen production and lexical instructions.
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 28
BytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRangecallsBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#all header bytescoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#body does not change budgetcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#default maximumcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#default wraparoundcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#emptycoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#explicit maximumcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#explicit wraparoundcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#largest allowed budgetcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#second header bytecoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#short headercoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#single possible budgetcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#third header bytecoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#unsigned headercoversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructionscallsBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#0coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#1coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#2coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#3coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#4coversBytePlanCompilerTest::testCompileSeparatesProductionChoicesFromLexemesAndCompletesAnOddInputcovers and callsPlanBuilderTest::testMinimumExpansionsIncludesTheConstrainedDescendantBeforeDrawingTheBudgetcallsPlanBuilderTest::testMinimumExpansionsIncludesTheSelectedRootAlternativeBeforeAllocatingInputBudgetcallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsMySqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsMySqlProviderTest::testPlannerFreezesConstructiveValuesFromFuzzBytescallsPostgreSqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsSqliteProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcalls
Calls 9
- static-call GenerationPlan::all() line 23
- method-call PlanBuilder::minimumExpansions() line 24
- new
InvalidArgumentExceptionline 27 - function-call
ordline 32 - function-call
str_splitline 36 - function-call
substrline 36 - method-call PlanBuilder::build() line 40
- method-call ByteChoices::index() line 43
- new ByteChoices line 43
Test cases 54§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 21
BytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRangecallsBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#all header bytescoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#body does not change budgetcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#default maximumcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#default wraparoundcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#emptycoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#explicit maximumcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#explicit wraparoundcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#largest allowed budgetcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#second header bytecoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#short headercoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#single possible budgetcoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#third header bytecoversBytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRange#unsigned headercoversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructionscallsBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#0coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#1coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#2coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#3coversBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructions#4coversBytePlanCompilerTest::testCompileSeparatesProductionChoicesFromLexemesAndCompletesAnOddInputcovers and calls
Other tests reaching this symbol 33
PlanBuilderTest::testMinimumExpansionsIncludesTheConstrainedDescendantBeforeDrawingTheBudgetcallsPlanBuilderTest::testMinimumExpansionsIncludesTheSelectedRootAlternativeBeforeAllocatingInputBudgetcallsCompletionFrontierTestcallsCompletionMemoTestcallsCompletionReductionTestcallsConstrainedCompletionTestcallsConstraintDependenciesTestcallsDerivationTestcallsDerivationTraceTestcallsTokenGeneratorTestcallsLexicalExceptionTestcallsLexemeSequenceTestcallsCandidateResolverTestcallsReverseLexemeGeneratorTestcallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsTerminalSequenceTestcallsGenerationContextTestcallsGenerationPlansTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsMySqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsMySqlProviderTest::testPlannerFreezesConstructiveValuesFromFuzzBytescallsGenerationContextTestcallsGenerationPlansTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsPostgreSqlProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsGenerationPlansTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqliteProviderTest::testPlannerCompilesReusableInstructionsWithoutChangingTheDefaultStartcalls