
102 Compilers – Principles and Practice
4.3.7 Parsing Decision Conflicts
Recall that the actions of a Shift/Reduce parser are one of shift, reduce, accept or error. A grammar is
said to be an LR(0) grammar if rules for shift and reduce are unambiguous. That is, if a state contains
a completed item [A → a i], then it can contain no other items. If, on the other hand, it also contains
a “shift” item, then it is not clear if we should do the reduce or the shift and we have a shift–reduce
conflict. Similarly, if a state also contains another completed item, say [B → b i], then it is not clear
which reduction to do and we have a reduce–reduce conflict ...