This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Syntax-Directed Definitions and Translations – 1”.
1. In a single pass assembler, most of the forward references can be avoided by putting the restriction ___________
a) On the number of strings/life reacts
b) Code segment to be defined after data segment
c) On unconditional rump
d) None of the mentioned
View Answer
Explanation: A single pass assembler scans the program only once and creates the equivalent binary program.
2. The method which merges the bodies of two loops is?
a) Loop rolling
b) Loop jamming
c) Constant folding
d) None of the mentioned
View Answer
Explanation: In computer science, loop fusion (or loop jamming) is a compiler optimization and loop transformation which replaces multiple loops with a single one.
3. Assembly code data base is associated with ___________
a) Code is converted into assembly
b) Table of rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture’s machine code instructions.
4. The process manager has to keep track of ___________
a) Status of each program
b) Information to a programmer using the system
c) Status of each program & Information to a programmer using the system
d) None of the mentioned
View Answer
Explanation: Process manager keep track of the status and info about the program.
5. What is the function of the syntax phase?
a) recognize the language and to cal the appropriate action routines that will generate the intermediate form or matrix for these constructs
b) Build a literal table and an identifier table
c) Build a uniform symbol table
d) Parse the source program into the basic elements or tokens of the language
View Answer
Explanation: In this phase symbol table is created by the compiler which contains the list of lexemes or tokens.
6. If E be a shifting operation applied to a function f, such that E(f) = f (x +β ), then?
a) E (αf+β g) = α E(f) +β E (g)
b) E (αf +β g ) =. ( α+ β ) + E (f + g)
c) E (αf +β g ) = α E (f+gβ)
d) E (αf +β g ) = αβ E (f + g)
View Answer
Explanation: Shifting operation when performed gives this result.
7. Pass I ______________
a) Assign address to all statements
b) Save the values assigned to all labels for use in pass 2
c) Perform some processing
d) All of the mentioned
View Answer
Explanation: The pass 1 of a compiler the above mentioned functions are performed
8. Which table is a permanent database that has an entry for each terminal symbol?
a) Terminal Table
b) Literal Table
c) Identifier Table
d) None of the mentioned
View Answer
Explanation: A database that has entry for each terminal symbols such as arithmetic operators, keywords, punctuation characters such as ‘;’, ‘,’etc Fields: Name of the symbol.
9. Which of the following functions is performed by loader?
a) Allocate memory for the programs and resolve symbolic references between objects decks
b) Address dependent locations, such as address constants, to correspond to the allocated space
c) Physically place the machine instructions and data into memory
d) All of the mentioned
View Answer
Explanation: A loader is the part of an operating system that is responsible for loading programs and libraries.
10. The root directory of a disk should be placed ___________
a) At a fixed address in main memory
b) At a fixed location on the disk
c) Anywhere on the disk
d) None of the mentioned
View Answer
Explanation: Root directory is placed at a fixed disk location
Sanfoundry Global Education & Learning Series – Compilers.
To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Computer Science Internship
- Practice MCA MCQs
- Practice Computer Science MCQs
- Check Computer Science Books
- Check Compiler Design Books