Time Left - 30:00 mins

GATE CS 2021 : Compiler Design Rapid Mini Mock (App update required to attempt this test)

Attempt now to get your rank among 680 students!

Question 1

Symbol table is an important data structure created and maintained by compilers in order to store information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc. Symbol table is used by both the analysis and the synthesis parts of a compiler. Now see the below given data structures :

I. Linear List

II. Hash Table

III. Heap Tree

IV. Binary Search Tree

Among the above data structures, which data structure(s) can be used to store the symbol table ?

Question 2

A directed acyclic graph represents one form intermediate representation. The number of non-terminals nodes in DAG of

a = (b+c)*(b+c)

Question 3

Consider the following code:


How many tokens are identified by lexical phase while scanning the above code?

Question 4

Among the following data structures , which data structure cannot be used to implement symbol table in compiler :

Question 5

Which of the following statement is correct-
S1- Lexical analysis phase is responsible for eliminating void space character.
S2- Semantic analyzer help in giving error message by giving row number and column number.

Question 6

Which of the following is incorrect for the actions of a LR-Parser

I) shift s ii) reduce A->ß iii) Accept iv) reject

Question 7

Which of the following is not the property of the basic block in control flow graph?

Question 8

Consider the following statements :

S1 : Every regular grammar is LL(1).

S2 : If a grammar is ambiguous then it cannot be parsed by any of the parser.

S3 : If a grammar is left factored , then after removal of left factoring , the grammar becomes LL(1).

S4 : If a grammar is left recursive , then after removal of left recursion , the grammar becomes LL(1).

Which option is correct ?

Question 9

Compile Time stacks are not used for

Question 10

Which of the following information is not available in the activation record of a procedure?

Question 11

What is the maximum value that is possible by the following expression tree at the root node such that id in leaf nodes can have only 2 values as 3 or 5?

Question 12

Consider the following syntax tree for the expression :
((a+b)-((b+a)*(a-b) ) )+((a-b)*(a+b) )

The letters A through I are used to name the nodes, and are not part of the expression tree. The operator labels of the interior nodes are the +, -, or * adjacent to the nodes. Assume that + and * are commutative operators, although - is not. Construct the expression DAG from this tree, treating + and * as commutative.
Which of the following statements is TRUE(T)/FALSE(F) about which nodes will be combined?
(i) B and C will be combined
(ii) D and H will be combined
(iii) E and C will not be combined
(iv) F and I will not be combined
(v) I and G will not be combined
  • 680 attempts

Posted by:

Priya UpadhyayPriya UpadhyayMember since Sep 2020
Priya Upadhyay
Share this quiz   |