Compilers Questions and Answers – LR Parser – 2

«
»

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

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

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

4. System program such a s 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
advertisement

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.

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.

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.

advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn