Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
94 views
34 pages
CD Notes
Uploaded by
srinujodu1431
AI-enhanced title
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
Download
Save
Save CD NOTES For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
94 views
34 pages
CD Notes
Uploaded by
srinujodu1431
AI-enhanced title
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
Go to previous items
Go to next items
Download
Save
Save CD NOTES For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save CD NOTES For Later
You are on page 1
/ 34
Search
Fullscreen
oar gfcompiler is a taavitlatoy voli converts cow AAS SON under santa ole language - Ce Ot. ighy waclane [pox will —9 [computer > Assert Ward Songusgee “eye Sonace ode — >[ compiler a > machine undiastandalds. Jamquoge (saa get cost) (uueqa level dewxguege) attespacter Rakes LL reads Vine by Line ound Convent Ins wmachine code and exccitles immediatly» Assembler taes assembly level Language ard convert ite wncline, code . Triesprein4 language Jowsuoges which vises Compilers “ram = ~phe . ot ; — Raley #lAocoludte_Code ~ WE nerd to toad Code (vile adeioress
Lexical Awaliyes (piste ~ Synalar Avaliytis / Analisis plane Passe fre Symbol -}— Semantic Aialyns me dee IN. Tmmediate Code Gewese ion Jp syrtee pve “Code option” sable Manager Lexical + Lexical avalyzer does lexical analysts “5 . + du his pias tae fexical avalos mreads “the character cw the Source pam and qn them who a sheam of -+okeus. Tbkos ase Seqpomee of Chimractas lowing couective meaning The Character Sequence fowws ing rekon is called lexemne. 4S) blank paces wilt, Ge elimindled. +Tn lexical analy: Syatax Avals Avalysic! [Seam of -tokens] — Syrttax: eae 5 —f Parse Tree] ge Pee fs qe ps the tokene of Cource m into te we “ axe used by the compiles -to qonesoce ae a « This_is represevted by @ Se hee, also ties “3 un as Syntax tee._|ids tht the td id id — > th povicled tokens and yietd af patce sree ate garne then Soprctr Ce voon'+ pease d exrcis Semantic, gis “looks fa si aS b veaiges 1E Pase + Seynaystic Analyt. Ene ee -Undeclaxed vacinbles ~ Misuse vf whesied voords = Multiple declasation of youinble of & single Stope ~Aecessing § out of Stope vasinble. — Mismmoxch loa asomwlecs etc. *Semausic Aralysic performs type checking twat Us, it crecks etch Se has operands “that ase pesmited by sore, larg.. seein fat a [is] > Gow ieee E secehile pl brleges, ‘as size zh 2 atnay ~ asec onee genera (ton Seteymrediate Cole Semantically Outoumrodialt Asif ted ce pee (ode Oulermediate ; Cocke ~ Generale? Pr ids idtide id or ve (bec resevtlatiovd of Coyato. Code should lee casyt, to Yrarstate TL0 the “Lacget preyam. fast | level — Twter mediate Fen Produce and ease r “Always starts pom “(he ho toc be CS Reodpe att 5 Bo eels Code Optimizer | “CO is an optioval . phase “at op tinizes the iwhleemaciale tocle [eee |— Code. Optimization — Optimize Code aye bre; ___+ opted v a a 4,
(0-4) 0,2,4 —> Lexemes a Shot a lexeme ~ Lexical a aw is irnpurnea by DFA ~ Phaser © tmpbmented by Ppa = Lexical analysis pra neu exCommet tines oud while SPaces7 pearl eh] ven pesslelt ta" fra 0) 4) Uf S toleent Wy ches an enby sy DT Ht reads any tdinrigions then Ore able and Stes info aloout it upto that r tO), Siva] Name] type| oat int ss => 202504 0? = of anything tat doesn'é woctch with species mules /patteans, od 2 ) k owt Carvesporcing enty is raised tn LA prox tex [eLex (fastest vession of LEX) > Softuinnes “x. Q—eatension Leete name TA lex program is cepasdiled Unto a sections by 1 t delimiters ‘The format ° lex Sure is : Ue Subrutines / Auxilicei urchicle declarations Of com stant, Vasiobl dr, A requsos. dedinitio efit the Stat a . define Bre Steigraen Bf form P faction 14 PAaction sy techs 5 sunentins ae alee praens Matas by “the actions cuinmantine can be loaded “wilt the Lixicat analiper asd ; compiled stprsately « 2 De vot use Comment Lines tn rules section, peal heat Can berwsed in DS & Uss ner, we need +o explicitly -Tn Guinot invoke LA pre mainc) 4 yylex O05 Jivwking LO plat a yy vovep| uy coe on mes Ue coved as, Shings in gyre “By Defautt, xe LA Findude
Ly Lt fo-J A get (WES 1S - Pease tmoind? aA. digit th yy ext) 3 ‘ yylexQ* 4 ash an [ten] see y* UP ofpcm bapey ~these 16 any Up in. buties ov fin den we can use f, ay on) “LA please alwoarys reads ip a * YrjevoapC ) — indicates whrellaer +T rye don't want to Use yyurae © at he wp 4 she Up SD wn king wilh multiple Pe — Hierarchy is impostaut tar Lf. {o-4) 4 pont (as, te aiget " yigtest)) } (0-4) +4 pe (Mhs i rumnber"s yy extyiy At omotv digit to — to is number Lh (o-aJ+ A pratt hs is a number", yytert)i J (0-4) A pratt (wigs Is a digit" yytext) i ys ht 070 number //wron AW So, {o -4| shoud be wiilbn fost & -+yen (o-4)+ “ie (a-2 A-2) (0 fA-2 o- J # {pr Ciaantigen); 4 ant” | “float A prt ("keyword"); Lh pith Crepoott)s int 3 tdontirfier Aru jain we Ove as i : r qi aes ee gel identifies as olp (owen if it ic Eeapove "wt" ["-fCoe " firct [a BA-7] (a-3A- 20. AJ r neve “yyen © ~ etUENS length Of, Lxemne f yyen — entoe file as Up gyin -fapen (hare 4a"), 7 Pangea to Count wo, Y Words tA tut we <0; “4 bl. (a-zA-2]* Awerty § “\o" A print (hd we)34 ro ; yylex CD poy tb count wo. of Lichegers avd real numbers & pretty count int C0,7205 To Read me Character, tf Ly Wwe write It divectty Hen a it eats tt as meta [e “at Ait \ Character, (0-4) * Sopwe [o-a] + \+ fod Aret’s vited ty use "Yn" A prints (eld td L.0)7Y Wh mainc) iM quven txt :a etal Assi Uiquovs o7 vot > 5 clot am vy : Given cre for RC OM, MN? ) so Ale pie n 200 |F Si O51 [£ > vole 6 S 1 S2]£ canton Yaie cre for RE Qe)? . { SS So i 5, 00S, }é KR 3 : o S$, 18, |£ ny FJ Equak vio. of a's & b's, qolindanme i S—a5b | Sa |gsl_ |s-sasalosblale A ; I 4) Derive o0001t by using ! following Cra / Not / ambiquotes 0 oe Ay b) ssosilss] é A 2008 |e fy ie aa A\ ot s $ pores mye ZL\ /\ S$ ep EP. JAB & es } A : ALB 4 a ALIB ! — 00hité nian, — 0oocoR ll — 0000EI >) 5-9 Sb5|a — = covet! 5 7 LOD: soap AN AN — ov Ab Av a iN — 0000AB Sos a is J} nga Av | — D000EB LA nt —7 000018 ia 5 ograg. Heals There exists a passing algo “to che ck Whether liters an ¢ . Uhous ass i comect @ not = _ lelafbI--) a Es Agi — ep Stack Fife Technique [Passing tab) Passing Techniques , Dnivesal ses — Con parce am 146% of Gaarnines — Dve to Daahiclency wot being wed “Fp Down poses — as Limp ‘ -|Brttom ery —— RIMD im vowerse over 0 Ope TE ae J [ip pon tas) «= ee" GE) Cu) | predictive pass 4 ears Non-recusgive. top-down 2 fw Uses i y yecurtive calls. poang oi LUCE) [Predictive passers *FinstC) & follows) baa “used tn Conscbuction of passing Fechnigues. "Rules fox first CO ) BH Aa ben “fast (A) = jay ) Ne tne fire (ne 165. 2) 24 AaYMe, first (a) © FistQn) -if Ye Hen first (Ye) Lid disst(a) = Fist Cv) U eivst (2): ——#4 te i should not be ; mea apply dag passting -Jechiniqu« grams Ou in he {1 Recu gion. * Sana A sb|vCe [Daa C Sabb|d Dada SD is welets.as D vot deniving Heaminaly Airectty [iwelivecat, No null productions > No onit, productions [Nt NI] 7 l MO? = Rett Recuasion + heft ae «lp: AA “lp . A A “ete voy IN Al _»s Ale Ay a Nee “al PB oF /\ p yYfCr erat i a To T¥eFle F id Je p PEAT DLR. . - feb) Kigud_ Recursion €'— +Te'|e Aa alps A E T>T¥ele 4 A aoa voN LN T> FF! (Fr) p< A A Tren |e ! Ls Wen CFG, €—>Te! re p 1 >Fr i “= +Te'/e Toe [es Fo idis; eoTe pi +e lé tort! qo set le —_ id (Ce) cont (6) < Fnst U) Fostl)= (LG cast (e)= Ate) gost(t')= 4085. js aaAld po cdlef fast (5) = haya fiost (A)= heed §) sa nce|Cbb| Ga A= da| 8c 6 79/€ co hile Fists) first (A) vost V firse(8) : = {gyAvesnyu Aheel viaead = hayb,argshty Fost(a) = 4.4.4, net Fist(py 2 4q,€4 Fist (c) 2 Ah é4 h) Sane, A cle Bdle Fist(s) = hal Fist (A)< fo £4 Fisst (8) ae} 5) S> Aabh| Boea ATE Boe Fist (= sarevieod 2 fonb,e4 FOE “First tn) = 484 Fist (B= AE4Riles for_fo \low for stacting symtoel a) A> KBB Follow (B) = Jost(p) JAS«B 1 POF fq « Saald Ascdles Follow (s) = Ag Follow (A) = 4 fi 2) S7AABb Ax Cc\e Bodle ale) = 44 lA) = fost) = {4b4 fle = Ao} follow (8) « -fotte (8) jaad f 3) snce|c b6|84 A—da|BC Be Cone Follow (5) < h $4 Follow(n)= Fist (B) = 4h, aft Follow (8) = fash qd 44 Felon) = fa,g, bh, a Y Fost(n= 44, 9, 68 First (8) = bqve4 Fost (ed: huey i {hits qsa, odypote i HOO Fics FILA) goat lé / AC idl qt Ft Ficer)= Aayey “ Tere | OV Greed pce) fid cota ale) = 44, v4 plt)= fice = A495 a(t)= {44 yi fo(F)= Fi (1): 4m, +, $, yy LAW | Predictive| action stack ce ete’ fk id sia Kid q . eT pid + 7 # wa vewiched, ple els+Te metehe st r— eT Froid tA matched. lore’ maiche oid TA matclr< 4 Yi se eles MACE, Success pelGO ACB|C be | Ba “joke A dal oc f (d+ A byt 4 * follews , “r(eys AQF oh ql PO fdig by 8 FAB cobs Weeds fag b £ay FA) hoa Fh | a bole | do} ree 4gab9) - SoBa\ SeChB |S be 6 | SOA a ph | SO ba . ‘F(0: 49, 4,64, + A | ada [ABC ABC . : 7 Boe : AT lex progam to find re, of Vowels and consonavdds ju the Gren Shing Cee peer Ae fing nv. of vines, pores ard chosactes inte inpet. cd Ftp aunt ne- of integnss , fie ating pont nos from eo inpek. ; o- 4+ \: : tr (sf out of atl word 1 Cungth Wee stoeting wt a. yylen x #10 pogo +o “find firt & follow 3 fla GF Grammer:— x] SOA SoA: j-abad A ~anfad (Le) Az in tt Bobet Aaa 5 abhl i { A + AD! 4 E oa aloartle Fis pf: Colles F(s)= 4a} e() A$ E(a) = fa} (A= APY F(A’) > £484 ecat) = Af e(8) = 46/4} | Ce) = Five (al) v Font (OD roe Ada F(c) = jdt 9} —_ Foxséng Talele i jo ie iy fF Tp s | saa A | Avaea' A) 4 -dal Alssé % B>bBe Bof CAction SA A ata) a matte S b> bBC bp natehod . BOF 4 modeled, cy¢ / S> AnAb | 66B4 EV est T ; AE ee | + 4 Boe T7374 ii Re cur stor | No left Recursion cett : : % \ First Follows, elo + TE le. €7Te P(s)= ha, of pis)= Ad Pests Flas heh — FLD = 4070) Toe F(e)= heh. Fle) = Lb) ginets Follows eT eceee= kar FCO =H} F(e)eAn2y FE oAfh PO 434 e(r)= {4 fi a b S |5-Aonb] s7ePbs stake fs abt Sanaa fora bf AE £bA q Beh a matthed Sek ; $b a __¥f fe f f | ; ceed ge me TT py AR sain ego 4 f succesegul \ a ae fete fof 1? tee ge a 4 Su coste with i Mode we ep ‘Ke coves — top yf a CA cearvert ase sapeet Set ea respective 7s ond CY cash Ay fe 4idf omamwate he 4 casen! fe 4 +idg Recovery Technique Panic Mode Steers watt ear nals sacle up fe fide vid ger Arr iad Lee ida idd fen triad Ss arbc[ar athlon 2h qe Fid tA irkedBott Up Passén uses RMD in severse onlet S—aabe A >Abc]b Boa =. abbcde A Ge Ss Sa ahbe /\ S safieede An Fi $7 ahpede { | S abbede- abbede =) Bettom Up Possess are alto Kuawn a Shift Reduce passers (2) poses: — a fous aLtions- Slift, Reduce, Acttpe, Reject + Binur bide pest (hardle Ss yeploced oy left side. eo) rR — lon be applied wen on Rew ve rrammagg. ARIs) items Aa NZ A? XYZ A2Xwee A OXYZ- (Complete [ina seduced jte9 — indicates row fat vere Seow + =. i , 2. RWS AS Clasise a Me i A7 G-Bb B33 item if 6B precech by non~ Tera) als Set vf Lies 7] — seymbel (any er bets J. ava. bb gots [2,8] : v Adfune- (A248 b) => A> aBbslack pudy aumbes, ade eect add 1 a ae nie ref d oS Peete ‘yl ~ s “Anguenc wt ye? La? * ae [sta] — stout lp ) e JL gos (a) g Sa joe 9 Lfoceag 96 HS 2 2| 2 x, : poc sf 2,L25 ; To] focety 7f se sfeafess|s[z5] 1) powsenn fer “(mia Figae _ . lelel tre) PS accept = ws 3 UY) we [TY |a’ Overtome S-R eonglitt, woe altace SLRC!) , $eraf eet Algatithen, fas » Eottaa (1) e hott . |_-__—- Reduce - Reduce Conf lick + i¢ aus oat ap $3 fons taf 2,0 foto._+a¢ Su $3 Ariat ged ee fore wite £ re" forrener £ ue sot fAE Osa Aanb (been Ee Az GAre (Pe $,Bbba- Azone u hans a 5 cr k ane (po €(a): fa64 F(8): 4b, a4 a5) = 4g4 “Reduce Reduce Conflict” Not SLR GrammarCLR ~ Gannonical CR lassen Le) or arti) YL CRO) 4 book ahend cles ysAAa AAAAs VA fe gonzaui he “donaannh vg fos __f accept a gone nSLR Vsnn- Daan JAIL CLR contacns move space thar ia SUR» LAL: Adentity URI) Hom fires le Heme ane samme bat lootatod Symbols axe differnt » Mezge such states - The main qt ic to Wduce the tthe size “of. CLR. fal Dag) omy eae Se ON menged, - CLR + mange Gtates = LALR - No Specigic DFA -@o use aR’ » CLR i most t wh echuique but ane cto its inepprcrer] we 9° weth LALR. wee LALR ' Perea grams is CER but nel Vice ‘ versaRecursive decent coves eTop down pacser + GreeUmMan fliula be free fom lof (ae cur, itn for EVEN Wlon- Letninal , cle fine pec dures. 1k t SAA gobne a 3) 52 BFE“D4 ciune one conppiets, MMe CLE elie can mse LA LR (aptimiael versie of tae)
You might also like
Lex and YACC: Compiler Basics
PDF
No ratings yet
Lex and YACC: Compiler Basics
28 pages
ACD
PDF
No ratings yet
ACD
68 pages
Tranlsation Software
PDF
No ratings yet
Tranlsation Software
15 pages
Unit 1st Compiler Desigen
PDF
No ratings yet
Unit 1st Compiler Desigen
32 pages
CD Unit 1
PDF
No ratings yet
CD Unit 1
24 pages
Compiler End Sem
PDF
No ratings yet
Compiler End Sem
8 pages
Predictive Parser
PDF
No ratings yet
Predictive Parser
17 pages
Tafl Unit3
PDF
No ratings yet
Tafl Unit3
51 pages
Compiler Design Unit 1 and Unit 2 According To Jntuh Syllabus
PDF
No ratings yet
Compiler Design Unit 1 and Unit 2 According To Jntuh Syllabus
47 pages
Compil 12
PDF
No ratings yet
Compil 12
52 pages
ACD 2nd Unit
PDF
No ratings yet
ACD 2nd Unit
33 pages
C++ Revisions Tour
PDF
No ratings yet
C++ Revisions Tour
23 pages
Semester 7 - CD Imp Notes
PDF
No ratings yet
Semester 7 - CD Imp Notes
31 pages
ACD 1st Unit Notes
PDF
No ratings yet
ACD 1st Unit Notes
54 pages
Compiler Design (Ankit Kumar)
PDF
No ratings yet
Compiler Design (Ankit Kumar)
44 pages
Dashrath Nandan TOC (Unit2) Notes-1
PDF
No ratings yet
Dashrath Nandan TOC (Unit2) Notes-1
22 pages
204-5 Unit-1
PDF
No ratings yet
204-5 Unit-1
24 pages
Toc Module 1
PDF
No ratings yet
Toc Module 1
51 pages
TOC Midsem
PDF
No ratings yet
TOC Midsem
52 pages
SPCC Assi 2
PDF
No ratings yet
SPCC Assi 2
25 pages
TAFL-Unit 1
PDF
No ratings yet
TAFL-Unit 1
46 pages
Notes 250112 173439
PDF
No ratings yet
Notes 250112 173439
29 pages
Compiler Phases and Lexical Analysis
PDF
No ratings yet
Compiler Phases and Lexical Analysis
36 pages
Unit1 CD
PDF
No ratings yet
Unit1 CD
25 pages
Shahas TCS Paper
PDF
No ratings yet
Shahas TCS Paper
34 pages
Atcd Tut-2 Answers
PDF
No ratings yet
Atcd Tut-2 Answers
21 pages
System Software 1
PDF
No ratings yet
System Software 1
31 pages
CD Unit - 2 Part 1
PDF
No ratings yet
CD Unit - 2 Part 1
22 pages
TC Mod1
PDF
No ratings yet
TC Mod1
30 pages
NLP Module2
PDF
No ratings yet
NLP Module2
40 pages
TOaa
PDF
No ratings yet
TOaa
18 pages
18CS752-Python 4
PDF
No ratings yet
18CS752-Python 4
16 pages
Chapter 2 Python Fundamentals
PDF
No ratings yet
Chapter 2 Python Fundamentals
33 pages
Aad Mod 5 S
PDF
No ratings yet
Aad Mod 5 S
39 pages
Flat Unit-1
PDF
No ratings yet
Flat Unit-1
59 pages
Assignment 2 Neat
PDF
No ratings yet
Assignment 2 Neat
31 pages
ATCD Notes
PDF
No ratings yet
ATCD Notes
29 pages
CD Unit - 1 Part 1 - Merged
PDF
No ratings yet
CD Unit - 1 Part 1 - Merged
33 pages
C Notes
PDF
No ratings yet
C Notes
44 pages
TOC B Section Notes
PDF
No ratings yet
TOC B Section Notes
50 pages
TOC Module 1
PDF
No ratings yet
TOC Module 1
36 pages
Compiler Design Assignment01
PDF
No ratings yet
Compiler Design Assignment01
12 pages
CD Assignment
PDF
No ratings yet
CD Assignment
13 pages
XI-C.S (Chapter 6,7,8,9 (Part-1) )
PDF
No ratings yet
XI-C.S (Chapter 6,7,8,9 (Part-1) )
18 pages
TOC Notes
PDF
No ratings yet
TOC Notes
63 pages
TOC Notes by Ajay Sir (1) Compressed
PDF
No ratings yet
TOC Notes by Ajay Sir (1) Compressed
48 pages
Toc Insem Model Answer 2019
PDF
No ratings yet
Toc Insem Model Answer 2019
14 pages
Unit 1.1
PDF
No ratings yet
Unit 1.1
64 pages
A Brief J Reference
PDF
No ratings yet
A Brief J Reference
32 pages
SS Assignment 2-1
PDF
No ratings yet
SS Assignment 2-1
18 pages
CD Notes Unit-1
PDF
No ratings yet
CD Notes Unit-1
26 pages
Adobe Scan 04-Feb-2024
PDF
No ratings yet
Adobe Scan 04-Feb-2024
20 pages
Tafl Unit 1 Notes
PDF
No ratings yet
Tafl Unit 1 Notes
44 pages
Ashish TAFL
PDF
No ratings yet
Ashish TAFL
22 pages
C Assignment-1 - Compressed
PDF
No ratings yet
C Assignment-1 - Compressed
18 pages
Practical No.1 21 March 2021 PDF
PDF
No ratings yet
Practical No.1 21 March 2021 PDF
6 pages
Assignment 03
PDF
No ratings yet
Assignment 03
11 pages
Ay20-21 Cse Sem1 Labs Remedials Regisrations
PDF
No ratings yet
Ay20-21 Cse Sem1 Labs Remedials Regisrations
4 pages
Virtual Memory Management
PDF
No ratings yet
Virtual Memory Management
33 pages
Overview of Operating Systems
PDF
No ratings yet
Overview of Operating Systems
28 pages
Understanding Deadlocks in Operating Systems
PDF
No ratings yet
Understanding Deadlocks in Operating Systems
24 pages
Intro to Recurrent Neural Networks
PDF
No ratings yet
Intro to Recurrent Neural Networks
79 pages
Process Synchronization Guide
PDF
No ratings yet
Process Synchronization Guide
39 pages