edited by
11,544 views
29 votes
29 votes

Consider the following grammar

  • $S  \rightarrow S * E$
  • $S  \rightarrow E$
  • $E  \rightarrow F + E$
  • $E  \rightarrow F$
  • $F  \rightarrow id$

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

  1. $S  \rightarrow S *.E$
  2. $E   \rightarrow F. + E$
  3. $E   \rightarrow 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. i and ii
  2. ii and iii
  3. i and iii
  4. None of the above
edited by

6 Answers

Best answer
38 votes
38 votes

$\Rightarrow$ NOT possible for these three items to be in same state

Correct Answer: $D$

edited by
34 votes
34 votes

ans is D.

 

edited by
3 votes
3 votes

There will be 9 sets I0 to I8 

(I) will be in set I5

(II) will be in set I3

(III) will be in set I6

So (D)

Answer:

Related questions

33 votes
33 votes
4 answers
4