GATE CS Compiler Design questions
Practise Compiler Design questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
Which one of the following grammars is free from left recursion?
The least number of temporary variables required to create a three-address code in static single assignment form for the expression is__________________.
A variable is said to be live at a statement in a program if the following three conditions hold simultaneously: There exists a statement that uses There is a path from to in the flow graph corresponding to the program The path has no intervening assignment to including at and The …
Which one of the following is TRUE at any valid state in shift-reduce parsing?
For computer based on three-address instruction formats, each address field can be used to specify which of the following: (S1) A memory operand (S2) A processor register (S3) An implied accumulator register
Consider the intermediate code given below. (1) i=1 (2) j=1 (3) t1 = 5 * i (4) t2 = t1 + j (5) t3 = 4 * t2 (6) t4 = t3 (7) a[t4] = -1 (8) j = j + 1 (9) if j <= 5 goto (3) (10) i = i +1 (11) if i < 5 goto (2) The number of nodes and edges in control-flow-graph constructed for the above code, respectively, are
Match the following: …
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?
Consider the following grammar G Where , , and are non-terminal symbols, , and are terminal symbols. Which of the following statement(s) is/are correct? S1: LL(1) can parse all strings that are generated using grammar G S2: LR(1) can parse all …
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful, in that order?
A canonical set of items is given below On input symbol the set has
Which one of the following is FALSE?
Consider the expression tree shown. Each leaf represents a numerical value, which can either be or . Over all possible choices of the values at the leaves, the maximum possible value of the expression represented by the tree is ___.
For a C program accessing , the following intermediate code is generated by a compiler. Assume that the size of an integer is bits and the size of a character is bits. t0 = i ∗ 1024 t1 = j ∗ 32 t2 = k ∗ 4 t3 = t1 + t0 t4 = t3 + t2 t5 = X[t4] Which one of the following statements about the source code for the C program is …
Which one of the following is NOT performed during compilation?
Consider the grammar defined by the following production rules, with two operators and Which one of the following is TRUE?
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
One of the purposes of using intermediate code in compilers is to
Which of the following statements are CORRECT? Static allocation of all data areas by a compiler makes it impossible to implement recursion. Automatic garbage collection is essential to implement recursion. Dynamic allocation of activation records is essential to implement recursion. Both heap and stack are essential to implement recursion.
The minimum number of arithmetic operations required to evaluate the polynomial for a given value of , using only one temporary variable is ______.
