CD |Gate-2011| Previous Year Questions| Set-10

Set-15 GATE-2006 CD

CD |Gate-2011| Compiler Design

  1. The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense? [GATE – 2011]

a. Finite state automata
b. Deterministic pushdown automata
c. Non-Deterministic pushdown automata
d. Turing machine

Answer : a)

  1. In a compiler, keywords of a language are recognized during [GATE – 2011]

a. parsing of the program
b. the code generation
c. the lexical analysis of the program
d. dataflow analysis

Answer : c)

  1. Consider two binary operators ‘↑’ and ‘↓’ with the precedence of operator ↓ being lower than that of the operator ↑. Operator ↑ is right associative while operator ↓, is left associative. Which one of the following represents the parse tree for expression (7↓3↑4↑3↓2)?   [GATE – 2011]





Answer : b)
CD |Gate-2011|

  1. Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be accessed only through load and store instructions. The variables a, b, c, d and e initially stored in memory. The binary operators used in this expression tree can be evaluate by the machine only when the operands are in registers. The instructions produce results only in a register. If no intermediate results can be stored in memory, what is the minimum number of

registers needed to evaluate this expression?  [GATE – 2011]

a. 2
b. 3
c. 5
d. 9

Answer : b)


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *