retagged by
386 views
2 votes
2 votes

Consider the following grammar: 

$E' \rightarrow E$

$E \rightarrow E + Y \mid Y$

$Y \rightarrow Y ^* F \mid F$

$F \rightarrow id \mid (E)$

How many $LR(0)$ items are there in closure $(\{E' \rightarrow \cdot E\})$?

  1. $1$
  2. $6$
  3. $7$
  4. $5$
retagged by

1 Answer

Best answer
2 votes
2 votes
The following are the 7 LR(0) items.
E' --> .E
E --> .E + Y

E --> .Y
Y --> .Y * F

E --> .F
F --> .id

F --> .(E)
So, Option C.
selected by
Answer:

Related questions

2 votes
2 votes
0 answers
1
Bikram asked Nov 25, 2016
485 views
$\textbf{goto}$ function of LR class of grammar is represented as:Deterministic Finite Automata transitionsNon-deterministic Finite Automata transitionsPDA transitionsPar...
3 votes
3 votes
1 answer
2
Bikram asked Nov 25, 2016
475 views
Consider the following grammar:$E \rightarrow E + T \mid T$$T \rightarrow T ^* F \mid F$$F \rightarrow (E) \mid id$What are the productions for E, T and F after convertin...
2 votes
2 votes
1 answer
3
Bikram asked Nov 25, 2016
313 views
Which one of the following statements is TRUE?SLR parser has more states than LALR parser.LALR parser has more states than Canonical LR.Canonical LR has fewer states than...
3 votes
3 votes
1 answer
4
Bikram asked Nov 25, 2016
1,050 views
Which one of the following can be handled by predictive parsers?Left recursionLeft factorsAmbiguityNon-determinism