How To Exam?

a knowledge trading engine...


Himachal Pradesh University (HPU) 2008 B.Tech Computer Science and Engineering COMPILER DESIGN - exam paper

Tuesday, 22 January 2013 05:55Web

(2057)
5254
B.Tech. Vlth Semester exam
COMPILER DESIGN Paper - CS-6003
Time : 3 Hours] [Maximum Marks : 100

The candidates shall Umititheir answers precisely within the answer-hook (40 pages) issued to them and no supplementary/ continuation sheet will be issued.
Note : Attempt 5 ques. in all, selecting 1 ques. every from parts A, B, C and D, and Q. No. nine of part E (Compulsory)


The candidates shall limit*their answers precisely within the answer-book (40 pages) issued'to them and no supplementary/ continuation sheet will be issued.
Note : Attempt 5 ques. in all. selecting 1 ques. every
from parts A, B, C and D, and Q. No. nine of part E
(Compulsory). , , |^ ^
SECTION-A
Draw a block diagram of the phases of a compiler and
indicate the main function of every phase. 20

2. What arc the advantages and disadvantages of performing
the assembly of the compiled program in the compiler rather
than using the standard system assembler ? 20
SECTION-B
3. Consider the subsequent rules of the grammar £L :
D -4 ABA- I xty | yAx | yBy
B —> yx. A '—> v C .V . C -4 x where the non-terminals are (D. C B. A) and the terminals
are (u, y). The Stan symbol is D.
5254/500/GGG/5^ [P.T.O.



(i) Construct the canonical collection of sets of LR(1)
items.
(ii) Construct the LR(1) Parsing table. A 10+10
• i
i
4. Consider the subsequent grammar :
SM one AB | six A -> one AC | 0C
B H> OS •• • "
C -» lJ.
Test whether the grammar is LL(1) or not. 20
SECTION-C
5. Construct the 3-address code for the subsequent fragment of
code; it computes the dot product of the vectors A and B
of length 20.
Begin
VP :,= '0; x-
i : = 1; do
begin
P : = P + Ail x B[7]; i : j.i + one ;
end
while one < = 20
Write short notes on the subsequent :
(a) Symbol table and its contents. • t
(b) Block structured language. 20

SECTION-D
provide 3 examples of machine dependent optimization.
State where these kinds of optimization are performed in
the compiler and discuss the trade-Offs of optimizing there
rather than at a few earlier" or later time. 20

Write tech. notes on the subsequent : '
(a) Problems in code generation. 0 ^^y^
(b) Register allocation and assignment. 20

SECTION-E^
(Compulsory)
r
(i) Comment on the tvath/falsehood of the subsequent statements (a to h) :
(a)yXj\ven a finite automata M (Q, E, 5, <:/f.F)
accepting L(M), tlie automata M, (QT'"Z, 5, ~q0, (Q-F)) accepts L(M), where L'(M) is complement of L(M). If M is optimal or minimal state automata, then M, is also a minimal state automata.
^(bj/^Every subset of a regular set is also a regular set. - (c)y In a top-down back-tracking parser, the order in which different options are tried may affect the language accepted by the parser, (d)' An LR parser detects an error, when the .symbol
%r coming next in the input is not validj continuation of the prefix of the input seen by the parser.


( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Himachal Pradesh University (HPU) 2008 B.Tech Computer Science and Engineering COMPILER DESIGN - exam paper