Definitions
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).Rules
A Grammar is said to be SLR(1) if and only if, for each and every state ''s'' in the SLR(1) automaton, none of the following conditions are violated: # For any reducible rule ''A → a • Xb'' in state ''s'' (where ''X'' is some terminal), there must not exist some irreducible rule, ''B → a •'' in the same state ''s'' such that the ''follow'' set of B contains the terminal ''X''. In more formal terms, the intersection of set containing the terminal ''X'' and the follow set of ''B'' must be empty. Violation of this rule is a Shift-Reduce Conflict. # For any two complete items ''A → a •'' and ''B → b •'' in ''s'', ''Follow(A)'' and ''Follow(B)'' are disjoint (their intersection is the empty set). Violation of this rule is a Reduce-Reduce Conflict.Parsing algorithm
A grammar is said to be SLR(1) if the followingSee also
*References
* "Compiler Construction: Principles and Practice" by Kenneth C. Louden. Formal languages