SLR grammar

When processed by an SLR parser, an SLR grammar is converted into parse tables with no shift/reduce or reduce/reduce conflicts for any combination of LR(0) parser state and expected lookahead symbol.

SLR parsers use a Follow(A) calculation to pick the lookahead symbols to expect for every completed nonterminal.

The overlap conflicts reported by SLR parsers are then spurious, a result of the approximate calculation using Follow(A).

A common way for computer language grammars to be ambiguous is if some nonterminal is both left- and right-recursive: A rule of the form B → y • within a state of a SLR(1) automaton is said to be irreducible or in a reduced state because it has been completely expanded and is incapable of undergoing any shift transition.

Rules in this state will have a dot ( • , the current look-ahead position) located at the rightmost end of its RHS (Right Hand Side).