final class ReverseLexemeGenerator

Chooses complete compatible candidates while traversing terminals from right to left.

Methods§

public function generate(
    TerminalSequence $sequence,
    GenerationPlan<bool>|null $plan,
    Closure(int): int $choose,
    Closure(positive-int): ?int|null $valueChoice = null,
): ResolvedOutput

Parameters

$sequenceTerminalSequence
$planGenerationPlan<bool>|null
$chooseClosure(int): intChooses once after each applicable candidate set has been evaluated
$valueChoiceClosure(positive-int): ?int|nullExplicit plan-time value decisions

Throws

LexicalException When a candidate is missing, incompatible or unstable
Test cases 33
Called from 3
Calls 10
public function select(
    LexemeInput $input,
    Closure(int): int $choose,
    ?string $key = null,
    Closure(ResolvedOutput): bool|null $canComplete = null,
): ResolvedOutput

Parameters

$inputLexemeInput
$chooseClosure(int): int
$key?string
$canCompleteClosure(ResolvedOutput): bool|nullChecks outstanding left-boundary obligations

Throws

LexicalException When a candidate is missing, incompatible or unstable
Test cases 8
Called from 1
Calls 8

Private surface 4§

Implementation details, listed for orientation only.

private LexemeGenerator $lexemes
private CandidateResolver $resolver
private string $version
private string $dialect = 'SQL'

Test cases 58§

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

Dedicated tests 9
Other tests reaching this symbol 49

Relations§

Instantiated in 3
Method calls 3
Type declarations 6