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

Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let $X_1, X_2, X_3, X_4, X_5$, and $X_6$ be the placeholders for the nonterminals $\mathrm{D}, \mathrm{T}, \mathrm{L}$ or $\mathrm{L}_1$ in the following table :

Production rule Semantic action
D → T L X1.type = X2.type
T → int T.type = int
T → float T.type = float
L → L1, id X3.type = X4.type
addType(id.entry, X5.type)
L → id addType(id.entry, X6.type)

Which one of the following are the appropriate choices for $X_1, X_2, X_3$ and $X_4$ ?

A
$X_1=L, X_2=T, X_3=L_1, X_4=L$
B
$X_1=T, X_2=L, X_3=L_1, X_4=T$
C
$X_1=L, X_2=L, X_3=L_1, X_4=T$
D
$X_1=T, X_2=L, X_3=T, X_4=L_1$
2
GATE CSE 2016 Set 1
MCQ (Single Correct Answer)
+2
-0.6
Consider the following Syntax Directed Translation Scheme $$(SDTS),$$ with non-terminals $$\left\{ {S,A} \right\}$$ and terminals $$\left\{ {A,B} \right\}.$$
$$S \to aA$$ $$\,\,\,\,\,$${ print $$1$$ }
$$S \to a$$ $$\,\,\,\,$$$$\,\,\,\,\,$${ print $$2$$ }
$$A \to Sb$$ $$\,\,\,\,\,$${ print $$3$$ }

Using the above $$SDTS,$$ the output printed by a bottom-up parser, for the input $$aab$$ is:

A
$$1\,\,3\,\,2$$
B
$$2\,\,2\,\,3$$
C
$$2\,\,3\,\,1$$
D
syntax error
3
GATE CSE 2014 Set 3
MCQ (Single Correct Answer)
+2
-0.6

Consider the basic block given below.

a = b + c 
c = a + d 
d = b + c 
e = d - b 
a = e + b

The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are

A
6 and 6
B
8 and 10
C
9 and 12
D
4 and 4
4
GATE CSE 2010
MCQ (Single Correct Answer)
+2
-0.6

The program below uses six temporary variables a, b, c, d, e, f.

a = 1 
b = 10 
c = 20 
d = a + b 
e = c + d 
f = c + e 
b = c + e 
e = b + f 
d = 5 + e 
return d + f

Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling?

A
2
B
3
C
4
D
6
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12