0% found this document useful (0 votes)
21 views29 pages

SPCC basic

The document discusses the phases of a compiler, including the analysis phase, which involves semantic analysis and error checking. It outlines how source code is transformed into an equivalent target language and the importance of optimizing code for efficient execution. Additionally, it touches on the structure of programs and the role of tokens in parsing and processing code.
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
21 views29 pages

SPCC basic

The document discusses the phases of a compiler, including the analysis phase, which involves semantic analysis and error checking. It outlines how source code is transformed into an equivalent target language and the importance of optimizing code for efficient execution. Additionally, it touches on the structure of programs and the role of tokens in parsing and processing code.
Copyright
© © All Rights Reserved
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/ 29
a _Bacam ge Login tb iz bank $m rE 0. | Looptbbb c ti | bbbs bbbb: re “a _| paral be b e & | patas bbs tat 1@ mar Coane DaFinis ior: Tabled Tk the opt: is 0: table of text ii 7 ine of each mocre definition othe macro tine: is: stored in w= The: (MeNnD is ktprs to indicate _ief difinition: and phe smacre is retained to» Facilitere -t< sen eee ea eee These: a ws { -Exemple : TIN Mome hdex JER beD| 16 ass of 2 poss: Macro processor - Chace we —inpub text line itt sage! macre optode go to epee 4 a Lor go coe oo ae __ -Save_enhize “don definition oith Nome and Mend nip. _ ae ae - MNAPLE aiso_enttr_in the. MNT. _alonc 4 _ with pointer te the First \ocatfen oF Po bmot — entog ae ee pitas = Continue a ere. 1S Saved .1F PEND pseudo ous 1 _Ane prs 06S S BE Sp ae ea i Further. aaa — Repeat all steps in case_of nested - “me L215 ss ce te tl Aine — han _ Sen tion than contr Aer soving- Fi “hansfer “be poss #2 Ea i ing _p& thas ay ales ipl — \ RS» EARs 4 DATA) Modulé 5 Compilers . Analysis Phase Moa 8 pe] compiler. 5 jee i alias Rie, ee 4-8 compiler sigca. spragram thakumtadsS any _—-Seurce = pregram__t.e high-level: tanguog& ond branslates: St inte an equivilens.. program | | Or a target langua Low level. meas i Her before owing bo phi tint __—- phase__of compiler i+ _rcmowes: the reader [ter Rote oF and “pro: . - fae ae ‘banks paces — = of sen athe ph char e.5 oS out the. user 5 e¥ictabs new bint arach “bianks..prom the progam | axetbeen 4 tower Care_of bane j Ca exer msg ra om. “orp hala with. the stance. aaa oM ® nia — - r consayvuctto n SS ern input and : yse tee oS output Og F ntatic structure of program 1 a aly ‘ahd__also checks for +he errors: gL - Tic invelves the sgrouping® of Sorc | roy” Joken inte grammutica | Si Per aye_used by the compller ig’ __seagynthesigcthe outputs ran forays ee Ha ISO. tE1ms as en nets i § @ @ Semantic =. Analysis: h ear Waa errors gn’ gathers pe of information and uses ti nlerarchico Struct determine by preview, operators and the Pha bo 8 (Le perands. = expessions & "statements: 4 SerMantic_om-, — = 4 i go that ‘each: ope rats hs, iT ello bg the Source. th anquag Specification. ] Hi! n- 'othey YordS - Hhises Phase Ladds._met> Ning. tei VdrlouS: +ektns..» (dent jens. €4P (Si yo ¢ we Sr Io ye? twat .1@ snermectate code? generate cos tin ths manuicompiiier!-aen O evel 6% machine repre sentotion: «+ Moe > — orn, ba 4 h UPL STS ens apa 3 i basses “this type of 1epreseniation. Showlol. have “c2) Amporton p= properties .1tSheuld be pp easy..te produce —and_eusy.be4amsiad< esl inte. -target. machine. Code Set ah Code. oprimizotten 4 t—+ _ = this phase attempts +e _tmpreve the | _intermediate code Sa thot sei unaing ssl ymachine.ccod-€. tail 26 sub + [ ersolthreitgosicnidad cotcthis pinidatis test pag she execution. -eFticleng 6&.+he preg2m ee Wer=toret code opbiig Sab see Les Shithe® Fina cee ‘ a Lg generation — P do 79h Code consist n of reliable machine cole or Reeeeolls cee spremary.tecotions aac iseiected fer cach. ep the varieble used _by_ the Pega te avetd the Terlundent-gndethe Cade (Tgemrerabor _Thust-—_ketp-thé ae £_ reg f— I Jere _conains ab thé oun time © @ Seperator x - These +okcn§ are used te Sepersier taro i 4p07dS ,. twoe. Sentences or two phase s. }-for eg.» 1g) Rae aes ~__@ operter — cE ees sk . __|-Pll 4ypes of operaters like + 1—4%-1*, | 1 240 o7¢ operator tokrn gs. re tc _choveckegs bet a s - charocters Jike~$ 4 are the Specia) ae Sibchereckers. “ se Pele _of Finite State outomota in Leatco} ae -anolysis_ b: ee: = there ore set _of siting in the input for _____ which the same _+teken_iS produced as out - 16 Semantic Anay2ze%— ie -———— asdy | -stey t3 / \oo [€6 =-t4 4+ tda jr Be Ate ae S id a one : © code op¥imization = toe F ‘ s> ag t Pt aoa. { Printf (3) se 65 bef printh (4) 3 fe Plodule 6 a 14 26 =| etasbie (etd) i: ti -a+rb baie = ORO diana 274/55 LR(o) @, 35 AcBb 1 BbBa sige aah . AM ODA - A 7 wee = ttn “ an aoe s . WE contain v a aS, ERS pacer aS “one_ceil eas ee ee on. ine D ee ae : pe ie varioble - rates % ee 15 "7 S A oy w —— ae ay a Sony to se [SF _ | Sales 7 at Pougt acde PKB E ra ial Se att t er sq ua 3 fy goal SSS ra 6 4 ‘ aes Te hore fe 4 | seem sme re ee 2a Pe Se | 5 |: to HD sa AaBlgna | : 7 LA oblc ' ‘ a ; (eee goa ominugS + * + ye By

You might also like