CD Online Bits
CD Online Bits
CD Online Bits
COMPILER DESIGN
21.consider the grammar where p,q,r are not terminals and r,s,t are terminals [ ]
a)p_>QR b)p_Q s R C)P_>e d)p_QtRr
22.In a compiler ---------------------checks every character of the source text. [ ]
a) The lexical analyzer b) The syntax analyzer
c) The code generator d) The code optimizer
23. Why is the code optimizations are carried out on the intermediate code? [ ]
a) Because for optimization information from the front end cannot be used
b) Because program is more accurately analyzed on intermediate code than on machine code.
c) Because for optimization information from data flow analysis cannot be used
d) Because they enhance the portability of the compiler to the other target processor.
24. In a compiler, the data structure responsible for the management of information about [ ]
variables and their attributes is
a) Semantic stack b) Parser table c) Symbol table d) Abstract syntax-tree
25. Some code optimizations are carried out on the intermediate code because [ ]
a) they enhance the portability of the compiler to other target processors
b) program analysis is more accurate on intermediate code than on machine code
c) the information from dataflow analysis cannot otherwise be used for optimization
d) the information from the front end cannot otherwise be used for optimization
26. Which one of the following is false? [ ]
a) The code contains loop invariant computation
b) There is scope of common sub-expression elimination in this code
c) There is scope of strength reduction in this code
d) There is scope of dead code elimination in this code
27. Optimization of program that works within a single basic block is called [ ]
a) Local optimization b) Global optimization c) Loop un-controlling d)Loop controlling
28. The average time required to reach a storage location in memory and obtain its contents is [ ]
called the _____
a) Seek time b) Turnaround time c) Access time d) Transfer time
29. An intermediate code form is [ ]
a) Postfix Notation b) Syntax Trees c) Three address d) All of the mentioned
30. The graph that shows basic blocks and their successor relationship is called [ ]
a) Dag b) Flow Graph c) Control Graph d) Hamilton Graph
Answers
1-A
2-D
3-D
4-C
5-A
6-C
7-B
8-C
9-D
10-B
11-C
12-D
13-A
14-C
15-B
16-C
17-A
18-B
19-A
20-B
21-A/C
22-A
23-B
24-C
25-A
26-D
27-A
28-C
29-D
30-B