Compilers Questions and Answers – LR Parser – 2

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “LR Parser – 2”.

1. What is terminal table?
a) Contains all constants in the program
b) Is a permanent table of decision rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
c) Consist of a full or partial list of the token is as they appear in the program created by lexical analysis and used for syntax analysis and interpretation
d) Is a permanent table which lists all keywords and special symbols of the language in symbolic form
View Answer

Answer: d
Explanation: A permanent database that has entry for each terminal symbols such as arithmetic operators, keywords, punctuation characters such as ‘;’, ‘,’etc Fields: Name of the symbol.

2. Advantage of incorporating the macro-processor into pass 1 is that _________
a) Many functions have to be implemented twice
b) Functions are combined not necessarily creating intermediate files as output from the macro-processor and input to the assembler
c) More flexibility is provided to the programmer in that he may use all the features of the assembler in conjunction with macros
d) All of the mentioned
View Answer

Answer: d
Explanation: A general-purpose macro processor or general purpose pre-processor is a macro designed primarily for string manipulation, macro definition.

3. Which of the following is a phase of a compilation process?
a) Lexical Analysis
b) Code Generation
c) Lexical Analysis & Code Generation
d) None of the mentioned
View Answer

Answer: c
Explanation: Lexical analysis and code generation is a phase of compilation process.
advertisement
advertisement

4. System program such as compiler are designed so that they are _________
a) Re-enterable
b) Non reusable
c) Serially usable
d) None of the mentioned
View Answer

Answer: a
Explanation: Re-enterable is the keyword for compiler being designed.

5. A series of statements explaining how the data is to be processed is called _________
a) Assembly
b) Machine
c) COBOL
d) Program
View Answer

Answer: d
Explanation: A program is a sequence of instructions, written to perform a task by computer. It requires programs to function, typically executing the program’s instructions in a central processor.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. A loader is a program that _________
a) Program that places functions into memory and prepares them for execution
b) Program that automates the translation of assembly language into machine language
c) Program accepting another program written in a high level language and produces as object program
d) None of the mentioned
View Answer

Answer: a
Explanation: A loader is the part of an operating system that is responsible for loading programs and libraries. It is important in the process of placing the programs into memory and executing them.

7. A system program that setup an executable program in main memory ready for execution is?
a) Assembler
b) Linker
c) Loader
d) Load and go
View Answer

Answer: c
Explanation: A loader is the part of an operating system that is responsible for loading programs and libraries. It is one of the essential stages in the process of starting a program, as it places programs into memory and prepares them for execution.
advertisement

8. Which of the following system program forgoes the production of object code to generate absolute machine code and load it into the physical main storage location from which it will be executed immediately upon completion of the assembly?
a) Two pass assembler
b) Load and go assembler
c) Macro processor
d) Linker
View Answer

Answer: b
Explanation: A load and go assembler generates absolute machine code and loads it to physical memory.

9. Uniform symbol table _________
a) Has all constants in the program
b) Permanent table of rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
c) Consists of full or partial list of the tokens as they appear in the program created by Lexical analysis and used for syntax analysis and interpretation
d) A permanent table which has all key words and special symbols of the language in symbolic form
View Answer

Answer: c
Explanation: Each pass scans the program, the first pass generates the symbol table and the second pass generates the machine code.
advertisement

10. Assembler is a program that _________
a) Puts programs into memory and executes them
b) Translates the assembly language into machine language
c) Writes in high level language and produces an object program
d) None of the mentioned
View Answer

Answer: b
Explanation: An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer’s processor can use to perform its basic operations.

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.