final class Lr0Builder
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Builds the LR(0) automaton of a grammar from kernel items alone.

A state is identified by its kernel. Its closure is never materialised: the transitions out of it are computed from the kernel items and the precomputed closure index, which keeps grammars with thousands of rules tractable.

Methods§

public function build(Grammar $grammar): Lr0Automaton

Builds the automaton.

Parameters

$grammarGrammarGrammar to build for

Returns

Lr0Automaton The states in the order they were discovered, the start state first
Test cases 5
Called from 1
Calls 9

Test cases 7§

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 5

Relations§

Instantiated in 1
Method calls 1
Type declarations 1