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:

    “Now that the steam engine rules the world, a title is an absurdity, still I am all dressed up in this title. It will crush me if I do not support it. The title attracts attention to myself.”
    —Stendhal [Marie Henri Beyle] (1783–1842)

    “A scholar, in his Segmenta, left a note,
    As follows, “The Ruler of Reality,
    If more unreal than New Haven, is not
    A real ruler, but rules what is unreal.””
    —Wallace Stevens (1879–1955)

    “There is all the difference in the world between departure from recognised rules by one who has learned to obey them, and neglect of them through want of training or want of skill or want of understanding. Before you can be eccentric you must know where the circle is.”
    —Ellen Terry (1847–1928)