SPCC Assignment 3-8
SPCC Assignment 3-8
SPCC Assignment 3-8
3
Dousn faning Bottorn - up Tagng
Top
teeh niq +hat
I. ts a pagng technique that L. T4's a
pomihg
l6west leve the
the I0ol at tthe
(Gok at the hughet levet o wore the
tree an woy own the
page tvee by uith the ales
fa ge fee by jing the ules Pase
qvamner.
gromm attenpt to veduca the
2.Tt attempts to hd tha let- 2. It
mast deyvation for an Input-st nhg nput stnhg to the staot symbol
types.
) Machine Inedependent aptimi zaion.
int b= 20;
iht c= a t b lResul t stod in
printf( The
Ketum 0;
Positi on Notation:
- Posii on otahon also known reyek p i s h notaHons is
F
expe1on whe copeyator tallows
speands.
Itis linear repreyentation thot avsidy the nee for paentheis
ello) Stict opevotor precudence
preee
Expeyion :- (s+ 3)* 4
Fotion Motaton :- 5 + 4 *
Evaluat on Poy om let to
Syntax Tree:
Syntax Trea alyo knon
Abstvact suntaxsouTcs
tree ae thee
dala stuctue that neprexnt stucture o card.
Each leal nae cescbe each interor ngde
eescnes on pevotor
Sundaran FOR EDUCATIONAL USE
atb *c-d.
Cxprem on :
Sundaram
i) Tnples:
- In the content o sperondy l 2 ave stored eyutt
field ave qenerally pethter to Symhol necor
- Three hetd ave videt ay:
O Fiyt contany operafor
Next two hol va'uu opevandy
a = bte k
te= bt ti
a= t2
accurately captum se
alocaion aiqhment
frocen a aíqnanq variahley to hardwae vqstem
to mineihe
vanaley.
Sundaram) FOR EDUCATIONAL USE
9ptinmization:
qenevahng optimiza cade is a
VayiouS apttmizati on technique to incre uSe the
Code si ze:
the qenated cade ) impostant
munimuzng
Compiley înctude teehnique Nlee eoee co mprenion, 4unctn
Inurin9. dead coe elimin ati on c.
The phaes cAmptlea folou.
I. Lexical Anatysis:
Thii phase taky al tnput poqram and
elemnt the a e conret it qeneat1 s1ream
to can
-fox the sttemant PERtR-s*3", the toon) id entiiet by
the texical analys e o uld Fe e, =,R, t,R, -s,*,3,
2. Syntax Anatysis:
Thy phaje ta key an input to kan genatated kby lexieat analyser
phaye and the syntax iS Loret.it qeneratea paNe teQ.
Fax the stat ement above, the pase mgnt be
Sundaram
4. Intemediak Code
Genevator:
Thi phaye qeneates an itemiate cote which halp to
Smpily the complety poram.tto
tey t he state n t PQ4R -S# z <te
intemediae
might lsek lilea:
t = *z
ta R+Q
tz = t - t i
P=t3
5. Coele Optmizatitn:
Tha phaje perom cspttnË zation so that the veyuting taYqet
Prram crutd_get exe utd fater.
For the stat ement p R t R-S*3', the optti z s
conytnt folting to Ropla caCest3
M côNtant, i 's' is a
contant Value.