B.TECH.
THEORY EXAMINATION (SEM–VI) 2016-17
COMPILER DESIGN
Time: 3 Hours
Max. Marks: 100
Note: Be precise in your answer. In case of numerical problem assume data wherever not provided.
--- Content provided by FirstRanker.com ---
SECTION – A
- Attempt the following: 10 x 2 = 20
- State any two reasons as to why phases of compiler should be grouped.
- Write regular expression to describe a language consist of strings made of even numbers a & b.
- Write a CF grammar to represent palindrome.
- Why are quadruples preferred over triples in an optimizing compiler?
- Give syntax directed translation for case statement.
- What is a syntax tree? Draw the syntax tree for the following statement: cbcba - * + = *
- How to perform register assignment for outer loops?
- List out the criteria for code improving transformations.
- Represent the following in flow graph i=1; sum=0; while (i<=10){sum+=i; i++}
- What is the use of algebraic identities in optimization of basic blocks?
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
SECTION - B
- Attempt any five of the following questions: 5 x 10 = 50
- Explain in detail the process of compilation. Illustrate the output of each phase of compilation of the input “a=(b+c)*(b+c)*2".
- Construct the minimized DFA for the regular expression (0+1)*(0+1) 10.
- What is an ambiguous grammar? Is the following grammar ambiguous? Prove
E ? E + E | E(E) | id - Draw NFA for the regular expression ab*/ab.
- How names can be looked up in the symbol table? Discuss.
- Write an algorithm to partition a sequence of three address statements into basic blocks.
- Discuss in detail the process of optimization of basic blocks. Give an example
- How to subdivide a run-time memory into code and data areas. Explain
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
SECTION - C
- Attempt any two of the following questions: 2 x 15 = 30
- Consider the following grammar
S ? AS | b
A ? SA | a.
Construct the SLR parse table for the grammar. Show the actions of the parser for the input string "abab”. - How would you convert the following into intermediate code? Give a suitable example.
--- Content provided by FirstRanker.com ---
i) Assignment Statements.
ii) Case Statements - Define a directed acyclic graph. Construct a DAG and write the sequence of instructions for the expression a+a*(b-c)+(b-c)*d.
- Consider the following grammar
--- Content provided by FirstRanker.com ---
This download link is referred from the post: AKTU B-Tech Last 10 Years 2010-2020 Previous Question Papers || Dr. A.P.J. Abdul Kalam Technical University
--- Content provided by FirstRanker.com ---