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:

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)

    The average educated man in America has about as much knowledge of what a political idea is as he has of the principles of counterpoint. Each is a thing used in politics or music which those fellows who practise politics or music manipulate somehow. Show him one and he will deny that it is politics at all. It must be corrupt or he will not recognize it. He has only seen dried figs. He has only thought dried thoughts. A live thought or a real idea is against the rules of his mind.
    John Jay Chapman (1862–1933)

    [O]ur rules can have authority over such natural rights only as we have submitted to them. The rights of conscience we never submitted, we could not submit. We are answerable for them to our God.
    Thomas Jefferson (1743–1826)