SLR Grammar - Rules

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:

1. 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.

2. 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.

Read more about this topic:  SLR Grammar

Famous quotes containing the word rules:

    There are different rules for reading, for thinking, and for talking. Writing blends all three of them.
    Mason Cooley (b. 1927)

    The duce of any other rule have I to govern myself by in this affair—and if I had one ... I would twist it and tear it to pieces, and throw it into the fire when I had done—Am I warm? I am, and the cause demands it—a pretty story! is a man to follow rules—or rules to follow him?
    Laurence Sterne (1713–1768)

    There are ... two minimum conditions necessary and sufficient for the existence of a legal system. On the one hand those rules of behavior which are valid according to the system’s ultimate criteria of validity must be generally obeyed, and on the other hand, its rules of recognition specifying the criteria of legal validity and its rules of change and adjudication must be effectively accepted as common public standards of official behavior by its officials.
    —H.L.A. (Herbert Lionel Adolphus)