final class DerivationTrace

Tracks occurrence identity alongside the sentential form without selecting productions.

Methods§

public function __construct(string $root)

Starts one derivation at a grammar entry point.

Parameters

$rootstring
Test cases 2
Calls 1
public function expand(int $index, Production $production, int $ordinal): void

Replaces one non-terminal occurrence with its selected production's children.

Parameters

$indexint
$productionProduction
$ordinalint
Test cases 136
Calls 4
public function terminals(): TerminalSequence

Exposes the final leaves and every original production choice.

Test cases 136
Calls 1

Private surface 3§

Implementation details, listed for orientation only.

private list<TerminalOccurrence> $form
private list<ProductionOccurrence> $productions = []
private int $next = 1

Test cases 150§

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 148

Relations§

Instantiated in 1
Type declarations 1