CS8602 Compiler Design
CS8602 Compiler Design
CS8602 Compiler Design
com
Anna University | Polytechnic | Schools
Reg. No. :
Sixth Semester
(Regulations 2017)
2.
3. www.binils.com
State the interactions between the lexical analyzer and the parser.
PART B — (5 13 = 65 marks)
11. (a) Describe the various phases of compiler with suitable example. (13)
Or
(b) (i) How a finite automaton is used to represent tokens and perform
lexical analysis with examples. (7)
(ii) Compare and Contrast NFA and DFA. (6)
www.binils.com
Anna University, Polytechnic & Schools
www.binils.com
Anna University | Polytechnic | Schools
12. (a) (i) What is SLR (1) parser. Describe the Steps for the SLR parser. (7)
(ii) Give a rightmost derivation for (a, (a, a)) and show the handle of
each right- sentential form. (6)
Or
(b) Describe the LR parsing algorithm with an example. (13)
13. (a) Elucidate the variants of Syntax tree with suitable examples. (13)
Or
(b) (i) Write an algorithm for unification with its operation. (6)
(ii) Discuss in detail about Translation of array reference. (7)
14. (a) Discuss in detail about stack allocation space of memory and the usage of
stack in the memory allocation. (13)
Or
(b) Elaborate the various issues in code generation with examples. (13)
15. (a) (i) Formulate the steps for efficient Data Flow algorithm. (7)
(ii) Describe the representation of array using DAG with example. (6)
www.binils.com
Or
(b) Summarize in detail about the global dataflow analysis with example.(13)
PART C — (1 15 = 15 marks)
16. (a) Find transition diagrams for the following regular expression and regular
definition. (15)
• a(a|b)*a
• ((|a)b*)*
• All strings of digits with at most one repeated digit.
• All strings of a’s and b’s that do not contain the substring abb.
• All strings of a’s and b’s that do not contain the subsequence abb.
Or
(b) Apply code generation algorithm to generate a code sequence for the
three address statement for the following assignment statement. (15)
D : a b * a c a c .
————––––——
2 40399
www.binils.com
Anna University, Polytechnic & Schools