1
GATE CSE 2024 Set 2
Numerical
+2
-0.66

Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is $\{ a, b, c, d, \, \#, \, @ \}$

$S' \rightarrow S$
$S \rightarrow SS \;|\; Aa \;|\; bAc \;|\; Bc \;|\; bBa$
$A \rightarrow d\#\#$
$B \rightarrow @$

Let $I_0 = \text{CLOSURE}( \{ S' \rightarrow \bullet S \} )$. The number of items in the set $GOTO(I_0, \, S)$ is __________.

2
GATE CSE 2024 Set 1
+2
-0.66

Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by (1), (2), and (3).

$$S \rightarrow d a T \mid \underline{\ (1)}$$

$$T \rightarrow a S \mid b T \mid \ \underline{(2)}$$

$$R \rightarrow \underline{(3)} \mid \epsilon$$

The set of terminals is $\{a, b, c, d, f\}$. The FIRST and FOLLOW sets of the different non-terminals are as follows.

FIRST($S$) = $\{c, d, f\}$, FIRST($T$) = $\{a, b, \epsilon\}$, FIRST($R$) = $\{c, \epsilon\}$

FOLLOW($S$) = FOLLOW($T$) = $\{c, f, \#\}$, FOLLOW($R$) = $\{f\}$

Which one of the following options CORRECTLY fills in the incomplete productions?

A

(1) $S \rightarrow R f$ (2) $T \rightarrow \epsilon$ (3) $R \rightarrow c T R$

B

(1) $S \rightarrow f R$ (2) $T \rightarrow \epsilon$ (3) $R \rightarrow c T R$

C

(1) $S \rightarrow f R$ (2) $T \rightarrow c T$ (3) $R \rightarrow c R$

D

(1) $S \rightarrow R f$ (2) $T \rightarrow c T$ (3) $R \rightarrow c R$

3
GATE CSE 2021 Set 1
+2
-0.67

Consider the following statements.

S1 : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1).

S2 : For any context-free grammar, there is a parser that takes at most O(n3) time to parse a string of length n.

Which one of the following option is correct?

A
S1 is true and S2 is false
B
S1 is false and S2 is true
C
S1 is true and S2 is true
D
S1 is false and S2 is false
4
GATE CSE 2020
+2
-0.67
Consider the productions A $$\to$$ PQ and A $$\to$$ XY. Each of the five non-terminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.

Rule 1 : P.i = A.i + 2, Q.i = P.i + A.i, and A.s = P.s + Q.s
Rule 2 : X.i = A.i + Y.s and Y.i = X.s + A.i

Which one of the following is TRUE?
A
Only Rule 2 is L-attributed.
B
Neither Rule 1 nor Rule 2 is L-attributed.
C
Both Rule 1 and Rule 2 are L-attributed.
D
Only Rule 1 is L-attributed.
GATE CSE Subjects
EXAM MAP
Medical
NEET