0% found this document useful (0 votes)
26 views3 pages

Compiler QP

This document is an exam for a Compiler Design course covering various topics: 1. It contains questions ranging from basic knowledge/recall to higher order skills like analysis and evaluation. 2. The exam is divided into three parts - short answer questions, longer answer questions, and coding/problem solving questions. 3. Questions cover key concepts like language processing systems, grammars, parsing, syntax analysis, code generation, and compiler optimization techniques.

Uploaded by

Achyuth Anand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

Compiler QP

This document is an exam for a Compiler Design course covering various topics: 1. It contains questions ranging from basic knowledge/recall to higher order skills like analysis and evaluation. 2. The exam is divided into three parts - short answer questions, longer answer questions, and coding/problem solving questions. 3. Questions cover key concepts like language processing systems, grammars, parsing, syntax analysis, code generation, and compiler optimization techniques.

Uploaded by

Achyuth Anand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Register No:| 5 oo 1o13

SriSivasubramaniya Nadar College of Engineering, Kalavakkam -603 110


(An Autonomous Institution, Affiliated to Anna University, Chennai)
B.E. /B.Tech. End Semester Theory Examinations, Apr / May 2022
Sixth Semester
Computer Science and Engineering
UCS1602 COMPILER DESIGN
(Regulations 2018)
Time: Three Hours Answer ALL Questions Maximum:100 Marks
Kl: Remembering K2: Understanding K3: Applying K4: Analyzing K5: Evaluating

PART - A (10 x 2 = 20 Marks)


01. K2|Compare the functionalities of assembler, compiler and interpreter. CO1
02. K1 What are the two parts of acompilation? CO1
03. K1 Draw theparse tree for the source language id+id)*id-id CO2

04. K2 Define ambiguous grammar with example. CO2


05. K1 What are the functions used for construction of syntax tree for expression CO3
06. K2 Explain inherited attribute with example. CO3
07. K1 What is meant by registers and address descriptor? C04
08. K1 What is the use of Next-use information? CO4
09. K2 Define peephole optimization. COS
10. K1What is LLVM? COS

PART -B(5 X6=30 Marks)


11. K2 Explain language processing system with neat diagram. CO1

Consider the grammar G for declaration statement


G: S>TL;
12. K3 CO2
T’ int | float
L’L,id| id

1
UCS1602

Develop a syntax checker to recognize the following statements by


writing suitable LEX & YACC specifications.
int a,b,c;
float d;
char e;
Construct a decorated parse tree according to the syntax directed CO3
13. K3
definition, for the following input statement (4+7.5*3)2.
CO4
14. K2 Explain the issues of code generation with examples.
COS
15. K2 Explain the principle sources of optimization in detail.
PART -C(5 × 10 = 50 Marks)
Identify the output for the following expression after each phase
16 K3 Position:=initial+ rate*60 also explain the various phases of a CO1
compiler in detail
(OR)

17 K3
Apply direct method to construct DFA for the regular expression CO1
(ab)*abc

Consider the following grammar.


E-+E+T|T
18 K3 T’TF | F CO2

F+F*|a| b
construct the SLR parsing table for the given grammar
(OR)
Construct the LALR Parsing table for the following grammar
E’E+T|T
19 K3 T’T*F|F CO2
F’(E) /id
Parse the following string (id + id ) * id

Write the syntax directed translation (SDT) to generate three address


codes for assignmernt statement. Apply the SDT to generate three
20 K3 address codes for the following statement. CO3
gFa+b-c*-d

UCS1602 2
UCS1602

(OR)
Write the SDT for declaration statement. Construct symbol table for
the following declaration statements.
a : integer
21 K3 CO3
b:real
c:array (10) of integer
d:‘ integer

22 K2
Explain code generation algorithm and generate assembly language CO4
for the following statement d =a-b*c+e.
(OR)
23 K2
Explain storage allocation strategies and parameter passing CO4
methods in detail.

Explain the algorithm for DAG generation from basic block and
construct the DAG for the following basic block.
1. t1:=4*1
2. t2: =a[tl]
3. t3:=4*i

24 K3
4. t4:-b[t3] COS
5. t5: =t2*t4
6. t6:-prod +t5
7 prod:=t6
8. t7:=i+1
9. i:7
10. ifi<-20 goto (1)
(OR)
Develop three address code for the given source language and
optimize the three address code using various optimization
techniques:
iFl,s-0; COS
25 K3
for(i-1;í<=3;it+)
cli]=stali *b[il;

UCS1602 3

You might also like