CD Important Questions
1. Define Compiler and draw the diagram for phases of compilation.
2. Differentiate analysis and synthesis phase.
3. What is the role of parser and give its classification.
4. What is an ambiguous grammar and give a suitable example for it.
5. What is the difference between annotated parse tree and dependency graph?
6. Give any two applications of syntax directed translation.
7. How the cost of an instruction is computed?
8. Write about garbage collection and give examples for the languages that support
garbage collection.
9. What is meant by code optimization and list types of code optimization?
10. What is the function preserving transformations?
11. Intricate the role of input buffering scheme in lexical analyzer.
12. Explain the compiler construction tools with an example.
13. Construct and analyze SLR(1) for the grammar: E → E+T | T, T → TF | F, F → F* | a | b.
Show acceptance for w = a + b * a.
14. a) Explain the computation of First and Follow sets with an example.
b) How to overcome the left factoring? Explain with an example.
15. Explain S attributed translation with an example.
16. Contrast and compare annotated parse tree and dependency graph with an example.
17. a) What is the necessity of subdivision of run time memory? Explain with an example.
b) Compare static and dynamic storage allocation.
18. Explain the target language with an example.
19. a) Apply and analyze loop optimization techniques.
b) Define: i) leader, ii) basic block, iii) flow graph.
20. Explain data flow schema with an example with reaching definition.
21. Differentiate token, pattern, lexeme.
22. Define: Preprocessor, Assembler, Loader and Linker.
23. Eliminate the left recursion for the grammar: E → E+T | T, T → T*F | F, F → (E) | id.
24. How can we collect Canonical collection of Items?
25. What is meant by type checking?
26. Define L attributed definition with an example.
27. Write about instruction ordering in the generation of target code.
28. What are the different representations of intermediate code?
29. What is constant propagation?
30. Define: a) Dominators, b) back edges.
31. Explain the various stages of compiler and trace the program segment: c = a + b - 4.
32. Give the minimized DFA for the expression (a/b)*abb.
33. Check and analyze why the grammar is LALR(1) but not SLR(1): S → Aa | bAc | dc | bda,
A → d.
34. Explain the model of Table-driven predictive parsing and analyze with an example.
35. Design a simple calculator with an SDT.
36. Describe annotated parse tree and construct annotated parse tree for the input string 4
* 5 - 6.
37. Explain quick sort with the help of activation tree.
38. a) Write and analyze algorithm for partitioning three address statements into basic
blocks.
b) Explain the representation of flow graphs with an example.
39. a) Annotate the common subexpression elimination with examples.
b) Explain dead code elimination with an example.
40. Analyze live-variable analysis with an example.
41. How does compiler generate an intermediate code?
42. What is the role of lexical analyser?
43. What is Handle Pruning?
44. Eliminate left recursion from the grammar: A → Ba | Aa | c, B → Bb | Ab | d.
45. Define L-attributed definition.
46. Draw the DAG for the expression: a + a * (b - c) + (b - c) * d.
47. Define Loop Optimization.
48. Define Code Motion.
49. What do you know about Live Variable Analysis?
50. Write about machine independent optimization.
51. Explain the various functionalities of a Lexical Analyzer with an example.
52. Describe the optimization of DFA-Based Pattern Matchers with examples.
53. Analyze the operator precedence parsing algorithm with an example.
54. Construct and analyze LALR(1) parsing table for the grammar: S → Aa | bAc | Bc | bBa, A
→ id, B → d.
55. Explain in detail about the various storage allocation schemes with examples.
56. Explain the construction of Syntax tree using SDT with an example.
57. Matrix multiplication program: a) Construct a flow graph and find number of loops.
b) Move loop-invariant computations out of loops.
58. Explain and analyze reducible and non-reducible flow graphs with an example.
59. Generate intermediate code for:
i) x = f(a) + f(a) + f(a)
ii) x = f(a) / g(b,c)
iii) x = f(f(a))
iv) x = ++f(a)
60. Generate optimal machine code for:
main() {
int i, a[10];
while (i <= 10) a[i] = 0;
}
61. Define the terms Tokens, Lexemes and Pattern with example.
62. What is the significance of regular expression in compiler design?
63. List all the Parsers in Top-Down parsing and write briefly about each.
64. How do you perform Closure operations for the given grammar?
65. Write a note on the specification of a simple type checker.
66. Define S-attributed definition.
67. Define loop optimization.
68. Define Constant folding.
69. Describe peep hole optimization.
70. What is DAG representation?
71. Explain the different phases of a compiler using: position := initial + rate * 60.
72. Describe the lexical errors and various error recovery strategies with suitable examples.
73. Construct and analyze SLR(1) parsing table for: S → AS | b, A → SA | a. Why is it not
LL(1)?
74. Define LR(k) parser. Explain all LR parsers with states and parsing table errors.
75. Justify 'Only one occurrence of each object is allowable at a given moment' with static
allocation.
76. Analyze various storage allocation schemes with respective garbage values.
77. Summarize various structure-preserving transformations on basic blocks.
78. A flow graph is useful for understanding code generation algorithm. Justify with
example.
79. How can we optimize using register allocation techniques with an example?
80. Construct a DAG for the code:
i) x = y * z
ii) w = p + y
iii) y = y * z
iv) p = w - x