Compilers Questions and Answers – Implementation of the Translation Specified by Syntax-Directed Definitions – 2

This set of Compilers Question Bank focuses on “Implementation of the Translation Specified by Syntax – Directed Definitions and Translations – 2”.

1. A non relocatable program is the one which?
a) Cannot execute in any area of storage other than the one designated
b) Consists of a program and information for its relocation
c) None of the mentioned
d) All of the mentioned
View Answer

Answer: a
Explanation: A non reloadable program is one which cannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation.

2. A relocatable program form is one which?
a) Cannot execute in any area of storage other than the one designated
b) Consists of a program and information for its relocation
c) None of the mentioned
d) All of the mentioned
View Answer

Answer: c
Explanation: A relocatable program form is one which consists of a program and relevant information for its relocation. Using this information it is possible to relocate the program to execute from a storage area then the one designated for it at the time of its coding or translation.

3. A self-relocating program is one which?
a) Cannot execute in any area of storage other than the one designated
b) Consists of a program and information for its relocation
c) None of the mentioned
d) All of the mentioned
View Answer

Answer: c
Explanation: A self-relocating program is a program which can perform the relocation itself
• A table of information about address sensitive instruction in the program.
• Relocating logic that can perform the relocation of the address sensitive instructions.
advertisement
advertisement

4. Scissoring enables ______________
a) A part of data to be displayed
b) Entire data to be displayed
c) Full data display on full screen
d) No data to be displayed
View Answer

Answer: a
Explanation: It displays a part of the data.

5. Which of the following can be accessed by the transfer vector approach of linking?
a) External data segments
b) External sub-routines
c) Data located in other procedure
d) All of the mentioned
View Answer

Answer: b
Explanation: External subroutines are routines that are created and maintained separately from the program that will be calling them.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Relocation bits used by relocating loader are specified by ____________
a) Relocating loader itself
b) Linker
c) Assembler
d) Macro processor
View Answer

Answer: b
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.

7. Generation of intermediate code based on a abstract machine model is useful in compilers because ____________
a) Implementation of lexical analysis and syntax analysis is made easier
b) Writing for intermediate code generation
c) Portability of the front end of the compiler
d) None of the mentioned
View Answer

Answer: a
Explanation: Intermediate code generator receives input from its predecessor phase, semantic analyzer, in the form of an annotated syntax tree.
advertisement

8. Which of the following module does not incorporate initialization of values changed by the module?
a) Non reusable module
b) Serially reusable module
c) Re-enterable module
d) All of the mentioned
View Answer

Answer: a
Explanation: Non reusable models can be used once for a purpose they can’t be modified and used again.

9. The best way to compare the different implementations of symbol table is to compare the time required to ____________
a) Add a new name
b) Make an enquiry
c) Add a new name and make an enquiry
d) All of the mentioned
View Answer

Answer: d
Explanation: These are the different implementations of the symbol table as mentioned above.
advertisement

Sanfoundry Global Education & Learning Series – Compilers.

To practice Compilers Question Bank, 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.