0% found this document useful (0 votes)
20 views10 pages

1st Unit PPL Notes

The document discusses the syntax and semantics of programming languages, focusing on the structure and rules that govern the formation of statements and expressions. It emphasizes the importance of understanding syntax for parsing and generating valid code, as well as the relationship between syntax and semantics in programming languages. Additionally, it touches on concepts such as tokens, lexemes, and context-free grammars.
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)
20 views10 pages

1st Unit PPL Notes

The document discusses the syntax and semantics of programming languages, focusing on the structure and rules that govern the formation of statements and expressions. It emphasizes the importance of understanding syntax for parsing and generating valid code, as well as the relationship between syntax and semantics in programming languages. Additionally, it touches on concepts such as tokens, lexemes, and context-free grammars.
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/ 10
ut L a peseribing Syertax .- A Iorgaoy ewhetbun natural g of Chavaciers from Some alpra bet. or ortfr'cal, 180 set of String qe strings of a brguge th called gentences of _Statems _Stetems she Syntox rules of buquage apecity cohich string? of characters fyom the ages alphatoet are. in the bygu hoxemas'can be qrven bun ieee w usar Separate from the synters he descriptron of spectFrcasron, cohtah descripron of dhe Jooguog. Da the toxemas of & Pym bong uage include Hts! numencat Lrrera ls, operators and speua Words, : oovonled texempa eave® inte” groups — e4, names of wartables, methods, Cloyes tn the = gtouP of pgm banguoge called deniers. each Jeneme grour 1% so, a token thot tan have Jexem@as ° os Sum ood ota - : { ble ~xpdqye, od'y > Ap. Some cau, A~ Weer easton! Ayea9 fopresenied by name. of token. > + stance s such dinme~ Sota dish 4 2G, tne token for Hue aja operator yb bol + thle xeme. 9 has just one poas! > enemas te the bwest level syntarcke unt of & buqvan-e ) ipdev = 2 # count * I+; oe i rode: ane . Auzems G| token's of tw & —— = . ‘nde. fidenn bier * equolesigh? yo aral otc 7 ink bderm Describing “sy to stp pe foro oY gatements one progvar units - { 2 ger} txebCrms el wh { EywMieass Boon fe en ge WNBWNIN BCS D Ecos om Se cu “HUIS qONW| tap G — Bore eos by. eben nayses TE lon serge ete RX __ L eta Hformat methods of describing semanwes : opertonal, Daca ona Denotat'ovet Semovrt'CS -) + Sgman tes ;- sthe meaning of the exp ressrons, Statens, — one podgram —unr'ts | —> Jn a well ~ designed PL, Semantics Should Solow cliecty from Syntan. > peseribing Syntax 1b easter than dlesertloing Seromheg Oe AN rt Statement. IO. oO Ja ngueg Es = if expr) - formal appovaches + Describe Syntax! _uwe nw" nwa WO aren = p - . , th of tompolery a] RE Cogn Igers, used 170 Syna% analyse Pe. oie Isa Joreyeay L thet ys alphabet S oF, chara ther 5 cognrkon duwrtey 2 Bich 1s capably >) we Cnstua oa re i of “Blea Cncbbsy = Snpusing settings of chars “Prot hers alpha a ha al inpub StVI0g 18 “in L’ OPYint Val > Spditating whethen a given Generators'- p Janguage i L eneratoY CORSE 8 leguage generar +40 gens the sentences of ~ \ > more reodablea ad understondable’ ee & Cognigens > larg, secogniter® are not usebub is 2 byquage aluserf™ gre cont” ae de Nan Backus Maur Foi ond Gn-tort - Free Grea ammar& are format brg ‘aston Ntsm ) qr Oy. i uDe gener ‘ mecha S Commenty UWA AD doer AQ & Pi ( erth @ “4 AAA, O is de t& a nokostton Aecancgus ton 1 Gort epee grammuaCeF 61) ) ths 18 ened tor speutying phe syoton of the begua 9 expeersid a Some! daymbol7 = exp tfexe2|--- = Y~ G& sequont® of qd am be l Wa non- terminal ibe gyro lA g-paBh JOTHA TA the Reprasentat en i ste a Carnibirasion OF 67 vel é] oF tee grommet rand HI : s ‘ lon Reprecentaxcon cated 0 bot terrateas a VO" BALE Notatey » p—alb > Ruby of BNF . - ; . sepin the 8h ) thar tre optroved Syrobola ase worrwen 17 within 7 —bvack ett? ) that Repenterg “He gym bol” for © oY mow Hime is at s tab ; , dy attecst ore or ) iF we wand ao pet athe symbol o a sini encoun te mow ime + (ab)t, de mem ne IY “4 no. Of fm excluding o, by waste bast . 4) the alterrasive Puls we geporase a bes y enclo ped weitn vp the brad S) the qr of Hem poust be Context Free Grammey'~ la See sain 8 > (uy, 1/Ps) 2 we @nnot Represent ant forges. g auiometa - / 7 vat we ™ menor 19 Crate Gr dob ~ se PEVouLe byg oa Pl 5 AMM. Sip S09 Gra A ork} iy sSadagess” why ony 7 ‘ OASibe + rinde automata ours] ie nok PRR os ext free qramens ° Fe as set OF Frntte uariohluelv1 TP) L Cre). pepresenrest we ome ge Cnt DT afte Set oF terminals (v ate ¢) A vaviable @n'e be a qermivel @y @ terminal n't be -- \oouble . — DP SD production Rul Csurgeerusen Rulad > S$ > srt veouable- aA wher ave the apriat dders ore by ty? east heel t ae ermivals , wt ¥ . . oF au Te wayne 8 biguge = Jo Han tune are rey YP DS panes age exah i 4 ett. > Zentex Free brgucge ” vateg Contes Aiea, gramme, " . i q S—> 08) - 1S producto pute variable "& Starteig vordl j S—> £ Cepston) > vis} — Y M—6 Dea A T= fo hEY / ; — f > giver produc ful, J\ i ve + $2 3 JN oY -> ae o ‘ \ 4 i ui S é EN 7 25 90117 Son ptt oii 2 os 20k i net 3 or? |? ‘ 2 Dow | > paeduct’on breguge den0le> 2 0°) 1° 4 na08 wine 13) 1 7 Sony an hne S 5 8 soa! 8 S359 by 4 y > 120 tm ‘gicah be ouachtrg ‘2, ror wil be a pastel 2 Convertion of CEL to CFG LID we are going to genant + sae ponduchivo Res. no =) ‘ a? b® ; nz0 ah bo > £ oN Uy cab 2 rm? gro aabb oe ABVmpl aid Isssyocal poB Aw Doaaablol GENSED Ae ) no. oP Hales must) be’ pies ese ge of ‘s ‘4, > a =Biltouied by, | ‘ aaa éyles mi ba, bbaa vol allowed iP tlh! at jow Fo Construct pachoney F ; DA>E —O Hbvesiih (hq SA Ad &babd-O, liam oT wkilinalyndin tu AD abble L mY y nz) are rua ps0 2 (A) we Cnt gue “ied eplen . > A+draanb , a —->aeb Snsiecad of A we ae Sub Sewing £ A 249b. > gh ner 7 020 : oe sD @ +t we need’ to add in termes al get? = a brs bb nat al blt®, gt p32 'abbb + nor arb’ 2 aabbbb Pp soast/s ss ata one of agh- Rey apmOnsd be mF I ¢ 2 38h on OPSIONY _- leeizos Arey es” ow 2o gum Farb ~ “Td te'o Aoleer? v TOKEN : | dw y 4 : a Lrke. 13, data, Wort) ' ‘ syenbot we | _» “BH kurcad anavli— oemoves att white s 29941 entorportes erry c0r'4b 16 line number. “—O) the main fancten ib 4o Read the HP cod poodice We Pa parser wee tor syntod j Onilyst i: 5 she @mmand nam el ‘ger | ste Moutar arayser to cteod the il te Con aeeabetity identity the nett token (© Ht abe performs the wer foterfare 4ask's, 2 the +p phays of MY Oe Aiden, a Sequence of 4okend thot the new 4oken” is wed By p ChotactevS antl te Scannivg (simple Tose) 2. Jexttat Prelys'§ (orp. Tosk) TREEPS potiems and lexemes. : O Toker epresent O logecatiy Cohesive Sepuence * Cheracte Btu seh oF suing iA deseribed by a tale called. pater wZoudted wit, the token. 3 -the chanacier tequnce brining 2 -0KEN TA cued bexemu fy he tokoro © tokens ane keywords, operatéers , rdenwherds, Cong pants ond punctuasrons - © pautcern iK a yule desevib ing dan Peprewvt © peritioubn token io Su Progeny , O hixeme reached by mh pate bre tok Repeal a 1 ee Sw sot of Jexeme Hoes Lexeme | patie rn yen ny, \ROV er Or Swe lor > Qy>-0 elds O:2 fry Const eet rf pnd 4 id fi Lot Jy leurs gq S ) faysing Recursrve oecout peotsee (POP) Are meted hich te wed do findout we moi Thus Byte wip of oe z sHirg wm fymed oF not Lon => [a 2 Pee aoe) 5-5 ald] & Ph &bePaga aad a- bele - Cc ale nor SteP ) an veoN a aba ‘ b CE hess \ t decout Pore . ilp peY whieh does, NOt pros! foppen lock Avol?: -) BACK TRAK |. G4 ba te ‘lp py | oa a M 4 ile: does nok praetln beckon cks Vo) Te vo boppem back tak \ cal Ke bo te coh rn Vv N, kb © F dewtor porntey, “8 Bs © Pe SCA p< ee < og all a AaAbOA 2? aaa ¢ 2 \ Carry ° a 4 YY J WY b Zeewal ” dud pay & t a gobo , =) aaba me ile * yaa ee be TN ; KS ¢ a =) aa 5 a 3 5 web a lp - vy N le EN ‘y a AP vo Are IN Le ow uv ao ©, J\ T gic f pene ‘ ‘y > qpin Boow tracy. _ e, Cug C8) AR yw ap DO AN Vp A Hae Hp Statioys we huvd: hence o UP parrbing /— / pou? also Known ay syntox ovals . UF vb ip => Sequce of tokens, > a poory Ayer . > a : oon mtokty [syn Lox 2 \uwet |) >) og elo | prala's a sg eit fi ble poorly oY tdivt her de wiht ad due Hearts» Beta “ Hache oy covecl me syn col . 5 uheve He tree boy 5 glen He tne bos been > Rot Moda and we wilt cl an a Wg Lunt Ar of tree. ‘ _) Lake most duuakouy, oit aean & Jobe “ve curarey - been “gensoses: tn root No du ended, fn Leaky alodce 2 No ombiguety Ly Joab odie ~ Botton up porylyg |. ¥ paryirg Starts from Saab rode to 10 ips Qq ne x BE roa. dervaston 99th be wd wee pod. & ws wit be the olp of Syntor ‘ 7 o b Pu gor foward Soot node Hs nottng bur Seat symbol oF grammer » x. 6 danBe *— 8b cl b Bod IP simi obb cco. \ Sok’ abbede : oe => we fou 4o take Subser'vg, Here wear 40K79 a QA vo rratela b> (ab) wondle Pale side Of producti. Va aubserirg Wy matchs WHth He ~axbb ede anede (n>Abc) Ande. CRS) anne. (sande), > wduied © $? 3 ae s0ters Of Dave aotom up porstivg 1% nt oudeo'rg steep ag to Bey symbol of the finan ;—> shes | dertuoss'o netaivg bust rege rest deo latter) 1! Ruurye Sorted, | Yr £4 @at|r T- THe] Fo eid ida vd CP> rd), 2 PP td (re) ei T# Vd. (Fra) : : - 44 € Gore e) +r (eo) ie

You might also like