Rules useless in parser due to conflicts 5 B: a State 3 conflicts: 1 shift/reduce Grammar 0 $accept: S $end 1 S: e B b A 2 | e A 3 A: a 4 | %empty 5 B: a 6 | a D 7 D: b Terminals, with rules where they appear $end (0) 0 error (256) e (258) 1 2 b (259) 1 7 a (260) 3 5 6 Nonterminals, with rules where they appear $accept (6) on left: 0 S (7) on left: 1 2 on right: 0 A (8) on left: 3 4 on right: 1 2 B (9) on left: 5 6 on right: 1 D (10) on left: 7 on right: 6 State 0 0 $accept: • S $end 1 S: • e B b A 2 | • e A e shift, and go to state 1 S go to state 2 State 1 1 S: e • B b A 2 | e • A 3 A: • a 4 | • %empty [$end] 5 B: • a 6 | • a D a shift, and go to state 3 $default reduce using rule 4 (A) A go to state 4 B go to state 5 State 2 0 $accept: S • $end $end shift, and go to state 6 State 3 3 A: a • [$end] 5 B: a • [b] 6 | a • D 7 D: • b b shift, and go to state 7 b [reduce using rule 5 (B)] $default reduce using rule 3 (A) D go to state 8 shift/reduce conflict on token b: 5 B: a • 7 D: • b First example: a • b b A Shift derivation S ↳ B b A ↳ a D ↳ • b Second example: a • b Reduce derivation S ↳ B b A ↳ a • ↳ ε State 4 2 S: e A • $default reduce using rule 2 (S) State 5 1 S: e B • b A b shift, and go to state 9 State 6 0 $accept: S $end • $default accept State 7 7 D: b • $default reduce using rule 7 (D) State 8 6 B: a D • $default reduce using rule 6 (B) State 9 1 S: e B b • A 3 A: • a 4 | • %empty [$end] a shift, and go to state 10 $default reduce using rule 4 (A) A go to state 11 State 10 3 A: a • $default reduce using rule 3 (A) State 11 1 S: e B b A • $default reduce using rule 1 (S)