in Compiler Design retagged ago by
1,784 views
2 votes
2 votes
Consider the augmented grammar with $\{ +, {\ast}, (,),\text{id} \}$ as the set of terminals.

$S’ \rightarrow S$

$S \rightarrow S + R\; |\; R$

$R \rightarrow R {\ast} P \;| \;P$

$P \rightarrow (S)\; |\; \text{id} $

If $I_{0}$ is the set of two $\textit{LR}(0)$ items $\{ [S’ \rightarrow S.], [S \rightarrow S. + R] \}$, then $\textit{goto(closure}(I_{0}), +)$ contains exactly ______________ items.
in Compiler Design retagged ago by
by
1.8k views

3 Answers

9 votes
9 votes
Best answer

So Goto$(closure(I_{0}),+)$ contains exactly $5$ items.

edited by
2 votes
2 votes

Answer 5

Closure of $I_0$ is same as $I_0$, we can find goto($I_0$) easily -

edited by

2 Comments

@Sachin Mittal 1 This answer is of different question sir.

0
0

@adad20 sorry, edited now.

0
0
2 votes
2 votes

Answer: 5 items.

 

 

The productions of $R$ and $P$ are added because of dot $(.)$ before $R$ and $P$ non-terminals. So $goto(closure(I0, +))$ contains exactly $5$ items.

 

 

edited by

2 Comments

Wow, best answer
1
1
0
0
Answer:

Related questions