Download AKTU B-Tech 6th Sem 2015-2016 NCS 603ECS 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) 2015-2016 NCS 603ECS Compiler Design Question Paper

Printed Pages: 6 NCS-603/ECS-603
(Following Paper ID and Roll No. to be ?lled in your
Answer Books)
RollNoLlllll l I ll
B.TECH.
Theory Examination (Semester-VI) 2015-16
COMPILER DESIGN
Time : 3 Hours Max. Marks : 100
Note: Attempt questions from all Sections as per directions.
Section-A
Attempt all parts of this section. Answer in brief.
(ZXI0=20)
Ql. (a) What is cross compiler?
(b) Whal do you mean by a regular expression?
(0) State the problems associated with the top down
parsing.
(d) Differentiate quadruples and triples.
(1) P.T.O.
2505/?9/496/12400

(e)
(0
Q9
(h)
(i)
(j)
Differentiate between compilers and interpreters.
How YACC can be used to generate parser?
De?ne DAG.
Discuss the sub set construction algorithm.
What is the role of le? recursion?
Discuss the challenges in compiler design.
Section-B
Attempt any ?ve questions from this section.
(a)
(b)
(10x5=50)
Construct an SLR (1) parsing table for the following
grammar
S?>A)
A ??> A, P) (P, P
P -> {num, num}
Give the algorithm for computing precedence function.
Consider the following operator precedence matrix draw
precedence graph and compute the precedence func-
tion:-
(2)
2505/139/496/12400
(C)
A > > >
( < < = <
) > > >
De?ne backpatching and semantic rules for Boolean
expression. Derive the three address code for the
following expression '
P < QorR < S and T < U
((1) Generate three address code for the following code
switch a+b
{
case 1: x =x+1
case 2: y = y+2
case 3: z=z+3
default :c=c-I
}
(3) P.T.O.
2505/139/496/12400

.1:
a
(e) Construct the LALR parsing table for following a:=b+c
gmmnar:
b:=b-d
S?>AA ,
A?)aA , cz=c+d
A??>b '
? e=b+c
(t) Show that the following grammar i
Also explain the key applications of DAG.
S?>Aa|bAc|Be[bBa
4. Consider the following sequence of three address codes:
A ?> d
B ?) d 1. Prod: =0
is LR (1) but not LALR (1).
2 1: =1
(g) What are lexical phase errors, syntactic phase errors
3. Tl:=4*I
and semantic phase errors? Explain with suitable ex-
ample.
4. T2:=addr (A)-4
(h) Describe symbol table and its entries. Also discuss vari-
ous data structure used for symbol table. 5- T33=T2 [T1]
Section-C 6. T4:=addr (B)-4
Attempt any two questions from this section. (15X2=30) 7' T52=T4 [T1]
3. How DAG is different ?om Syntax Tree? Construct the DAG 8- ?5343*?
for the following basic blocks.
9. Prod: =Prod+T6
L (4) (5) P.T.O.
2505/13W496/124oo 2505/15W496/12400

10: I=I+1
?11: IfI<=20 goto (3)
Perform Loop Optimization.
5. Write short notes:
(i) Global Data?Flow Analysis
(ii) Loop UnrOlh'ng
(iii) Loop Jamming
(6)
2505/13/496/12400

This post was last modified on 29 January 2020