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:

    Unfortunately, we cannot rely solely on employers seeing that it is in their self-interest to change the workplace. Since the benefits of family-friendly policies are long-term, they may not be immediately visible or quantifiable; companies tend to look for success in the bottom line. On a deeper level, we are asking those in power to change the rules by which they themselves succeeded and with which they identify.
    Anne C. Weisberg (20th century)

    Although none of the rules for becoming more alive is valid, it is healthy to keep on formulating them.
    Susan Sontag (b. 1933)

    A man often thinks he rules himself, when all the while he is ruled and managed; and while his understanding directs one design, his affections imperceptibly draw him into another.
    François, Duc De La Rochefoucauld (1613–1680)