Consider the following grammar. S -> S * E S -> E E -> F + E E -> F F -> id…

GATE · 2006 · CS

Consider the following grammar.

S -> S * E
S -> E
E -> F + E
E -> F
F -> id

Consider the following LR(0) items corresponding to the grammar above.

(i) S -> S * .E
(ii) E -> F. + E
(iii) E -> F + .E 

Given the items above, which two of them will appear in the same set in the canonical sets-of-items for the grammar?

  1. A.

    (i) and (ii)

  2. B.

    (ii) and (iii)

  3. C.

    (i) and (iii)

  4. D.

    None of the above

Attempted by 102 students.

Show answer

Correct answer: D

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…