This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Three-Address Statements – 2”.
1. In a two pass assembler, adding literals to literal table and address resolution of local symbols are done using?
a) First pass and second respectively
b) Both second pass
c) Second pass and first respectively
d) Both first pass
View Answer
Explanation: A two pass assembler does two passes over the source file (the second pass can be over a file generated in the first pass).
2. In Two pass assembler the object code generation is done during the ______________
a) Second pass
b) First pass
c) Zeroth pass
d) Not done by assembler
View Answer
Explanation: On the second pass, the assembler:
• source statements into machine code
• error messages, if error has occurred.
3. Pick the machine independent phase of the compiler.
a) Syntax analysis
b) Code generation
c) Lexical analysis
d) All of the mentioned
View Answer
Explanation: Machine independent phases are Lexical analysis, Syntax analysis, Semantic analysis, Intermediate code generation and sometime code optimization.
4. A system program that combines the separately compiled modules of a program into a form suitable for execution is?
a) Assembler
b) Linking loader
c) Cross compiler
d) Load and Go
View Answer
Explanation: Combines the modules which have been compiled separately.
5. Which of the following type of software should be used if you need to create, edit and print documents?
a) Word processing
b) Spreadsheet
c) Desktop publishing
d) UNIX
View Answer
Explanation: Application software such as word processors.
6. Output file of the Lex is _________ is the input file is Sam.
a) sam
b) sam.yy.c
c) sam.lex
d) sam.obj
View Answer
Explanation: This Produce the file “sam.yy.c”, which we can then compile with g++.
7. Type checking is normally done during ____________
a) Lexical analysis
b) Syntax analysis
c) Syntax directed translation
d) Code generation
View Answer
Explanation: It enables the compiler to do type checking.
8. Yacc is available as a command on the ____________
a) MINIX
b) UNIX
c) DOS
d) None of the mentioned
View Answer
Explanation: Unix provides with a YACC command.
9. Loading process can be divided into two programs. The first is binder the other is ____________
a) Linkage editor
b) Module Loader
c) Relocate
d) None of the mentioned
View Answer
Explanation: A module loader is an answer.
10. In Lex, a class is complemented by first placing ____________
a) ^
b) OR
c) –
d) NOT
View Answer
Explanation: ^ =complement.
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
- Check Compiler Design Books
- Check Computer Science Books
- Practice Computer Science MCQs