Time Left - 12:00 mins

ISRO CS 2019 : Compiler Booster Quiz 3

Attempt now to get your rank among 1082 students!

Question 1

Consider the syntax directed definition shown below
S id : = E {gen(id.place = E.place;);}
E E1 + E2 {t = newtemp( );
gen(t = E1.place + E2.place;);
E.place = t;}
E id {E.place = id.place;}
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

Question 2

The grammar which is equivalent to -
A -> A+A/A-A/B
B -> B*B/B -B
After eliminating the left factoring is -

Question 3

Consider the following psuedocode:
x : integer := 1
y : integer := 2
f
procedure add
x := x + y
procedure second (P: procedure)
x : integer := 2
P()
procedure first
y : integer := 3
Second(add)
first()
write _integer (x)
What does it print if the language uses dynamic scoping with deep binding?

Question 4

Which of the following are true?
I. A programming language which does not permit global variables of any kind and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation.
II. Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming language being implemented has nesting of procedures/functions.
III. Recursion in programming languages cannot be implemented with dynamic storage allocation.
IV. Nesting of procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records.
V. Programming languages which permit a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records

Question 5

Which one of the following statements is FALSE?

Question 6

Which is true of the following

Question 7

A symbol table of length 152 is possessing 25 entries at any instant.
What is occupation density?

Question 8

The number of tokens the following C statement is
printf(“i = %d, &I = %x”, i,&i);

Question 9

CSG can be defined by

Question 10

Symbol table is accessed during ___ phase of a compiler.
  • 1082 attempts
  • 2 upvotes
  • 5 comments
Dec 29GATE & PSU CS

Posted by:

Richa TiwariRicha TiwariMember since Feb 2019
Want to create my own success story✌️
Share this quiz   |