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
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
Explanation: 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
View Answer
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
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
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.
- Practice MCA MCQs
- Practice Computer Science MCQs
- Check Compiler Design Books
- Check Computer Science Books
- Apply for Computer Science Internship