Compiler Design
Lexical Analysis
Marks 1Marks 2
Syntax Directed Translation
Marks 1Marks 2
Code Generation and Optimization
Marks 1Marks 2
1
GATE CSE 2024 Set 2
Numerical
+2
-0

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 __________.

Your input ____
2
GATE CSE 2024 Set 1
MCQ (Single Correct Answer)
+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 2
Numerical
+2
-0

Consider the following augmented grammar with {#, @, <, >, a, b, c} as the set of terminals.

S' â†’ S

S â†’ S # cS

S â†’ SS

S â†’ S @

S â†’ < S >

S â†’ a

S â†’ b

S â†’ c

Let I0 = CLOSURE({S' â†’ âˆ™ S}). The number of items in the set GOTO(GOTO(I0, <), <) is _______

Your input ____
4
GATE CSE 2021 Set 1
MCQ (Single Correct Answer)
+2
-0.67

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

S â†’ d a T | R f

T â†’ a S | b a T | Ïµ

R â†’ c a T R | Ïµ

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

GATE CSE 2021 Set 1 Compiler Design - Parsing Question 14 English

Which one of the following choices represents the correct combination for the numbered cells in the parsing table ("blank" denotes that the corresponding cell is empty)?

A
(1) S â†’ R f (2) S â†’ R f (3) T â†’ Ïµ (4) T â†’ Ïµ
B
(1) blank (2) S â†’ R f (3) blank (4) blank
C
(1) S â†’ R f (2) blank (3) blank (4) T â†’ Ïµ
D
(1) blank (2) S â†’ R f (3) T â†’ Ïµ (4) T â†’ Ïµ
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Digital Logic
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages
Computer Organization