classTokenGenerator
final class TokenGenerator
Derives grammar terminals without choosing spellings or pruning unsupported lexemes.
Methods§
public function __construct(
private Grammar $grammar,
private Generator $faker,
Closure(string): bool $nonOutput,
)Fixes grammar and production choices; marker metadata affects emptiness, never handler availability.
Parameters
$grammar | Grammar | |
$faker | Generator | |
$nonOutput | Closure(string): bool |
Test cases 2
Calls 2
public function generate(
string $root,
GenerationPlan<bool> $plan,
Closure(int): ?int|null $choose = null,
): TerminalSequenceProduces the selected terminal occurrences and their grammar provenance.
Parameters
$root | string | |
$plan | GenerationPlan<bool> | |
$choose | Closure(int): ?int|null |
Returns
Throws
GenerationException When the grammar cannot complete the planLogicException When derivation failed to retain its traceTest cases 2
Called from 1
Calls 3
- new Derivation line 42
- method-call Derivation::of() line 43
- new
LogicExceptionline 44
Private surface 4§
Implementation details, listed for orientation only.
private TerminationAnalyzer $terminationprivate CompletionCosts $completionprivate Grammar $grammarprivate Generator $fakerTest cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 14
BytePlanCompilerTestcallsPlanBuilderTestcallsDerivationTraceTestcallsLexemeSequenceTestcallsCandidateResolverTestcallsSqlGeneratorTestcallsTerminalSequenceTestcallsGenerationContextTestcallsMySqlProviderTestcallsGenerationContextTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsSqliteProviderTestcalls