Download AKTU B-Tech 6th Sem 2016-2017 ECS603 Compiler Design Question Paper

Download AKTU (Dr. A.P.J. Abdul Kalam Technical University (AKTU), formerly Uttar Pradesh Technical University (UPTU) B-Tech 6th Semester (Sixth Semester) 2016-2017 ECS603 Compiler Design Question Paper

Printed Pages : 1 Roll No.| l l l l I l l l l l ECS603
B.TECH.
THEORY EXAMINATION (SEM?VI) 2016-17
COMPILER DESIGN
Time : 3 Hours Max. Marks : 100
Note : Be precise in your answer. In case Ofnumerical problem assume data wherever not provided.
SECTION ? A
1. Attempt the following: 10 x 2 = 20
(a) State any two reasons as to why phases of compiler should be grouped.
(b) Write regular expression to describe a language consist of strings made of even
numbers a & b.
(c) Write a CF grammar to represent palindrome.
(d) Why are quadruples preferred over triples in an optimizing compiler?
(e) Give syntax directed translation for case statement.
(f) What is a syntax tree? Draw the syntax tree for the following statement: 0 b c b a - * +
? * :
(g) How to perform register assignment for outer loops?
(h) List out the criteria for code improving transformations.
(i) Represent the following in ?ow graph i=1;sum=0;while (i<=10){ sum+=i;i++}
(i) What is the use of algebraic identities in optimization of basic blocks?
SECTION ? B
2. Attempt any five of the following questions: 5 x 10 = 50
(3) Explain in detail the process of compilation. Illustrate the output of each phase of
compilation of the input ?a=(b+c)*(b+c)*2?..
(b) Construct the minimized DFA for the regular expression (0+1)*(0+1) 10.
(c) What is an ambiguous grammar? Is the following grammar ambiguous? Prove
EE+|E(E)|id.The grammar should be moved to the next line ,centered.
((1) Draw NFA for the regular expression ab*/ab.
(e) How names can be looked up in the symbol table? Discuss.
(f) Write an algorithm to partition a sequence of three address statements into basic blocks.
(g) Discuss in detail the process of optimization of basic blocks. Give an example
(h) How to subdivide a run-time memory into code and data areas. Explain
SECTION ? C
Attempt any two of the following questions: 2 x 15 = 30
3 Consider the following grammar
S-ASlb
A-SAla.
Construct the SLR parse table for the grammar. Show the actions of the parser for the
input string ?abab?.
4 How would you convert the following into intermediate code? Give a suitable example.
i) Assignment Statements. ii) Case Statements
5 Define a directed acyclic graph. Construct a DAG and write the sequence of
instructions for the expression a+a*(b?c)+(b?c)*d.

This post was last modified on 29 January 2020