problem 1)a) Define compiler? What are the various compiler construction tools describe in detail?
(b) Why intermediate code generation is not included in front end or back end?
(c) Consider the following grammar.
S XaYb
X bXc | b
Y dYa | d
Determine the first set for each non-terminal of the given grammar.
problem 2)(a) Construct a Syntax-Directed Translation scheme that takes strings of a’s, b’s and c’s as input and produces as output the number of substrings in the input string that correspond to the pattern a(a|b)*c+(a|b)*b. For instance the translation of the input string “abbcabcababc” is “3”.
Your solution must include:
1. A context-free grammar that generates all strings of a’s, b’s and c’s
2. Semantic attributes for the grammar symbols
(b) What is Abstract Stack machine. Describe in detail with the help of appropriate exs?
problem 3)(a) Define lexical analysis? Also describe roles of lexical analyzer in detail.
(b) What is Input Buffer? Describe in detail?
problem 4)(a) Define Parser. Elaborate Top down parser in detail with the help of appropriate exs.
(b) Convert the following regular expression into NFA using Thompson’s construction.
a(a|b)*c+(a|b)*b
problem 5)(a) Convert NFA into DFA of the following:
i. (a | b)*
ii. (a* | b*)*
problem 6)(a) Define Type Checking. prepare down the difference between Static and Dynamic Type checking?
(b) What is the Specification of a simple Type Checker?
problem 7) Describe unification algorithm in detail with the help of appropriate exs.
problem 8)(a) Describe Back patching in detail with the help of suitable exs.
(b) describe Procedure Call with the appropriate ex.
problem 9) Convert the following LR grammar to right recursive grammar:
E → E + T / E – T / T
T → T x F / T / F / F
F → (E) / Numbers
Numbers → 0/1/2………………/9.
problem 10) prepare a brief notes on the following topics:
(a) Peephole optimization
(b) Loops in flow graphs
(c) Iterative solution of data-flow equations.