in Compiler Design edited by
2,927 views
5 votes
5 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 edited by
by
2.9k views

3 Answers

11 votes
11 votes
Best answer

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

edited by
5 votes
5 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

3 Comments

Wow, best answer
1
1
0
0
Great Bro!
1
1
3 votes
3 votes

Answer 5

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

edited by

3 Comments

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

0
0

@adad20 sorry, edited now.

0
0

S’ → S.

Edit sir @Sachin Mittal 1

0
0
Answer:

Related questions