retagged by
270 views
3 votes
3 votes

Consider following Translation Scheme:
$S \rightarrow ER$
$R \rightarrow ^* E \{ print \{' *' \}; \} R \mid \epsilon$
$E \rightarrow F + E \{ print ('+');\} \mid F$
$F \rightarrow S \mid id \{ print (id,value) ; \}$

Here, $id$ is a taken that represents an integer and id, $value$ represents the corresponding integer value. 

What does this Translation Scheme print for an input " $1* 7 + 9$ "?

  1. $1 7*  + 9$
  2. $1 * 7 9 +$
  3. $1 7 9 * +$
  4. $179 + *$
retagged by

1 Answer

Answer:

Related questions

3 votes
3 votes
1 answer
1
2 votes
2 votes
2 answers
3
Bikram asked Nov 25, 2016
694 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
3 votes
3 votes
1 answer
4
Bikram asked Nov 25, 2016
285 views
Which grammar causes recursive-descent parser to go into infinite loop?LL(1)Left recursive grammarRight recursive grammarGrammar with left factors