retagged by
449 views
3 votes
3 votes

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 converting the above mentioned grammar to LL(1) grammar?

  1. $E \rightarrow +TE', \ \ T \rightarrow ^*FT ', \ \  F \rightarrow (E) \mid id$
  2. $E \rightarrow +TE' \mid \epsilon, \ \ T \rightarrow ^*FT ' \mid  \epsilon$
  3. $E \rightarrow  T, \ \  T \rightarrow F, \ \  F\rightarrow (E)  \mid  id$
  4. $E \rightarrow TE' , \ \  T \rightarrow FT' , \ \  F \rightarrow (E)  \mid id$
retagged by

1 Answer

Best answer
2 votes
2 votes

D is Correct.

selected by
Answer:

Related questions

3 votes
3 votes
1 answer
2
Bikram asked Nov 25, 2016
315 views
The grammar which has no epsilon transition or two adjacent nonterminals in the right side of any production is ___________.LL(1) grammarUnambiguous grammarOperator gramm...
3 votes
3 votes
2 answers
3
2 votes
2 votes
2 answers
4
Bikram asked Nov 25, 2016
667 views
Consider the following grammar:$S \rightarrow L = P \mid P$$L \rightarrow ^*P \mid id$$P \rightarrow L$The above grammar is:AmbiguousSLR(1)LALR(1)None of the above