B.Tech 3 CSE & IT II Sem - Mid-II Test - 2019-20
Compiler Design

B.Tech 3 CSE & IT II Sem - Mid-II Test - 2019-20
Compiler Design
Please read the below instructions before taking the test:
- This test contains 20 multiple choice questions
- Each question carries one mark
- Maximum marks : 20
- Duration : 30 minutes
- This test can be attempted only once. If there are multiple attempts by creating different logins, all your tests stand cancelled, and no marks will be awarded.
Please read the below instructions before taking the test:
- This test contains 20 multiple choice questions
- Each question carries one mark
- Maximum marks : 20
- Duration : 30 minutes
- This test can be attempted only once. If there are multiple attempts by creating different logins, all your tests stand cancelled, and no marks will be awarded.
Which of the following parsers is the most powerful?
SLR
LALR
Canonical LR
Operator-precedence
The three-address code involves
Exactly 3 address
At the most 3 address
No unary operators
None
___________ optimizes the code by removing unnecessary lines so that the number of lines in the program get reduced
Semantic analyser
Intermediate code generator
Code optimizer
Lexical analyser
Any basic block contain _____ entry point and ____ exit point
1, 1
1, 2
1, 0
0, 0
In _________ technique always replaces the redundant expression each time it is encountered
Code movement
Dead code elimination
Compile time evaluation
Common sub-expression
A _________ is a directed graph in which the control information is added to the basic blocks
DAG
Flow Graph
Cyclic Graph
None
Which of the following is a loop optimization technique
Code motion
Loop unrolling
Loop fusion
All of the above
__________ is a node through which all paths will go through it to reach end node
Dominator
Starting Node
Final node
None
_________ is a flowgraph in which it has both forward and backward edges
DAG
Non-Reducable Flowgraph
Reducable Flowgraph
None
______ is used to keep track of which variable is stored in a register
Address Descriptor
Register Descriptor
Both a&b
None
The variables that are declared and used at some point in the program are called______
Dead variables
Live Variables
Global Variables
None
The action of parsing the source program into proper syntactic classes is called
General syntax analysis
Interpretation analysis
Syntax analysis
Lexical analysis
The method which merges the bodies of two loops is
Constant folding
Loop jamming
Loop unrolling
None of these
Which of the following techniques is used to replace run-time computations by compile time computations?
Constant folding
Code hoisting
Pee phole optimization
Invariant computation
A compiler is preferable to an interpreter because
Debugging can be faster and easier
If one changes a statement, only that statement needs re-compilation
It is much helpful in the initial stages of program development
It can generate stand-alone programs that often take less time for execution
A grammar that produces more than one parse tree for some sentence is called as
Ambiguous
Unambiguous
Regular
All of these
The number of tokens in the following c statement is
Printf(“i=%d, &i=%x”,&i);
3
26
10
21
PeeHole optimization __________
Loop Optimization
Local Optimization
Constant folding
Data Flow analysis
When will the relationship between ‘<’ and ‘>’ be