GATEverse
← GATE CSE 2006

Q59

MCQ2 marks, −0.5

Consider the following translation scheme. S→ER S\rightarrow ER R→∗E{print(‘∗’);}R∣εR\rightarrow *E\left \{ \text{print}(\text{‘}*\text{’}); \right \} R\mid \varepsilon E→F+E{print(‘+’);}∣FE\rightarrow F+E\left \{ \text{print}(\text{‘}+\text{’}); \right \}\mid F F→(S)∣id{print(id.value);}F\rightarrow (S)\mid id \left \{ \text{print}(id.value); \right \} Here idid is a token that represents an integer and id.valueid.value represents the corresponding integer value. For an input ‘2∗3+4’,\text{‘}2 * 3 + 4\text{’}, this translation scheme prints

Sign in to save attempts.

Loading…