The document discusses various programming concepts, including the representation of data using triples and quadruples, and the generation of intermediate code for programming statements. It outlines the use of pointers and the importance of efficient memory management in code generation. Additionally, it touches on the grammar and syntax used for generating address code in programming languages.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
12 views
DocScanner 23-Jun-2023 9-08 pm
The document discusses various programming concepts, including the representation of data using triples and quadruples, and the generation of intermediate code for programming statements. It outlines the use of pointers and the importance of efficient memory management in code generation. Additionally, it touches on the grammar and syntax used for generating address code in programming languages.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 28
econ Ton on Ne se retevt a OH 6 yp
yt NH gy
AW al ag
Weg,
pon OTHE aa
uaduple >
a wee vals cle
W
1 Gyeator Open Operangy
we
i
] a 4 i
yen
: jo) mmm
i ee
et \
\ it oe
webrh
js hae
rk A al
ne tile peta he 8 of seporary alles avid by dig |
the i
eit the sr le
othe triple repentaion
Ah ay
For tueesgresin cea DA
Number Oper Operndl —Operanda
[a ane
fin ee w
amis
|
To eet a t
|
Indirect triples
tn the init ile repesotton testing of rps be deme. And ey
Pointers are used instead of wing tales
apnea FAC Ang nt hie
a hy
yi CH gl a
"
iy mm i Si
| “oth Og me
jw Ly Sod
Fy mms | i
bee oy RM eo a
a 1 oa
ocean Sa | Fg |
a yh lige
io We) | !
| : "ee
tof Quads Ti :
span a 9 et tg
yo qu HO egy
i He ig MS te
re ie
_ a 0 A ta yy
ge a A ly sa gy OA WY ae
gat fi ee ogy Ce ty
a Ik ge
ps i HEFL Te ey I pte,
1 es He pb te ey,
x
i
‘i
oy
$y wy phere ca
pile representation fs benof
«ee rl ne rt
pnt Tl 0 ny
js 1 nie td are pn
ti lity 1 cee Bai gy
od with quadruple representation,
1 ade spay an
Hh eer 4y
0 ee amet of gue ay
coi
puns ale cole Sips Hak pi eb
win Hee als oe fo aus pranig gnc tea
Pv ais forms of kere cd, yey ne 8 I
vo thi cape we have sed
(gb
nptsn betwen Quatu, Tle nding Tp
[cue
eet of utp
tye opel, pean,
ai
Triple
Te Fat fips
(operat, pea,
operand)
ech PAT attenene
woe ret hse
Spee
oon
wo
mt
amount of spa
sR
aqgecnnen Theme oi
ies Baemcatera oe
Se E Write the quadruples, triple ang
BB.g oe one
(EEEESEEED cor of on ore Frayer O2ee) Pa ape
2) te theee address code can be
Nacraee ty evel it we be Woe aes 88 en pag, | A
eran Bren epg | | Myx atb
eee femmes
: wed
mins ier
iste J unas
sunt peopel mpmnton fee Ht Ha cle dy, fH
oat ee seme
‘aton Opa Opened Opeand? Rout |oe ements LE gun Statomonts Sr a ewan
eye Mt oa ae Mt ht
pees tee OTe npl BNENEE S Cos
cn QE won ga
So boo wr
Te ey pn a tetas Wop n
armies eS [aS orsplewm eC opm atmnsatgg |
Rats
Seascs,,
SLT
tc |
vite |
= vt some J
I ea] | ci D = HT a delve tenet or dc
Tee eee * fon fF een the mele ry fren dng a
REESE RR |e wit glory cin OY mang he wit of oh one by
Se os el re width Of POIREE YP Is sIPPORE to be 4
Boake «
Pomitar ss e| | ee
“By etm Whos fr dete wr
J) ag restarment statment =
=i sa
2 bc hrs ret entsZ So a a
a me atin aoe fr tis Haig, Pe ye al he it oe
SS “ey wild an FOF the same £8 Cty
sTier a oe - FL he
a | oo ee moh
path ‘alte
oe i ae
ae tae
rot eet clans ed i = S
farmed 00K "2 *
— &
Consider the asignnent tenet
code 7
Production rate
[sous e
|
B
EORtH | Epocenevtem:
rppendte ice E pic" Eas)
ras See
plac Eaaeg) |
[enw tthe
i Wey ten
| ‘ppendblaiey = Epc)
dae JH 908 dda °/
=
“The look up retus the entry for Mzame inthe synol table fxs he,
sre tone ae i fr ppnding he we ar cot tee |
Otherwise an error will be reported. ae
pevtenp the fiz erating ie empory ail
Epilae is use to hold the value of E.
ob) ord)
Fa 1 Annotated pre ta for greratne
he ass adeSaal 8 ee x
SES es Be ose ot 8D :
noc =
eae HNN
= =
eT Te
a
Be wees
: =
BE ens ee i
*
eo
; gas the atlns fan eer rman
ies are
sae Semts gy
mS Seep bln a} ‘Senet nal eee,
pare MATS —
NT ee Ba A ey
we ee SEW
Ste
sag te agen Pat Se bow ak
ahaa cmt oT Soe ttt a
eee Gab
wat ne Be ts Howe Nee oat ant jad re
hos tt sia ake ctr wont a
ESf aces ESE
oo SOE GENES. Re ao
Aewetoow see si Seo Re Tefen
Senko mopar ae suse adie of aah ekeaet Tet he eras |
wae Ba: Sere tn ontrt,
eee
Sime
me
Jew) can Be compute a pe
sie te eam |
Feion scheme FOF gneing tse a
ee a a Less
ode 16 given by
LASS Oe te ie Me cine we
A Scan become
aa a muiimenstnal ray BY COMIEeHNg oy,
Te gemrzd forl
eye tots tebss bbls Im 8
Cannons + lomalny Howe an + 1M)
no beh low
mse (ott tows = 162 1 HOM IM + Lowy sy,
se STN eter geting te De adress
Se earns he tansnon schema fr generating vee aden ae
cnc fe omer fr ay erry |
Mmuational aay mfreare, Heng
int reprouents the Het of indo havin i
eae Ths gener should sare om
Set ane grammar ad verte a8
Luis
at Lie EE
“rat means ary name be asocated with
comp grammar for aray reference ca Be BIVENS
retmost index expression (Le. Utne |
roe pn ng
erence Lote
, het Lethe spe)
pce 9 lav Eppa
(epine~ ep
pce = ne
eee neeee <
2 unum e | Rpm
' peat Sony ie bara
ey staan |
epee
Io) Li simple name then normal assignment done og,
Fa Teepe aston in The tue opm |
ae ee or ine coapondng en In yb ae Pe
tayo table entry for Wat nhl
Sete pet wl refer to» oie
Thre aden ode and
real
se te
re
rou "
: RS
Spee nese att ate mt
_ Sco Se oe te
eb treee eee caret
en eae fc Se
haetc operation, in which the newiemp) fancton
“Fhe value oF E can be denoted
Cte ing
Enlace
we eet the fist term (of an expression fF 8 Uttara ig
qcrancipnsetgyedmsia)eo) Lothet fe wed and Kee Lott ge
Capel simian the second ter
1 Bove Co (ow yng +o 2) 9 #106 3)
nme The futon (Lita) weed obtain he LEI Th gg,
5eettleanay) wee fo feturn the vale af with
TULL indicates spe name of
intnaian indientes number of Index expig |
im) stra ry They means mani
J mows) ean be epr y
+The Lost =|
thr ile @) the
{Gimensone\ Function Limits ary,
= ——~=4 a
PEP sen on. he tpg gan
ots TO ing vali fom inden,
os expres
PCM Sy hy
0 the som
bins
re) ee IM ND
FIOM
ene ter P+ iy
supe coreponds 10 Cyl and Li
Ce vent Om Pa comsponds too,
sc0* Litany ny
ale of #5 alee Epis hehe sag
me
The Vaving dimension en = Hop
noe
eal
FF came:
Pistons crn SAL ro aay
re a
i gd 12 =
Me im) 1) 00 «(omen xm) stom yxey
uj) = GRDI*5 IES Case Ce) 6 ad
] = 4 (20145) + (bose 84)
os code fr thi expremion can be,
ne)
‘Peamputaion of = se = 847
au)
t= tll
Peers eeo_o om
ses SreSeall ll
Tmtermetate Ce i the Frm of Then Aang CES
oaevray 2 of 0 #20 76 25 1 tNengy
lation Scheme:
‘Address Code
Jo Constant €-« base, = 427
"TW dow equation forthe te densi
2 ann gray oa
FEE Boolean Expression as
Nonatly tee ae tw ips of Boson eens
2 re nung toes aes
aoanaer bacon expenon generated by folowing BrAMMar
es
tore the relay He denote by & 2
callie pcceterce is 10 NOT then AND aid sty OR
The OR and AND ave I asc me
Reprosontation
o—
teal
scheme For Bln Pres hv 9
«So sae for enero OF 3 addres co
fir oto tty
ni
‘eplceonemtempy
prem pane
“Eplacenemtenp
‘prattcae ONT ese
SPEC pe opp
Srrendtepice=v
Sprent pb? met 3p
Sppondtpce =).
Elie nenemp
sprees
ne incon append generates the three ates code and newton for
peo OP‘eee at
ion Etre and Efake sre the
rvs the inden. gg
i "
8 asccted,
an eat and generate nt ty i
pe suis te ant fa ag ae Te gating sien
yer ay 5
. Ene
At an coe -—..
ose? co ae
es fea gree
ro te! seas
>——
OT nen ‘Scan
eo
See] Sa
[Saari
Stet) woe
Eau te
Eonte [i
Etise
ene:| Syode
2o8biga
bie
sco
fig 81
: eat son
s tru = nev bel)
ump on aif then
ve ve wg HR COSC Gg AS pe
pesiae si Mp iit” THE AND fs igh : Snet
es net a pe aNd rote ae hh in tet = Saat {
— on re Scode = Ecode] gencatue') Sycode
statements jet doe tsi tee | wet ete Be ings Te a
sw font red coe Be tl agi ps tad sc
census e HL CTI st SHE ‘The Sod isthe important re whidh iia generates the toe
teas a AE ant wiledaThe ganmar ig gt Ss ok
ate hie stamens a thn aa ee a7
sake ben§, Tae cme
WE bang eS
| le 5
ie pg ais =
ene esi ti ew i te
Mx,sal 3s coef he fg
(2904) ie
Scode := Ecode| gen.code(Etrue yp a: so
Sycode |) gen.codego, Sent] at
encode (Ells “| Syeode we
7
ga wtie E408, Sbegin = new abel) yo: 8 i
true 2= new label) sop + Had goto 16
Efe = Set ys: goo
Synot = Shen heey
Sade = encode )| cde aor
encod’ Soe ge coe he
a) rh
w:
(EEEDEED) enti ie tes a are)
fil (0)
t ms 2h
Be ut: Sop
ie
|
100, Leif eld goo 2
501. goto Let
ik Lea
1 sit
104, goto Ld
105, Lae
Tech PATA te had
Solution The three addres code can be generated as follows
AAD:
ga he flowing il sttenenohie A'S B end A G0
‘Cons he pase re forthe bce sen eet
in rt the interme cde for oe ste,
EOC BLE phy
BSeects Eee
WA CC then goto 102
EBS D then goto 10
ter
co ere ins oe fore len presto fxg
SI cmt)
panties C= Cot
a |pin or Fst.
eee ox ecee sae
Sao oo
eee
etree res cole fr,
weer) fo flloving Csetement
|
|
| eat"
| eat |] go.08 (591 See
| ruse se’: 911 al sree
Sma
arene ae of ew I oe i
cod
& fei
; tice 10 goto Loop |
quedo i slit Be fl m
cm | = lowing C fragment into three adiress code.
a } | ivanor td
= if no
os U stie 10
ie C<9) jqis
seas Th be cs coe ode:
oe Es
1
"FONG ARLEN Anger
za eeer
3 2 ary 118 Fw male fon Las
=e con baba) = hh
SR,
Ye ete norte cole for the faeing
se rtd lion scene atest og wh he
Ss mie ftw tet ere
renee 10 ce
~ rae ws
eo
tu =
uses:
ca. oe
aie ea ein
re 1 cada 1
(EERSTE ye tet ii fe fri se
Se tn coe ky | ES
rec TSR fe i i wf oi
eg [oid be rkalad greener et
1
megs too ne a
poCanetti
z - eon
rook
_$
ee ost ea ae
J, met a oe cant
ares
sss oo
a a pel
; pa aiees
sent wn nen oe eet eee
Se emt eee
———— eee
a emt oh
Ee mst 2
ft? akin ——————
= he a a a aren
geld git(a > ®) a
ee if
| ee, ee
| ida mete
eset oe
as i
y f os
eosits te fing oe geet Geena ME ee abies
a
rnductlon ealo
so call)
va inacewte quer |
he vais parameters of the pcre
ie
tent Rae Tootvo ane poo fe ven “5
2 FA SO a ET cma 2 sine POET 10 the yy
+ ha pe ar te wae of me
Se ene termes SE
Seed teen
Po Ca plas
ince oes semen jon aoe a
: cations and cal te ste cae nt
tea ee
i Se 7
=m ee
oases 2 i a letns Cea ee ree ;
ene tor gen npr the intent coe el Be ! eee eeeeanaarai
ome
rete on proturs ile REDRenRR ccm
fe ing STO for 8 ime rire al stn. $e eas
CoE
he grammar shee opel soe
: = -
[BET backpatohing
=
(CERES er shee ce sateen rte tng Sree ag a
ay
(ont wre deo retton shee) j
Seete
ae eR ELE I
Sa SEM TAY
Lae ee eee eed
Fete rte anomca Se
Se eae —
eS Siescs
a
Sy
may
Eemee
SAPO Toate ene
Fer etn
peepee (py) Se Renee Senet ew BA PR By
Ernie ie
reese
Ei mee iL
Es Fmt
Srp eine wo
ie ; sree
pew rocwcrnal Mi iveranl as 2 marker nosteeminal The purpose oy
= rans ation & picked up i
alcence
pe emasnang pret epee Hess nea SE Wl ReTg prow of Control Statements
Secapateine wh
ao
Mr iceman S
Sr cemensete
Sane ten do §
a tess bent
_gsands for statement
tor Boolean expression
nde for stement Het
‘Rds for acsgreent 23
ee Inertia Co,
‘pc hand sing BOEKPSIENING techy
Se
vorerminals to determine the exact point of
ue the a ee Ser nonterminals
ve vil ino “sth mae Po
wee Gar pace, Hence the
Seo estomes
fo 7 HE then MSL
Br HE then My 5 N else MS:
65 > wile ME then do MS
sor begin Lend
Bon
Lo tes
{Meher
£ Sent =
| - __ Pet meet
| een Ma BEM coe
eek Soe
ae
"Reepa eaany
Se
(ag te ween
beg, Sepenaane3
ac) of
eT ene ep te it
+ Be stdin pois tome nese eect
wan PF Te ow of ol
ss S00 uv rasa
eeeeerie
"Bete mac naa,
SUS
“\kpach hi ama
Peery =
Eni sian)
Shen's merge anes
Pe =a
IN eae SSS a
, = oak
Mena
co a
Media Gres, Mesto,
egrets eae Ae re tig > || =e
anya at
\
BUM \
ject
may
Like dorsal
wsies
a La le and deri the pre efor he gion cade
(Nines = mie peng
—— sree wa
ee aba code form ofan intrmedite code) wil Be a given tgSN Eee eer
etapa 2S HOTA IO a —
ries mus
2 i
4 wa ai =
| | Wa re \ |
sowsdiny FH Ete (t) Aya 10, 1 HU hg asin) te
feat (Ue) =<
'
t \ ¢ ao
vey | wl :
ote (18) St (4) \
vy
wenty
ney
waa
at 14) Ma (18)
Sra)
Spoate (ie)
Wi /7ia sts
Erie (18)
i (8
wo
yay?