edited by
8,045 views
26 votes
26 votes

Consider the following grammar:

  • $S\rightarrow FR$
  • $ R\rightarrow * S\mid \varepsilon $
  • $ F\rightarrow  id $

In the predictive parser table $M$ of the grammar the entries $M[S,id]$ and $M[R,\$]$ respectively are

  1. $ \left \{ S\rightarrow FR \right \} $ and $ \left \{ R\rightarrow \varepsilon \right \} $
  2. $ \left \{ S\rightarrow FR \right \} $ and $ \left \{ \right \} $
  3. $ \left \{ S\rightarrow FR \right \} $ and $ \left \{ R\rightarrow {*}S\right \} $
  4. $ \left \{ F\rightarrow id \right \} $ and $ \left \{ R\rightarrow \varepsilon \right \} $
edited by

4 Answers

Best answer
33 votes
33 votes

First $S = \{ id \}$
Follow $R = \{ \$ \}$

so $M[S,id] = S  \rightarrow FR$
     $M[R,\$] = R  \rightarrow \epsilon$

So ans is A

edited by
7 votes
7 votes

Answer:

0 votes
0 votes
ans a)
Answer:

Related questions

33 votes
33 votes
4 answers
4