Compilers Questions and Answers – Syntax-Directed Definitions and Translations – 2

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Syntax Directed Definition & Translations Questions and Answers – Sanfoundry “.

1. The segment base is specified using the register named is?
a) ORG instructions
b) TITLE instruction
c) ASSUME instruction
d) SEGMENT instruction
View Answer

Answer: a
Explanation: ORG segment base register is used to specify the register.

2. In what module multiple instances of execution will yield the same result even if one instance has not terminated before the next one has begun?
a) Non usable module
b) Serially usable
c) Re-enter-able
d) None of the mentioned
View Answer

Answer: c
Explanation: Re enter-able module is the reason why the compiler is used in the first place.

3. Dividing a project into segments and smaller units in order to simplify design and programming efforts is called?
a) Modular approach
b) Top down approach
c) Bottom up approach
d) Left right approach
View Answer

Answer: a
Explanation: Modular design, or “modularity in design”, is a design approach that subdivides a system into smaller parts called modules or skids that can be independently created and then used in different systems.
advertisement
advertisement

4. Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?
a) O(1)
b) O(long)
c) O(n)
d) O(long)
View Answer

Answer: c
Explanation: For skewed binary search tree on n nodes, the upper bound to insert a node is O (n).

5. Which of the following is true for machine language?
a) Continuous execution of program segments
b) Depicting flow of data in a system
c) A sequence of instructions which solves a problem
d) The language which interacts with the computer using only the binary digits 1 and 0
View Answer

Answer: d
Explanation: Machine code or machine language is a set of instructions executed directly by a computer’s central processing unit (CPU). Each instruction performs a very specific task.

6. Software that measures, monitors, and controls events are ___________
a) System S/w
b) Real Time software
c) Scientific software
d) Business Software
View Answer

Answer: b
Explanation: In computer science, real-time computing (RTC), or reactive computing describes hardware and software systems subject to a “real-time constraint”, for example operational deadlines from event to system response.

7. A linker is given object module for a set of programs that were compiled separately. What is not true about an object module?
a) Object code
b) Relocation bits
c) Names and locations of all external symbols denied in the object module
d) Absolute addresses of internal symbols
View Answer

Answer: d
Explanation: A linker or link editor is a computer program that takes one or more object files generated by a compiler and combines them into a single executable file, library file, or another object file.
advertisement

8. The table created by lexical analysis to describe all literals used in the source program is?
a) Terminal table
b) Literal table
c) Identifier table
d) Reductions
View Answer

Answer: b
Explanation: In computer science, and specifically in compiler and assembler design, literal pool is a lookup table used to hold literals during assembly and execution.

9. Which loader function is accomplished by loader?
a) Reallocation
b) Allocation
c) Linking
d) Loading
View Answer

Answer: d
Explanation: Function of a loader.
advertisement

10. What is Pass 2?
a) Assemble instruction and generate data
b) Perform processing of assembler
c) Write the object program
d) All of the mentioned
View Answer

Answer: d
Explanation: A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times. Each pass takes the result of the previous pass as the input and creates an intermediate output.

Sanfoundry Global Education & Learning Series – Compilers.

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

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.