250+ TOP MCQs on Three-Address Statements and Answers

Compilers Multiple Choice Questions on “Three-Address Statements”.

1. Which languages necessarily need heap allocation in the runtime environment?
a) Those that support recursion
b) Those that use dynamic scoping
c) Allow dynamic data structure
d) Those that use global variables

Answer: c
Clarification: E.g.: Heap.

2. Given the language L-{ab, aa, baa}, which of the following strings are in LG?

1) abaabaaabaa
2) aaaabaaaa 
3) baaaaabaaaab 
4) baaaaabaa

a) 1,2 and 3
b) 2,3 and 4
c) 1,2 and 4
d) 1,3 and 4

Answer: c
Clarification: Generates strings like aaaabaaaa
baaaaabaa

3. The lexical analyzer takes _________ as input and produces a stream of _______ as output.
a) Source program, tokens
b) Token, source program
c) Either A and B
d) None of the mentioned

Answer: a
Clarification: Lexical analyser takes source program as input and token as output.

4. The action of parsing the source program into proper syntactic classes is called ________
a) Syntax analysis
b) Lexical analysis
c) Interpretation analysis
d) General syntax analysis

Answer: b
Clarification: Checks for correct syntax.

5. What is the task of the lexical analysis?
a) None of the mentioned
b) To build a literal and identifier table
c) To build a uniform symbol table
d) To build a uniform symbol table, literal and identifier table

Answer: d
Clarification: It is the task performed.

Leave a Reply

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