1
GATE CSE 2003
MCQ (Single Correct Answer)
+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
2
GATE CSE 2003
MCQ (Single Correct Answer)
+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)
3
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Which of the following statements is FALSE?
A
In statically typed languages, each variable in a program has a fixed type
B
In un-typed languages, values do not have any types
C
In dynamically typed languages, variables have no types
D
In all statically typed languages, each variable in a program is associated with values of only a single type during the execution of the program
4
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6

Consider the syntax directed definition shown below.

GATE CSE 2003 Compiler Design - Code Generation and Optimization Question 10 English

Here, gen is a function that generates the output code, and newtemp is a function that returns the name of a new temporary variable on every call. Assume that ti's are the temporary variable names generated by newtemp. For the statement 'X : = Y + Z', the 3-address code sequence generated by this definition is

A
$$X = Y + Z$$
B
$${t_1} = Y + Z;X = {t_1}$$
C
$${t_1} = Y;{t_2} = {t_1} + Z;X = {t_2}$$
D
$${t_1} = Y;{t_2} = Z;\,{t_3} = {t_1} + {t_2};X = {t_3}$$
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12