1
GATE CSE 2025 Set 2
MCQ (Single Correct Answer)
+2
-0.67

Given a Context-Free Grammar G as follows :

$S \rightarrow A a|b a c| d c \mid b d a$

$A \rightarrow d$

Which ONE of the following statements is TRUE?

A
$G$ is neither $\operatorname{LALR}(1)$ nor $\operatorname{SLR}(1)$
B
$G$ is $\operatorname{CLR}(1)$, not $\operatorname{LALR}(1)$
C
$G$ is $\operatorname{LALR}(1)$, not $\operatorname{SLR}(1)$
D
$G$ is $\operatorname{LALR}(1)$, also $\operatorname{SLR}(1)$
2
GATE CSE 2025 Set 2
MCQ (More than One Correct Answer)
+2
-0

Consider two grammars $G_1$ and $G_2$ with the production rules given below:

$G_1: S \rightarrow$ if $E$ then $S \mid$ if $E$ then $S$ else $S \mid a$

$$\mathrm{E} \rightarrow \mathrm{~b}$$

$G_2: S \rightarrow$ if $E$ then $S \mid M$

$E \rightarrow$ if $E$ then $M$ else $S \mid c$

$$\mathrm{E} \rightarrow \mathrm{~b}$$

where if, then, else, $a, b, c$ are the terminals.

Which of the following option(s) is/are CORRECT?

A
$G_1$ is not $L L(1)$ and $G_2$ is $L L(1)$.
B
$G_1$ is $L L(1)$ and $G_2$ is not $L L(1)$.
C
$G_1$ and $G_2$ are not $L L(1)$.
D
$G_1$ and $G_1$ are ambiguous.
3
GATE CSE 2025 Set 1
MCQ (More than One Correct Answer)
+2
-0

Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?

A
For a production $A \rightarrow \varepsilon, \varepsilon$ will be added to First(A).
B
If there is any input right end marker, it will be added to First(S), where $S$ is the start symbol.
C
For a production $A \rightarrow \varepsilon, \varepsilon$ will be added to Follow(A).
D
If there is any input right end marker, it will be added to Follow(S), where $S$ is the start symbol.
4
GATE CSE 2024 Set 2
MCQ (Single Correct Answer)
+2
-0.66

Consider the following context-free grammar where the start symbol is S and the set of terminals is {a,b,c,d}.

$ S \rightarrow AaAb \mid BbBa $

$ A \rightarrow cS \mid \epsilon $

$ B \rightarrow dS \mid \epsilon $

The following is a partially-filled LL(1) parsing table.

abcd$
SS $\rightarrow$ AaAbS $\rightarrow$ BbBa(1)(2)
AA $\rightarrow \epsilon$(3)A $\rightarrow$ cS
B(4)B $\rightarrow \epsilon$B $\rightarrow$ dS

Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?

Note: In the options, “blank” denotes that the corresponding cell is empty.

A

(1) $ S \rightarrow AaAb $, (2) $ S \rightarrow BbBa $, (3) $ A \rightarrow \epsilon $, (4) $ B \rightarrow \epsilon $

B

(1) $ S \rightarrow BbBa $, (2) $ S \rightarrow AaAb $, (3) $ A \rightarrow \epsilon $, (4) $ B \rightarrow \epsilon $

C

(1) $ S \rightarrow AaAb $, (2) $ S \rightarrow BbBa $, (3) blank, (4) blank

D

(1) $ S \rightarrow BbBa $, (2) $ S \rightarrow AaAb $, (3) blank, (4) blank

GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP