final class PlanBuilder

Compiles choices through the production generation pipeline into immutable instructions.

Methods§

public function build<T of bool>(
    GenerationPlan<T> $constraints,
    int $budget,
    Closure(int): ?int $productionChoice,
    Closure(int): ?int $lexicalChoice,
): GenerationPlan<T>

Freezes original production ordinals and every rewritten terminal's complete candidate.

Parameters

$constraintsGenerationPlan<T>
$budgetint
$productionChoiceClosure(int): ?int
$lexicalChoiceClosure(int): ?int

Returns

Test cases 8
Called from 1
Calls 11

Private surface 6§

Implementation details, listed for orientation only.

private CompletionCosts $costs
private TokenGenerator $tokens
private Grammar $grammar
private LexicalGrammar $lexical
private ?TokenRewriter $rewriter = null
private Closure(string|null): string|null $startSymbol = null

Test cases 15§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 11
Other tests reaching this symbol 4

Relations§

Instantiated in 1
Method calls 2
Type declarations 5