NPTEL Online Certification Courses Indian
Institute of Technology Kharagpur
Compiler Design
Assignment ‐ Week 1
TYPE OF QUESTION:MCQ
Number ofquestions:12 Total mark: 12 X 1 = 12
Q1.
Which phase of compiler does NOT use symbol table?
a) Code generation
b) Syntax Analysis
c) Lexical Analysis
d) None of the other options
ANS : d) None of the other options
Q2.
Which phase of compiler is Syntax Analysis?
a) First
b) Second
c) Third
d) None of the mentioned
ANS: b) It is Second Phase Of Compiler after Lexical Analyzer.
Q3.
Output of the syntax analysis is called
a) Parse tree
b) Keyword tree
c) Binary tree
d) All of the other options
ANS: A) parse tree
Q4.
A programming language does not allow integer division operation. This is generally
detected in the phase of
a) Lexical Analysis
b) Syntax Analysis
c) Semantic Analysis
d) None of the other options
ANS: c) Semantic Analysis
Q5.
Which of these is not true about Symbol Table
a) All the labels of the instructions are symbols
b) Table has entry for symbol name address value
c) Perform the processing of the assembler directives
d) Created during pass 1
ANS: c) The Symbol table does not ever perform the processing of the assembler derivative.
Q6.
A compiler can check
a) Logical error
b) Syntax error
c) Both logical error and syntax error
d) Not logical and syntax error
Answer: b) syntax error
Explanation: No compiler can ever check logical errors.
Q7. Error recovery helps to
a) Report multiple errors
b) Rectify multiple errors
c) Both report and rectify multiple errors
d) None of the other options
ANS: a) Report multiple errors
Q8. Converting a hardware description into actual circuitry is known as
a) Silicon Compilation
b) HDL Compilation
c) Circuit Compilation
d) None of the other options
ANS: a) Silicon Compilation
Q9.
Loops are the major targets for optimization since
a) Loop may go to infinite execution
b) Loop body is repeated to several times
c) Condition check takes exceedingly large time
d) None of the other options
ANS : B) loop body is repeated several times
Q10.
For maximum speed of execution of target code , temporary variables be best allocated to
a) Swap space
b) Main memory
c) CPU registers
d) None of the other options
Answer: c) CPU registers
Q11.
Intermediate code helps in
a) Program Analysis
b) Code optimization
c) Retargeting code
d) Code check
ANS: c) Retargeting code
Q12.
Output file of Lex is _____ the input file is Myfile
a) Myfile.e
b) Myfile.yy.c
c) Myfile.lex
d) Myfile.obj
Answer: b
Explanation: This Produce the file “myfile.yy.c” which we can then compile with g++.
END of Assignment