GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Consider the grammar G with productions S → A B C; A → a | ε; B → b | ε; C → c | ε. Which of the following statements is/are true? I. G is LL(1). II. G is LR(0). III. G is SLR(1). IV. G is CLR(1) (canonical LR(1)).

  1. A. III and IV only
  2. B. I, II, III and IV
  3. C. I and IV only
  4. D. I, III and IV only

Correct answer: D. I, III and IV only

Computed from the automata: LL(1) yes, LR(0) no, SLR(1) yes, CLR(1) (canonical LR(1)) yes.

More Compiler Design questions

Exams that ask this topic