PYQ Sem 5
PYQ Sem 5
Semester V
\ 2.
of this question paper.
Section A is compulsory.
SECTION A
P.T.O.
C
1094 2
E a / abEb I aFb
F bE I aFFb (3)
-( X * y) + (p + q) - (X + Y) (3)
1094 3
(i) Identify and list the possible lexemes, tokens and
their attribute values that would be identified by
the lexical analyzer while scanning the code
fragment.
if (x 20) then
mid= 10;
else
LD RO, i
LD Rl, a(RO)
ST b, Rl
(4)
SECTION B
.S aSIAb
XYZIE
X cSjE
y dSIE
z es (4)
E EalEc le··
:(<x:+ y) (~~r,.
...... ,,,, ,.· ... ,.
P.T.O.
6
1094
.d r the following Syntax Directed Defini·t·
(b) ons1 e ton:
C
Semantic Rules
production
L.attr := T.type
D TL
T.~ype := integer
T int
.T.type := float
T float
L1.attr :=
L LI' id
• " L.attr; addtype(id. entry, L.in)
5.
(a) Find the First and Follow set of al~ non-terminal
for the following grammar: (5)
l
I
S ES' ,,,,,. .
'
/
S' +pS'/e
-
E ....,,
AE'
E' AE' IE
(S)/id
•·
1094 7
if x < y goto L1
z =0
goto L2
LI: z = 1
E E + TIT
T T * FIF
F (E)lid
id * id + id (4)
P.T.O .
!?I
~
1094 8
S daAe
daA IE
E EbP IP
P d I pAp
(1500)