Professional Documents
Culture Documents
R7411904 Automata and Compiler Design
R7411904 Automata and Compiler Design
R07
AUTOMATA AND COMPILER DESIGN
(Electronics and Computer Engineering)
Time: 3 hours Answer any FIVE questions All questions carry equal marks ***** 1
Max. Marks: 80
(a) Construct NFA for the language L, that accepts set of strings end with two consecutive zeros over the alphabet {0, 1}* (b) Construct DFA for the regular expression a(a + b)* b (a) Define ambiguity in CFG. Show that S SaSaS/b is ambiguous. (b) What is left recursion? Explain procedure to eliminate left recursion from CFG. Design canonical parser for the following grammar. S CC S cC/d (a) Differentiate s-attributes and l-attributes. (b) Generate the three address code for the following c program. main ( ) {int i = 1 int a10; while (i <= 10) ai = ; } (a) Explain about type checking of expressions and statements. (b) Describe the Chomsky hierarchy of languages. (a) What is an activation record? Explain the purpose of different fields in activation record. (b) Explain about dynamic storage allocation mechanism. Optimize the following code: product = 0 = 1 i do product = product + Ai Bi = i+1 i while (i <= 20) (a) Write an algorithm to construct a DAG from a basic block. (b) Discuss the issues in the design of code generator.
*****