SlideShare a Scribd company logo
1 of 14
Toy Compiler
Front End:
It performs lexical syntax and semantic involved functions
• Determine validity of source statement from view point of
analysis.
• Determine ‘content’ of source statement.
• Construct a suitable representation of source statement for
the use of
• subsequent analysis function or synthesis phase of a language
processor.
• Front end of Toy compiler
– Lexical analysis
– Syntax analysis
– Semantic analysis
• Back end of Toy compiler
– Memory allocation
– Code generation
Toy Compiler
Output of Front End
• Table of Information:
Contains information obtained during different analysis of source program.
IC: Description of source statement
• Has sequence of IC units
• Each IC unit represent the meaning of each individual
• actions performed based on source program . IC unit may contain
reference to information in various tables.
• Actions:
Convert (id,#1) to real, giving (id,#4)
Add (id,#4) to (id,#3), giving (id,#5)
Store (id,#5) in (id,#2)
Lexical Analysis of Front End
• Identifies lexical units in source statement .its
classifies into different lexical classes .
• Example:-String of token:a := b + i;
Id#2 op#5 id#3 op#3 id#1 op#1
Syntax Analysis of Front End
• Syntax analysis process is the string of tokens
built by lexical analyzer to determine the
statement class.
• Ex: Assignment Statement Class , For Loop
Class , Switch Case, etc.
Semantic Analysis of Front End
When semantic analysis determine the meaning of sub-tree in
IC, it adds
-Declaration (added to symbol table)
-Imperative Statement Analysis (determines the action
sequence.
Back End
.
Memory allocation
Code generation
Symbol table
Constant table
Other tables
Target Program
IR
IC
Fig: Back end of Toy Compiler
• Memory allocation :
– The memory requirement of identifier is
computed from its type, length and
dimensionality
– Address of memory area is entered in the symbol
table
Back end of toy compiler
• Code generation :
– Issues in code generation
• Determine the place where results should be kept i.e.
register or memory
• Determine which instruction should be used for type
conversion operations
• Determine which addressing modes should be used.
– assembly code
» CONV_R AREG, I
» ADD_R AREG, B
» MOVEM AREG, A
• 1. Memory Allocation:
• –
• A memory allocation requirement of an identifier is computed from its
• •
• Size,
• •
• Length,
• •
• Type,
• •
• Dimension
• –
• And then memory is allocated to it.
• –
• The address of memory area is then entered in symbol table. See next figure.
• –
• i
• * & temp are not shown because memory allocation is not required now for
• this id.
• –
• i
• * and temp should be allocated memory but this decision are taken in
• preparatory steps of code generation.
• Sr. No.
• Symbol
• Type
• Length
• Address
• 1
• i
• Integer
• -
• 2000
• 2
• a
• Real
• -
• 2016
• 3
• b
• Real
• -
• 2020

More Related Content

What's hot

What's hot (20)

Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
 
Unit 3
Unit 3Unit 3
Unit 3
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
 
First pass of assembler
First pass of assemblerFirst pass of assembler
First pass of assembler
 
Ch 4 linker loader
Ch 4 linker loaderCh 4 linker loader
Ch 4 linker loader
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
 
Direct linking loaders
Direct linking loadersDirect linking loaders
Direct linking loaders
 
Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computer
 
Macro Processor
Macro ProcessorMacro Processor
Macro Processor
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programming
 
Compiler Design Lecture Notes
Compiler Design Lecture NotesCompiler Design Lecture Notes
Compiler Design Lecture Notes
 

Viewers also liked

Apresentação Nova D9 Clube nova marco 2017 equipe Associação Unitel
Apresentação Nova  D9 Clube nova marco 2017 equipe Associação UnitelApresentação Nova  D9 Clube nova marco 2017 equipe Associação Unitel
Apresentação Nova D9 Clube nova marco 2017 equipe Associação UnitelNilton Lucas Associação Unitel
 
Ley 254 con correcciones y recomendaciones
Ley 254 con correcciones y recomendacionesLey 254 con correcciones y recomendaciones
Ley 254 con correcciones y recomendacionesJavier Rodriguez
 
presupuesto de produccion Jose peraza C.I 18.103.032
  presupuesto de produccion Jose peraza C.I 18.103.032  presupuesto de produccion Jose peraza C.I 18.103.032
presupuesto de produccion Jose peraza C.I 18.103.032Alejandro Peraza
 
Presentación registro público rainmar
Presentación registro público rainmarPresentación registro público rainmar
Presentación registro público rainmarRainmar Cedeño Montes
 
Conceptos básicos de probabilidad
Conceptos básicos de probabilidadConceptos básicos de probabilidad
Conceptos básicos de probabilidadDENISSE FLORES
 
Imperialismo
ImperialismoImperialismo
ImperialismoAlan
 
Presentacion psicofarmacos
Presentacion psicofarmacos Presentacion psicofarmacos
Presentacion psicofarmacos Javier Rodriguez
 
Green thumbed warrior social media strategy
Green thumbed warrior social media strategyGreen thumbed warrior social media strategy
Green thumbed warrior social media strategyAnna Nepomuceno
 
La niña mas hermosa del planeta.
La niña mas hermosa del planeta. La niña mas hermosa del planeta.
La niña mas hermosa del planeta. juan jose
 
Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...
Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...
Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...Pranjal Singh
 
Cruzadinha - A invenção do Brasil
Cruzadinha - A invenção do BrasilCruzadinha - A invenção do Brasil
Cruzadinha - A invenção do BrasilMary Alvarenga
 
3Com 2150A026
3Com 2150A0263Com 2150A026
3Com 2150A026savomir
 
Fly Fishing Advice for the Novice
Fly Fishing Advice for the NoviceFly Fishing Advice for the Novice
Fly Fishing Advice for the NoviceBrett Coltman (UBS)
 
Taller 2 keila
Taller 2 keilaTaller 2 keila
Taller 2 keila10keila21
 

Viewers also liked (20)

Apresentação Nova D9 Clube nova marco 2017 equipe Associação Unitel
Apresentação Nova  D9 Clube nova marco 2017 equipe Associação UnitelApresentação Nova  D9 Clube nova marco 2017 equipe Associação Unitel
Apresentação Nova D9 Clube nova marco 2017 equipe Associação Unitel
 
Ley 254 con correcciones y recomendaciones
Ley 254 con correcciones y recomendacionesLey 254 con correcciones y recomendaciones
Ley 254 con correcciones y recomendaciones
 
Computers
ComputersComputers
Computers
 
presupuesto de produccion Jose peraza C.I 18.103.032
  presupuesto de produccion Jose peraza C.I 18.103.032  presupuesto de produccion Jose peraza C.I 18.103.032
presupuesto de produccion Jose peraza C.I 18.103.032
 
Base de datos jefer
Base de datos jeferBase de datos jefer
Base de datos jefer
 
Suicide...
Suicide...Suicide...
Suicide...
 
Sociedad del conocimiento
Sociedad del conocimientoSociedad del conocimiento
Sociedad del conocimiento
 
Presentación registro público rainmar
Presentación registro público rainmarPresentación registro público rainmar
Presentación registro público rainmar
 
Conceptos básicos de probabilidad
Conceptos básicos de probabilidadConceptos básicos de probabilidad
Conceptos básicos de probabilidad
 
Mini clase Las Plantas
Mini clase Las PlantasMini clase Las Plantas
Mini clase Las Plantas
 
Imperialismo
ImperialismoImperialismo
Imperialismo
 
Presentacion psicofarmacos
Presentacion psicofarmacos Presentacion psicofarmacos
Presentacion psicofarmacos
 
Syntax
SyntaxSyntax
Syntax
 
Green thumbed warrior social media strategy
Green thumbed warrior social media strategyGreen thumbed warrior social media strategy
Green thumbed warrior social media strategy
 
La niña mas hermosa del planeta.
La niña mas hermosa del planeta. La niña mas hermosa del planeta.
La niña mas hermosa del planeta.
 
Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...
Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...
Analyzing Patient Scheduling, No Shows, and Cancellations in a Specialty- Car...
 
Cruzadinha - A invenção do Brasil
Cruzadinha - A invenção do BrasilCruzadinha - A invenção do Brasil
Cruzadinha - A invenção do Brasil
 
3Com 2150A026
3Com 2150A0263Com 2150A026
3Com 2150A026
 
Fly Fishing Advice for the Novice
Fly Fishing Advice for the NoviceFly Fishing Advice for the Novice
Fly Fishing Advice for the Novice
 
Taller 2 keila
Taller 2 keilaTaller 2 keila
Taller 2 keila
 

Similar to Toy complier

Valuable Information on Lexical Analysis in Compiler Design
Valuable Information on Lexical Analysis in Compiler DesignValuable Information on Lexical Analysis in Compiler Design
Valuable Information on Lexical Analysis in Compiler DesignLesa Cote
 
Initial design (Game Architecture)
Initial design (Game Architecture)Initial design (Game Architecture)
Initial design (Game Architecture)Rajkumar Pawar
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compileradilmehmood93
 
Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02riddhi viradiya
 
isa architecture
isa architectureisa architecture
isa architectureAJAL A J
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptxchouguleamruta24
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XETemesgen Molla
 
Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error predictionNIKHIL NAWATHE
 
UNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdfUNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdfDURAIMURUGANM2
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction Thapar Institute
 
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...Arti Parab Academics
 

Similar to Toy complier (20)

Code Generation
Code GenerationCode Generation
Code Generation
 
Valuable Information on Lexical Analysis in Compiler Design
Valuable Information on Lexical Analysis in Compiler DesignValuable Information on Lexical Analysis in Compiler Design
Valuable Information on Lexical Analysis in Compiler Design
 
Initial design (Game Architecture)
Initial design (Game Architecture)Initial design (Game Architecture)
Initial design (Game Architecture)
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compiler
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02
 
Assembler
AssemblerAssembler
Assembler
 
Handout#08
Handout#08Handout#08
Handout#08
 
isa architecture
isa architectureisa architecture
isa architecture
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Assignment11
Assignment11Assignment11
Assignment11
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XE
 
Handout#09
Handout#09Handout#09
Handout#09
 
Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
 
UNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdfUNIT 5 CAD STANDARDS -GOoGLE.pdf
UNIT 5 CAD STANDARDS -GOoGLE.pdf
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
 
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 

Toy complier

  • 1.
  • 2. Toy Compiler Front End: It performs lexical syntax and semantic involved functions • Determine validity of source statement from view point of analysis. • Determine ‘content’ of source statement. • Construct a suitable representation of source statement for the use of • subsequent analysis function or synthesis phase of a language processor.
  • 3. • Front end of Toy compiler – Lexical analysis – Syntax analysis – Semantic analysis • Back end of Toy compiler – Memory allocation – Code generation Toy Compiler
  • 4.
  • 5. Output of Front End • Table of Information: Contains information obtained during different analysis of source program. IC: Description of source statement • Has sequence of IC units • Each IC unit represent the meaning of each individual • actions performed based on source program . IC unit may contain reference to information in various tables. • Actions: Convert (id,#1) to real, giving (id,#4) Add (id,#4) to (id,#3), giving (id,#5) Store (id,#5) in (id,#2)
  • 6.
  • 7. Lexical Analysis of Front End • Identifies lexical units in source statement .its classifies into different lexical classes . • Example:-String of token:a := b + i; Id#2 op#5 id#3 op#3 id#1 op#1
  • 8. Syntax Analysis of Front End • Syntax analysis process is the string of tokens built by lexical analyzer to determine the statement class. • Ex: Assignment Statement Class , For Loop Class , Switch Case, etc.
  • 9. Semantic Analysis of Front End When semantic analysis determine the meaning of sub-tree in IC, it adds -Declaration (added to symbol table) -Imperative Statement Analysis (determines the action sequence.
  • 10.
  • 11. Back End . Memory allocation Code generation Symbol table Constant table Other tables Target Program IR IC Fig: Back end of Toy Compiler
  • 12. • Memory allocation : – The memory requirement of identifier is computed from its type, length and dimensionality – Address of memory area is entered in the symbol table
  • 13. Back end of toy compiler • Code generation : – Issues in code generation • Determine the place where results should be kept i.e. register or memory • Determine which instruction should be used for type conversion operations • Determine which addressing modes should be used. – assembly code » CONV_R AREG, I » ADD_R AREG, B » MOVEM AREG, A
  • 14. • 1. Memory Allocation: • – • A memory allocation requirement of an identifier is computed from its • • • Size, • • • Length, • • • Type, • • • Dimension • – • And then memory is allocated to it. • – • The address of memory area is then entered in symbol table. See next figure. • – • i • * & temp are not shown because memory allocation is not required now for • this id. • – • i • * and temp should be allocated memory but this decision are taken in • preparatory steps of code generation. • Sr. No. • Symbol • Type • Length • Address • 1 • i • Integer • - • 2000 • 2 • a • Real • - • 2016 • 3 • b • Real • - • 2020