1
GATE CSE 2003
+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
2
GATE CSE 2003
+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
+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
+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)
GATE CSE Papers
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987
EXAM MAP
Joint Entrance Examination
Medical
NEET