1
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. The relationship between n1 and n2 is
A
n1 is necessarily less than n2
B
n1 is necessarily equal to n2
C
n1 is necessarily greater than n2
D
None of the above
2
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 \,\} $$
3
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
4
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6

Consider the grammar shown below.

$$\eqalign{ & S \to CC \cr & C \to cC\,|\,d \cr} $$

This grammar is

A
LL(1)
B
SLR(1) but not LL(1)
C
LALR(1) but not SLR(1)
D
LR(1) but not LALR(1)
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12