Semantic validity of canonical LR(k) items #
An item [A → alpha · beta, u] is valid for a prefix gamma when a
rightmost derivation reaches p A s, gamma = p alpha, and u is the
EOF-padded k-lookahead of s. This file establishes the easy (soundness)
half of the canonical viable-prefix theorem: item closure and goto preserve
that semantic invariant.
Context closure of rightmost derivations #
Item decomposition #
If the dot is followed by X, the production splits into the prefix before
the dot, X, and the suffix after X.
Semantic validity #
Semantic validity of an LR item for an already scanned grammar-symbol prefix.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The finite set of all semantically valid items at a prefix.
Equations
- CF_grammar.LRk.validItems G k gamma = Finset.filter (CF_grammar.LRk.Valid G k gamma) Finset.univ
Instances For
Applying the production named by a valid item reaches its complete right-sentential form.
One item-closure edge preserves semantic validity at the same prefix.
The whole finite epsilon closure preserves semantic validity.
A goto edge advances semantic validity by the traversed grammar symbol.