Time Left - 20:00 mins

GATE CSE 2020 National Champion Quiz: Compiler Design

Attempt now to get your rank among 578 students!

Question 1

Which of the following describes a handle (as applicable to LR–parsing) appropriately?

Question 2

Consider the following CFG.
SaAb|eb
Ae|f
Find the number of states in LR(0) construction.

Question 3

Given the following expression grammar:
E E * F | F + E | F
F F - F | id
Which of the following is true?

Question 4

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

Question 5

Consider the expression tree shown. Each leaf represents a numerical value, which can either be 0 or 1. Over all possible choices of the values at the leaves, the maximum possible value of the expression represented by the tree is _____.

Question 6

Consider a case in which A and B are been considered as non zero +ve integers, then find out the outcome of following Pascal program

while A < > B do

if A < B then

A : = A – B

else

B : = B – A;

write(A);

Question 7

Choose the correct option to fill the empty blanks in below statement :

If variables are declared previously, then __________ is responsible for generation of symbol table but if variables are not declared then symbol table will be generated by __________.

Question 8

Which one of the following string is said to be a token without looking at next input character in C language :

Question 9

The least number of temporary variables required to create a three-address code in static single assignment form for the expression q + r / 3 + st * 5 + u * v /wis _____________.

Question 10

Which of the following statements are CORRECT?

1) Static allocation of all data areas by a compiler makes it impossible to implement recursion.

2) Automatic garbage collection is essential to implement recursion.

3) Dynamic allocation of activation records is essential to implement recursion.

4) Both heap and stack are essential to implement recursion.

Question 11

Consider the grammar shown below

 i E t S S’ | a

S’  e S | εε

 b

In the predictive parse table, M, of this grammar, the entries M[S’ , e] and M[S’ , $] respectively are

Question 12

Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals {S, A} and terminals {a, b}.

Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
  • 578 attempts
  • 0 upvotes
  • 2 comments
Jun 9GATE & PSU CS