PREVIOUS YEAR QUESTION PAPER

IT7501 – Compiler Engineering

Anna University

Regulation 2015 Semester 5 2021

Question Paper Details

University Anna University
Degree B.Tech. Information and Technology
Department Information and Technology
Regulation Regulation 2015
Semester 5
Subject Code IT7501
Subject Name Compiler Engineering
Exam Session November / December 2021
Duration 3 Hours
Maximum Marks 100

View Question Paper PDF

Access the previous year question paper for your examination preparation.

View / Download PDF

How to Use This Question Paper

More Question Papers

Browse other previous year question papers for this subject.

View All Subject Question Papers

Question Paper Intelligence

Automatically extracted historical question data. Academic accuracy and examination rules require verification.

21Extracted entries
100Maximum marks (metadata)
180Duration (minutes)
5Choice candidates

Part-wise extracted questions

Part A10
Part B10
Part C1

Question type candidates

Other Or Unclassified15
Short Description2
Diagram1
Design1
Comparison1
Definition1

Section marks — arithmetic candidates

Part A20 marks
Part B65 marks
Part C15 marks

Examination marks pattern

PartRequired answersMarks per answerSection total
A10220
B51365
C11515

Estimated time allocation

Proportional to section marks. This estimate uses the full exam duration without a separate reading or revision reserve.

Section time budget

Part A36.0 min
Part B117.0 min
Part C27.0 min

Optional-choice evidence

Detected alternatives only. Confirm the actual choice rules in the original question paper.

Part B — Question 11: Option a · Option b
Part B — Question 12: Option a · Option b
Part B — Question 13: Option a · Option b
Part B — Question 14: Option a · Option b
Part B — Question 15: Option a · Option b

Question navigator

Extracted questions

Part A — 1

List out the various tasks to be performed by the Assembler in contrast to the Compiler.

Short Description
Part A — 2

Write a Lex program to count the total number of alphabets and numbers in the given input.

Other Or Unclassified
Part A — 3

Illustrate with an example how do you eliminate Left factoring and Left Recursion in a given grammar.

Diagram
Part A — 4

Identify whether the following grammar is LL(1) or not: S-> iEtSS1|a S1-> eS|ε E-> b

Other Or Unclassified

Source quality review required

Part A — 5

Write down the rules behind type checking of compilers.

Other Or Unclassified
Part A — 6

Construct a DAG for the expression : a+b+(a+b+(a+a+b+(a+b+a+b)))

Design
Part A — 7

List out the parameters stored in the Symbol table for compilation process.

Short Description
Part A — 8

Compare and contrast static versus dynamic storage allocation.

Comparison
Part A — 9

Define the term Usage Counts.

Definition
Part A — 10

Write down the algorithm involved in partitioning the three address instructions into basic blocks.

Other Or Unclassified
Part B — 11a

a) i) Construct Epsilon NFA for the following regular expression and convert it into DFA using Subset Construction algorithm. (8) (aa*|bb*)abb ii) For the DFA constructed above, minimize the total number of states obtained. (5)

Other Or Unclassified

Source quality review required

Part B — 11b

b) i) Construct Finite Automata for the following expression using Syntax Tree approach. (a|ε )*aab*(b|c)* (8) ii) Illustrate the various phases of the Compiler with a suitable example. (5)

Other Or Unclassified

Source quality review required

Part B — 12a

a) Construct a Predictive parser and draw a parsing table for the following grammar: (13) S-> b|(T) T-> R R->S Check whether the given string (b(b(b))) belongs to the above grammar using Stack Implementation.

Other Or Unclassified

Source quality review required

Part B — 12b

b) Construct CLR and LALR set of items for the following grammar: (13) SSS+|SS*|a Parse the String aa*aa*+ using CLR parsing table.

Other Or Unclassified

Source quality review required

Part B — 13a

a) i) Write down the SDD for simple type declarations such as basic type and an array type. Draw suitable annotated parse tree and dependency graph for the following expressions. (9) a) double a, b, c, d b) int [ x ][y ] ii) Represent the following expression using Quadruples, Triples and Indirect Triples. a = b[i] + c[j] (4)

Other Or Unclassified

Source quality review required

Part B — 13b

b) i) Write down the translation scheme (semantic rules) used to generate code for expressions and generate three address code for the following expression by drawing an annotated parse tree. (9) a=b*-c+d*e+f ii) Compare L-attributed definition with S-attributed definition with a suitable example. (4)

Other Or Unclassified

Source quality review required

Part B — 14a

a) i) What is an Activation Record? Write a recursive code for Factorial computation and illustrate the possible activations that may happen for the code with an activation tree, illustrating each and every recursive call. Draw the growing stack of activation records where each activation record consists of local variables, parameters and control link. (8) ii) How access to Non local data takes place on the Stack? Details your views on it.(5)

Other Or Unclassified

Source quality review required

Part B — 14b

b) i) Explain the functionality of Mark and Sweep Garbage collector with its algorithm in detail. (8) ii) Discuss about the working of Memory manager in Heap Management. (5)

Other Or Unclassified

Source quality review required

Part B — 15a

a) i) What is the role of Instruction Selection and Register allocation in code generation. Illustrate the policies of allocating registers with an example. (8) ii) Write down the three address code for matrix multiplication. Construct a flow graph for your code and identify the loops in the graph appropriately. (5)

Other Or Unclassified

Source quality review required

Part B — 15b

b) i) Explain how Peephole optimization can be applied to improve the code with an example. (5) ii) Generate the target code for the following three address statements assuming a and b are arrays and whose elements are 4-byte values. Also determine the cost of the final target code generated. (8) x = a[i] y = b[j] a[i] = y b[j] = x

Other Or Unclassified

Source quality review required

Part C — 16

Optimize the following three address code step by step locally as well as globally by eliminating common sub expressions, dead code, performing reduction in strength on induction variables and Copy Propagation. p = 0 j = 0 LL: t1 = i*4 t2 = A[t1] t3 = i*4 t4 = B[t3] t5 = t2*t4 t6 = t2 + t4 p = p+t5 + t6 j = j+1 if j<n goto LL *********************

Other Or Unclassified

Source quality review required

Advanced Examination Analysis

Historical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.