Compilers Questions and Answers – Three-Address Statements – 1


This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: c
Explanation: Generates strings like aaaabaaaa

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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: d
Explanation: It is the task performed.

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.


Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter