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
baaaaabaa
advertisement
advertisement

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.
advertisement

Sanfoundry Global Education & Learning Series – Compilers.

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

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.