0% found this document useful (0 votes)
10 views8 pages

System Programming Qpaper 2024

SP Qpaper 2024 DU CBCS

Uploaded by

Saheba Kapoor
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)
10 views8 pages

System Programming Qpaper 2024

SP Qpaper 2024 DU CBCS

Uploaded by

Saheba Kapoor
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/ 8

[This question paper contains 8 printed pages.

Your Roll No.~J.O.~Y.~i 00


2i
Sr. No. of Question Paper : 4431 G
Unique Paper Code 32347501

Name of the Paper System Programming

N a1ne of the Course B.Sc. (H) Computer Science

Semester V

Duration : 3 Hours Maximum Marks : 75

Instructions for Candidates

I. Write your Roll No . on the top immediately on receipt


of this question paper.

2. Section A is compulsory.

3. Attempt any four questions from Section B.

4. Make and state necessary assumptions wherever


applicable.

Section A

/ ,/;ff: ·
· ) Wh1c h p J1a se o f a comp1· 1e r perform s type
checking? ( l)

P.T.O.
2
4431
# -at _is th e differe nce betwee n static and shared
Iibranes ? (2)

d ,hat are the advanta ges of (i) a compile r over an


~ i:terpre ter (ii) an interpr eter over a compiler?

(2 )

) Describ e the languag e denoted by the foll owing


regular express ions : (2)

(i) ocoI1) *o

(ii) ((011)*0(011)(011))

~ w the Directe d Acyclic Graph for the follo wing


arithme tic express ion :

a + a* (b - c) + (b - c) * d

. e an exampl e of

~ Lex ica l error


yc·/ a Sy ntac tic error
~ Semanti c error
4431 3

~ a simple two pass assembler handle the


following code? Justify your answer. (3)

ALPHA EQU BETA


BETA EQU DELTA
DELTA RESW 1

~ rite the type expression for the following type


declaration :

int[2][3][4] (3)

@ Translate the following arithmetic expression into


Quadruples :

X = f(y + 1) + 4 (4)

@ Write character classes for the following sets of


){ characters : (4)

(i) The first six letters (up to "f') 111 either


upper or low e r case.

(ii) The "digits" in a hexadecimal number


(choos e e ither upper or lower case for the
"digit s" abov e 9).

P.T.O.
4
4431
·t machi ne code for the following th ree add
Wrt e ress
. .
instruction . (4)

if x < y goto L

a simpl e target machi ne model an d state


As sume
any assum ption/ s if requir ed.

Consider the follow ing produ ction rules: (4)

S ➔ ACBjCbbjBa

A ➔ dajBC

B ➔ gj E

C ➔ hi E

Find First and Follow set of all the non-term inals


in the rules above.

Sectio n B

(a) What is backp atchin g in a single pass assc!l1b lc·r


. t· f H'' 1r,i
Exp I arn how it solves the probl em o l ·(4)
re ferenc ing?

(b) W · . 1·0 I ltn" in~


rit e the action s of an LR Parse fo r the bI ,rt'. c:·n
.
st rin g for th e gra mmar and parse tn t' = t6)
below : a I bb
4431 5

ACTION GOTO
State a b 0 l $ s A B
0 Sl S2 S3 11 4 5
l S1 S2 S3 6 7
2 r4 r4 r4
3 r6 r6 r6 r6 r6
4 rl rl rl r1
5 r2 r2 r2 r2 r2
6 S8
7 S9
8 r3
9 S10 \

10 r5
. r5
11 ) ace

Gramma r :

s ➔ A

s ➔ B

A ➔ aAb

A ➔ 0

B ➔ 1

B ➔ aBbb

0 ~
y..
Show that the following grammar is not SLR(!):
(6)
S ➔ Aa\bAc\dc \bda
A ➔ d

P.T .O.
4431 6

-l ow is a high langua ge source program tran slated


into an equiva lent machin e code in a language
proces sing sys tem? Explai n with a diagram. ( )
4

'f 4. (a) Write a progra m 1n Lex that copies the standard


input to the standa rd output , except it replace s
each sequen ce of consec utive blanks and tabs by
a single blank. (4)

(b) Consid er the fo1lowing Syntax Directe d Definition :


pcw.e., ~ ~ i ~s. 'ti- (6)
Production Semantic Rules
I) T-+ FT' T'. inh = F. val
T. val = T'. syn

2) T' ➔ *FT' 1 T'1 .inh = T'.inh x F.val

T'. syn = T'1 . syn


3) T' ➔ E T'. syn = T\. inh
4) F-+ digit
F. val = digit. lexval

~ G·~ tc three addr e ss c od e for f o 11 ow i n g c O ck


JJS ,tV:,~~ret: (6)

for( i I ; i ,,, IO ; i + 1- )

" Ii I X * 5 ,·
I

I
4431 7

~ nsider the follow ing c code fra gment : (4)

if(x < y && flag)

a = O·
'
else

b = O·
'

List the possib le lexeme s, tokens and their attribut e


values that would be identif ied by the lexical
analyz er while scanni ng the above code fragme nt.

1
i
· ~
~ 1 at is an activat ion record? Explain the d_ata
i:•e ms that might appear in a genera l act1vat1on
record . (5)

~ i fferen tiate betwe en an ambig uous _and


unamb iguous gramm ar. Check whethe r the given
gramm ar is ambigu ous or not?

s ➔ SSIAB
f
A ➔ Aaja
(5)
8 ➔ Bblb

~
tori al of a given
F
A C langua ge code to compute ac ~
. ())
· I
beow ·
numbe r recursi vely 1s s hown

P.T.0 .
J

8
4431
j 11 t faC t O ri a I ( i 11 t 11 )

if(n == 0)

return 1;

else

retur n n * facto rial(n - 1)

Draw the activ ation tree for the call factor ia l (5 ).

~ ven the foll owin g sectio n table s for two object ;


files , a.obj and b.ob j. Expl ain the linkin g
proce ss and show the layou t of the comb ined
sec ti on tab Ie. (5)

1 e: a.ob''1
F'l
Name Size Alb?D
.text 200 16
.data 60 4
.data I 75 4

l e: b .0b'1
F'l
Name Size Alien
.text 100 16
.data 155 4
.data2 300 4

t
t >

You might also like