Address
:
[go:
up one dir
,
main page
]
Include Form
Remove Scripts
Session Cookies
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)
59 views
15 pages
Tranlsation Software
Uploaded by
John Holt
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 tranlsation software For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
59 views
15 pages
Tranlsation Software
Uploaded by
John Holt
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
Carousel Previous
Carousel Next
Download
Save
Save tranlsation software For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 15
Search
Fullscreen
[Translation Software Aiteusierr TON Soemmns Srawes Tn Te Guerarron Or A Proona Syotax Analysis Grane 1+ Lexical Anelysis + Vanecestory Croractss (white space, commests ) are removed [+ Source. pogo is converted to tokens “Pxenreer cow ® = Count = 4 To FO TTotar wummern Of Trews Ane Powe “Mews” = Eunron 12.S Gusts = Foe Coust “Tota Nummca Or Tens Ane Prowe ” “Weus" = a ExoroR 2 Ktyword Taste Sven Tare + Reserved yisds ( Fore To, Penn) eAdeshficr(wriobh, cotatt) nome ued + Operaroas = the doko type + Theie matehing Eaters + fale (variate, consent orroy , preccre) = becotion [vate Keyword Token < 01 Token ll, 02 [-————_] Symbol Value ‘Type l = 03 start © Venable | = 04 t a Constant 7 7 wunber 2 Variable MexodeienaS counter 3 Variable |_— IF @AG 2 e Constant THEN ae ___| enter 4c ELSE aD REPEAT 45 || UNTIL 4F || r0 50 INPUT 31 ourPUT 52 —— znpFor 53Questeon_(Prsrenre) 4 Acompiler uses a Keyword table and a Symbol table Part of the keyword table is shown. Keyword Token < 01 — + 02 —___| 03 Se | Ze IF 4a | THEN 4B 4 ENDIF 4c ELSE 4D REPEAT 4B | UNTIL aE — 70 50 INPUT Bl OUTPUT 52 | ENDFOR 53 Entries in the symbol table are allocated tokens. These values start from 60 (hexadecimal). ‘Study the following piece of pseudocode. counter <@ INPUT Password REPEAT IF Password <> "Cambridge" ‘THEN INPUT Password ——)_—enrF Counter < Counter +1 ——| uNTIL Password = "Cambridge" oureur Counter | (@ Complete the symbol table to show its contents after the lexical analysis stage. —_ anal Token Value Type I Counter 60 Variable(a) Complete the symbol table to show its contents after the lexical analysis stage. Token ‘Symbol Value Type 60 Variable | $1 | Congtont Posuiced | 82 | Vorable “Conboidge” | 63 Constant 4 | cu [Constant (3) (b) The output from the lexical analysis stage is stored in the following table. Each cell stores one byte of the output. Complete the output from the lexical analysis using the keyword table and your answer to part (a). 60/01) Gf /St 2 [ME wal 62 O4)63 |B) | 62 MC) Wo1OL |60) 02/64 YF) W2 Jos KS |F2\60 2 How she contents of the heywod ond symbsl Kabks aftared bo troeslate the eource code. pesquat Keywords (opcptes ore Oasked up (inthe Keyser tebte) + Wey words foperabas are cepresertad by the tohens + Identifiers are Nodhed up in (the symbol table) + Identifiers are comerted to Ucollions foddretseg + Used to create 0 Sequence of fohens (For the progeon) Addition task completed ot the erica analysis shige thot does nat evolve the vse cto keyword or a symbol toblethe we ct a keyword of a symbol fuble + Wthie space. removed + reduntoot chords ore cemeved |, comovel P comments Grave 2+ Syptse Analysis TTashs gofemed wo eyotns orchpis : Constecting posse bee feorsieg |. chedsing the table & folnens to ensure that Yhe cules Jyntarl grammer of the Lonquoge are obeyed Je Rrodusrg on gree teport - Cw ot 62) ¥ % “We press Ff working ut fo given shkemert is Coane volid euardig to the given Bie prodution cules fe coded parsitg - “The geormalicod cules OF syntax foro progeomminn Donguage need _to_be jet out clearly so a progammes can vsite cade thok obeys the culesIne _qoommmccen cures oF SYR Tore POYomnn| yore Neer 9 be leet out clearly soo pogemmes an write ede shat cbiys the cules Jando camper can be_buitt to dec thet a grog com sys these cules. The cules can be shown graphically in_a SNNTAY DEAD RAM or sing a mato. Uonguige such 08 Backus - Nain foam (BNE) mabtion Baacns- Nonus Fenn | ____ ts 9 ewolhemabicat way af defining estoy 1s pefined by” Obs zIatytoretriens cote, | cepasents of < OfeTr > ¢ Number >... ¢ Drerr> ¢drort > < Numer, 22> ¢ Orarr> |
< kere > re A IBV CDIETEMGrH ITI FMR ~~. A_ word consigt F two etter2 CLEVER > creTIEe> A word conut F ony tumbers F ktter < wonn > < Letren > | ¢ LE Tie >< woRD? Assignnent statement < Acsrommont stamemtnt > rts CvARIARED 2 < V BRTarer COPERATORD< VARIANE? 5 Ses. Drecnan < Drei > Diort> rs sterspue< Asscotmor staremtnt > it CVARIARED = < V RATHLED COPERATORD< VARIAALE? 5 sssgnment sateen sateen rane }+(>)-+[ rata} arms eves (~*~ < Letren > |e Letter 2¢ worn? AE Kword > tie < Letter > | clether >< Digit? + The we geaccotion stoge produccs an objet code . + The grogom showy have cored” eyotar . Te object code ig in wothine-reagable Pore +Stave 4 + Optimization Why Gde optimigalion is necewary! + Optuningllion sacans that the code esi tove fewer mstsuthiens s optirined code ouugies Los page in memary |, Fewer insteadtins eadutes He extrution time the grogiem Original code w % + y Object code EDD | app | sTo vexsyes| ipo | ADD | app sto |_______loptinised code w = x + y|Object code LD | app | sto | sexxlene xen x vewsen app —————_ sto < Case 2: (6) This line of code is to be compiled ‘assembly language, is shown below: LD 234 //loads value B ADD 235 //adds value C seress7—//stores result in temporary location ee-S€7 Loads value from temporary location ADD 236 //adds value D S870 233 //stores result in A Code. optimization . sence] this final stage. ‘After the syntax analysis stage, the compiler generates object code. The equivalent code, in ()_Name the final stage in the compilation process that follows this code generation stage, (Gi) Rewrite the equivalent code given above to show the effect of it being processed throughSOE, opsemsamen, (Gi) Rewrite the equivalent code given above to show the effect of it being processed through this final stage. bo... 234, A00. 236. ——— find 226 | S70 2323 Benefits of opkimising the code. + Code ras Renser instrustons | occupies fess space in memory | fine taken to execute whale progeam decreays Revs As a method of scpecsenting on orithenctionl exprexsion 151 Tisrix foam: A-@ Reverse Burn Nomtron » AB- Cese 1: Usive REN bo eyolwke the eprersion using stods(b) The interpreter is executing Duraid’s program. The expressions are in infix form. The interpreter converts the infix to RPN. M210 The RPN expression for ¥ is pry -+ Q=2 uoMrot+r ® Rea The interpreter evaluates this RPN expression using a stack. (i) Show the changing contents of the stack, as the interpreter evaluates the expression for y. Use the values of the variables and constant given in the program. The first entry has been done for you. 2 2 u 4 6 ¢ 10; 00 cy s s ° ¢ ¢ Ww (4) + Amoys solve 86h bo ight s Whenever operator enters the stoch use thet operator on two velues ot fhe top ase 2: Twern fo RPN Conversion. lay A+B AB- &) A-Bac Nore: USE Bonn ALWAYS A-ec4# oO highest priority ABCE- a+ Some _pioity I> Sorte, privitylo (pre) * (R-F) Soke brocket first P+» Re- ———. Po+RP-» Ww (o-b) » Core) 17 ab- # ac+/7 ab- ¥ac4/7 (veer te Roun) ab -oc+s 7/ Pra -R IS Pra- RY Pat -Bs, ParRSi— oO -Ale + 4/CC-0) “Ale +4 O- A-B/» 4 I CO- Bracket: first A-Brue /c0 -~ A-Bruscn- 7 Cast 3: RPN to Infx conversionINTE? USE STACK ConcePT TO Sone sucl QUESTION iy AB- A-e a) Posmy RP-- — (sraar feoot Leer To Rta) Pra Me Rp ~ — (Pralarr ae-- (era)e (8-0) - ((R1a) em) (2-2) yy MWZ4Y-w a wre yet a weeny x (wer-y) MW) baw Watt - bra cdsa +- bva (c+d+0) (b+ 0) - (cr3 40) Case 4: eoeticad Quatios.uctlin 1. EeqQin tow RON is used by an interpreter to colmoke expressions « * Expression ore oAuays evelucted left to eights + Each cperetor uses the tive previous valacs on the stork Cencept uatry minus) LAE clement is © mmber push thet oumber ent the dock PIF dement on epuater then pop the fist two numbers bom stock + perforin tok operakion on thage numbers . Pura the gest back onto stock . rd once the Oost items im the expretion hor been deolt with. Ruder co 2» Aborto of using BPN for he cxaledan fn exprettion + No eced for rules & precedence ( BOOMS) «No acd Por beachets le Rew evaluction of spercfors ty oh uweys Dele to ecyht lOuslion op S: Whik-does the steterrent “Ne cect for cles oF precedence "means ? + Rates F prectesce rears different opuctors hove diferent pricrities Coowdtiply is done _bePore addition ) «Nn RON evalubion cf operctors is left to eight No need for brackets Quslin no Us ldeatify wh ccosns , a dake ructuce that cald be used be eoluoQs an expression in RPA 2STMUMRE + Stack Bown: “To epeands ere popped from ne stack in the covers order to how trey were pushed mS: § how as terpretec 04 Fam L Wow eccor is found tre stabiment is erceuked Aisi ad ~ apache is tepenke J fot oxcsag ikerokion i wae bt aes cade , Wterpretcbion hos tobe re exocy time the pref fan tun
You might also like
Python CCBP Notes
PDF
No ratings yet
Python CCBP Notes
85 pages
BPOPS203 Question Paper Solution 2023-24
PDF
No ratings yet
BPOPS203 Question Paper Solution 2023-24
45 pages
ECS-603 Put 2013 Sol
PDF
No ratings yet
ECS-603 Put 2013 Sol
27 pages
CD U 3 Combined Notes
PDF
No ratings yet
CD U 3 Combined Notes
99 pages
SPCC Basic
PDF
No ratings yet
SPCC Basic
29 pages
CC 3
PDF
No ratings yet
CC 3
25 pages
Unit 5
PDF
No ratings yet
Unit 5
18 pages
CD Notes
PDF
No ratings yet
CD Notes
57 pages
CD Unit 1
PDF
No ratings yet
CD Unit 1
24 pages
C Language PDF
PDF
No ratings yet
C Language PDF
115 pages
' Ode Opbm Tzation Goritema: Meanig
PDF
No ratings yet
' Ode Opbm Tzation Goritema: Meanig
18 pages
Compiler Bipin
PDF
No ratings yet
Compiler Bipin
94 pages
C Programming Written Notes 1 Pages 1
PDF
No ratings yet
C Programming Written Notes 1 Pages 1
100 pages
Report
PDF
No ratings yet
Report
20 pages
Js
PDF
No ratings yet
Js
26 pages
Chapter 1 Answers
PDF
100% (1)
Chapter 1 Answers
8 pages
Ec331 SDS
PDF
No ratings yet
Ec331 SDS
65 pages
CD Unit-Iii
PDF
No ratings yet
CD Unit-Iii
52 pages
All Unit
PDF
No ratings yet
All Unit
7 pages
Chapter 13: Data Types and Structures: Answers To Coursebook Questions and Tasks
PDF
No ratings yet
Chapter 13: Data Types and Structures: Answers To Coursebook Questions and Tasks
8 pages
IGCSE Option Book 2020 ST Christopher Latest PDF
PDF
No ratings yet
IGCSE Option Book 2020 ST Christopher Latest PDF
1 page
Java Unit-1
PDF
No ratings yet
Java Unit-1
12 pages
Ilovepdf Merged
PDF
No ratings yet
Ilovepdf Merged
66 pages
Programming Keys
PDF
No ratings yet
Programming Keys
20 pages
CD Assignment - 2
PDF
No ratings yet
CD Assignment - 2
25 pages
Translation Software
PDF
No ratings yet
Translation Software
20 pages
Compiler Design Unit 1 Notes
PDF
No ratings yet
Compiler Design Unit 1 Notes
49 pages
Chapter 3 Answers
PDF
50% (2)
Chapter 3 Answers
6 pages
CD Notes
PDF
No ratings yet
CD Notes
20 pages
CP by Triz
PDF
No ratings yet
CP by Triz
68 pages
CD Notes Unit-1
PDF
No ratings yet
CD Notes Unit-1
26 pages
Compiler 1
PDF
No ratings yet
Compiler 1
13 pages
Chapter 6 Answers
PDF
No ratings yet
Chapter 6 Answers
10 pages
Chapter 2 Answers
PDF
No ratings yet
Chapter 2 Answers
7 pages
Macro Instruction Extensions of Compiler Languages (Douglas McIlroy) (1960)
PDF
No ratings yet
Macro Instruction Extensions of Compiler Languages (Douglas McIlroy) (1960)
7 pages
SSCD Chapter3
PDF
No ratings yet
SSCD Chapter3
97 pages
Compiler Key1
PDF
No ratings yet
Compiler Key1
18 pages
Assignment
PDF
No ratings yet
Assignment
33 pages
PCPF ?
PDF
No ratings yet
PCPF ?
35 pages
Mod 1 Atc - Merged
PDF
No ratings yet
Mod 1 Atc - Merged
15 pages
Compiler Designing Assignment
PDF
No ratings yet
Compiler Designing Assignment
13 pages
C Language Assignment
PDF
No ratings yet
C Language Assignment
16 pages
Compiler Design Assignment 1
PDF
No ratings yet
Compiler Design Assignment 1
13 pages
Chapter 4 Answers
PDF
100% (1)
Chapter 4 Answers
9 pages
SPCC Assignment 3-8
PDF
No ratings yet
SPCC Assignment 3-8
10 pages
Python 2022
PDF
No ratings yet
Python 2022
12 pages
Unit1 CD
PDF
No ratings yet
Unit1 CD
25 pages
PCC Assignment 1
PDF
No ratings yet
PCC Assignment 1
10 pages
System Software, VM, Security, AI
PDF
No ratings yet
System Software, VM, Security, AI
33 pages
CD Notes
PDF
No ratings yet
CD Notes
34 pages
Structure Chart-1
PDF
No ratings yet
Structure Chart-1
6 pages
Begin: Ciro
PDF
No ratings yet
Begin: Ciro
11 pages
DR Questions
PDF
No ratings yet
DR Questions
55 pages
CD Unit1
PDF
No ratings yet
CD Unit1
35 pages
Questions
PDF
No ratings yet
Questions
39 pages
Lab Report 3-4
PDF
No ratings yet
Lab Report 3-4
47 pages
CTP Unit - 1
PDF
No ratings yet
CTP Unit - 1
18 pages
Compiler Design
PDF
No ratings yet
Compiler Design
27 pages
P1 May 2022 PDF
PDF
No ratings yet
P1 May 2022 PDF
32 pages
Communication and Network
PDF
No ratings yet
Communication and Network
19 pages
Answers
PDF
No ratings yet
Answers
25 pages
3 Lots of Lovely Integrals FULL SOLUTIONS
PDF
100% (2)
3 Lots of Lovely Integrals FULL SOLUTIONS
19 pages
CD Unit 1
PDF
No ratings yet
CD Unit 1
23 pages
Compiler End Sem
PDF
No ratings yet
Compiler End Sem
8 pages
New Doc 02-15-2024 15.30
PDF
No ratings yet
New Doc 02-15-2024 15.30
20 pages
CS1352 May07
PDF
No ratings yet
CS1352 May07
19 pages
20 23
PDF
No ratings yet
20 23
40 pages
AI
PDF
No ratings yet
AI
12 pages
C Programming Language
PDF
No ratings yet
C Programming Language
55 pages
SPOS Assignment
PDF
No ratings yet
SPOS Assignment
16 pages
10 Win Comp Vi Rev SPCC
PDF
No ratings yet
10 Win Comp Vi Rev SPCC
19 pages
Java Notes
PDF
No ratings yet
Java Notes
22 pages
IAL October 2023 FINAL
PDF
No ratings yet
IAL October 2023 FINAL
15 pages
Semester 7 - CD Imp Notes
PDF
No ratings yet
Semester 7 - CD Imp Notes
31 pages
Programming Paradigm
PDF
100% (1)
Programming Paradigm
20 pages
AQA GCSE Bio End of Topic B6
PDF
No ratings yet
AQA GCSE Bio End of Topic B6
8 pages
18CS752-Python 4
PDF
No ratings yet
18CS752-Python 4
16 pages
Monte South - Tower 3 - Floor Plans - A4 - 01
PDF
No ratings yet
Monte South - Tower 3 - Floor Plans - A4 - 01
6 pages
Modern Height-Merged
PDF
No ratings yet
Modern Height-Merged
5 pages
9.1. Computational Thinking Skills (MT-L)
PDF
No ratings yet
9.1. Computational Thinking Skills (MT-L)
5 pages
Logic Gates
PDF
No ratings yet
Logic Gates
25 pages
Recursion
PDF
No ratings yet
Recursion
7 pages
1 Lots of Lovely Integrals QUESTIONS
PDF
No ratings yet
1 Lots of Lovely Integrals QUESTIONS
2 pages
Horstmann Chapter 1
PDF
No ratings yet
Horstmann Chapter 1
6 pages
Chapter 11 Answers
PDF
100% (1)
Chapter 11 Answers
13 pages