final class TerminalMappingRule
    implements RewriteRule

Maps a direct terminal child of one grammar production to a declared contextual domain.

Methods§

public function __construct(
    private string $scope,
    private string $from,
    private string $to,
    private string $source,
)

Binds a structural match and its source-defined replacement independently of dialect dispatch.

Parameters

$scopestring
$fromstring
$tostring
$sourcestring
Test cases 1
public function rewrite(TerminalSequence $sequence): TerminalSequence

Replaces only direct children; identical terminals inside nested expressions remain unchanged.

Parameters

Test cases 2
Calls 1

Private surface 4§

Implementation details, listed for orientation only.

private string $scope
private string $from
private string $to
private string $source

Test cases 14§

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

Dedicated tests 1
Other tests reaching this symbol 13

Relations§

Instantiated in 7