1
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
In a bottom-up evaluation of a syntax directed definition, inherited attributes can
A
always be evaluated
B
be evaluated only if the definition is L- attributed
C
be evaluated only if the definition has synthesized attributes
D
never be evaluated
2
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?
A
Removing left recursion alone
B
Factoring the grammar alone
C
Removing left recursion and factoring the grammar
D
None of the above
3
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6

Consider the grammar shown below

$$\eqalign{ & S \to iEtSS'\,|\,\,a \cr & S' \to eS\,|\,\,\varepsilon \cr & E \to b \cr} $$

In the predictive parse table, $$M$$, of this grammar, the entries $$M\left[ {S',e} \right]$$ and $$M\left[ {S',\phi } \right]$$ respectively are

A
$$\{ \,S' \to eS\,\} $$ and $$\{ \,S' \to \varepsilon \,\} $$
B
$$\{ \,S' \to eS\,\} $$ and $$\{ \,\,\,\} $$
C
$$\{ \,S' \to \varepsilon \,\} $$ and $$\{ \,S' \to \varepsilon \,\} $$
D
$$\{ \,S' \to eS\,,S' \to \varepsilon \} $$ and $$\{ \,S' \to \varepsilon \,\} $$
4
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6

Consider the translation scheme shown below

$$\eqalign{ & S \to TR \cr & R \to + T\left\{ {pr{\mathop{\rm int}} (' + ');} \right\}\,R\,|\,\varepsilon \cr & T \to num\,\left\{ {pr{\mathop{\rm int}} (num.val);} \right\} \cr} $$

Here num is a token that represents an integer and num.val represents the corresponding integer value. For an input string '9 + 5 + 2', this translation scheme will print

A
9 + 5 + 2
B
9 5 + 2 +
C
9 5 2 + +
D
+ + 9 5 2
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12