SlideShare a Scribd company logo
Compilation From code to executable By David Halliday
Stages from Source to Executable Compilation:  source code ==> relocatable object code (binaries) Linking: many relocatable binaries (modules plus libraries) ==> one relocatable binary (with all external references satisfied) Loading: relocatable ==> absolute binary (with all code and data references bound to the addresses occupied in memory) Execution: control is transferred to the first instruction of the program
Phases of the Compilation Process 1 Lexical analysis (scanning):  the source text is broken into tokens. Syntactic analysis (parsing):  tokens are combined to form syntactic structures, typically represented by a parse tree. The parser may be replaced by a syntax-directed editor, which directly generates a parse tree as a product of editing. Semantic analysis:  intermediate code is generated for each syntactic structure. Type checking is performed in this phase.
Phases of the Compilation Process 2 Machine-independent optimization: intermediate code is optimized to improve efficiency. Code generation: intermediate code is translated to relocatable object code for the target machine. Machine-dependent optimization: the machine code is optimized. On some systems (e.g., C under Unix), the compiler produces assembly code, which is then translated by an assembler.
Ad

More Related Content

What's hot (20)

Neonatal infections
Neonatal infectionsNeonatal infections
Neonatal infections
ABHIJIT BHOYAR
 
Microteaching
MicroteachingMicroteaching
Microteaching
Vedantha Vinod
 
Prevention of parent to child transmission programme
Prevention of parent to child transmission programmePrevention of parent to child transmission programme
Prevention of parent to child transmission programme
GSL MEDICAL COLLEGE
 
OBG Research | Obstetrical Gynecology | Problem statements
OBG Research | Obstetrical Gynecology  | Problem statements OBG Research | Obstetrical Gynecology  | Problem statements
OBG Research | Obstetrical Gynecology | Problem statements
MontuLimja
 
Community health nursing approaches
Community health nursing approachesCommunity health nursing approaches
Community health nursing approaches
Nagamani Manjunath
 
Transport of newborn
Transport of newbornTransport of newborn
Transport of newborn
mohanasundariskrose
 
Lcd projector
Lcd projectorLcd projector
Lcd projector
Avinash Chandra
 
School health program
School health programSchool health program
School health program
Ramya Gokulakannan
 
Symposium
SymposiumSymposium
Symposium
ITM UNIVERSITY,GWALIOR
 
instructional aids
 instructional aids instructional aids
instructional aids
JulainaMehraj
 
Objectives and National organizations in family welfare programme
Objectives and National organizations in family welfare programmeObjectives and National organizations in family welfare programme
Objectives and National organizations in family welfare programme
Adarsh SA
 
Seminar
SeminarSeminar
Seminar
Umm-e-Rooman Yaqoob
 
Community Bag technique
Community Bag techniqueCommunity Bag technique
Community Bag technique
Kailash Nagar
 
Field trip
Field tripField trip
Field trip
ITM UNIVERSITY,GWALIOR
 
COCOMO model
COCOMO modelCOCOMO model
COCOMO model
hajra azam
 
Seminar Method of Teaching
Seminar   Method of TeachingSeminar   Method of Teaching
Seminar Method of Teaching
MAHESWARI JAIKUMAR
 
The role of the nurse in public health safety: Immunization
The role of the nurse in public health safety: ImmunizationThe role of the nurse in public health safety: Immunization
The role of the nurse in public health safety: Immunization
smithd45
 
Simulation
SimulationSimulation
Simulation
Neha Bhatt
 
Pert and gantt chart
Pert and gantt chartPert and gantt chart
Pert and gantt chart
Yogesh Dengale
 
MINOR NB DISORDER NEWBORN
MINOR NB DISORDER NEWBORNMINOR NB DISORDER NEWBORN
MINOR NB DISORDER NEWBORN
Sharda School of Nursing Science and Research, Sharda University
 

Similar to Compilation (20)

Compiler presentaion
Compiler presentaionCompiler presentaion
Compiler presentaion
Shady A. Alefrangy
 
Compiler construction lecture 01 .pptx.pdf
Compiler construction  lecture 01 .pptx.pdfCompiler construction  lecture 01 .pptx.pdf
Compiler construction lecture 01 .pptx.pdf
zamanjktiktok
 
Compiler Design Material
Compiler Design MaterialCompiler Design Material
Compiler Design Material
Dr. C.V. Suresh Babu
 
Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02
Tirumala Rao
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
DrIsikoIsaac
 
A basic introduction to compiler design.ppt
A basic introduction to compiler design.pptA basic introduction to compiler design.ppt
A basic introduction to compiler design.ppt
pandaashirbad9
 
A basic introduction to compiler design.ppt
A basic introduction to compiler design.pptA basic introduction to compiler design.ppt
A basic introduction to compiler design.ppt
pandaashirbad9
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
NesredinTeshome1
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
DrIsikoIsaac
 
Compilation in c
Compilation in cCompilation in c
Compilation in c
JosephBonillaArcinie
 
Chapter One
Chapter OneChapter One
Chapter One
bolovv
 
Compiler
Compiler Compiler
Compiler
IGZ Software house
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
Rana Ehtisham Ul Haq
 
Lecture 2.1 - Phase of a Commmmpiler.pdf
Lecture 2.1 - Phase of a Commmmpiler.pdfLecture 2.1 - Phase of a Commmmpiler.pdf
Lecture 2.1 - Phase of a Commmmpiler.pdf
AbuZahed5
 
Compiler
Compiler Compiler
Compiler
Md. Sumon Fakir
 
Compiler_Lecture1.pdf
Compiler_Lecture1.pdfCompiler_Lecture1.pdf
Compiler_Lecture1.pdf
AkarTaher
 
Assignment1
Assignment1Assignment1
Assignment1
Sunita Milind Dol
 
Embedded systems designUNIT 4 PART 2.pdf
Embedded systems designUNIT 4 PART 2.pdfEmbedded systems designUNIT 4 PART 2.pdf
Embedded systems designUNIT 4 PART 2.pdf
vmspraneeth
 
Compiler design and lexical analyser
Compiler design and lexical analyserCompiler design and lexical analyser
Compiler design and lexical analyser
abhishek gupta
 
Unit 1 part1 Introduction of Compiler Design.pptx
Unit 1 part1 Introduction of Compiler Design.pptxUnit 1 part1 Introduction of Compiler Design.pptx
Unit 1 part1 Introduction of Compiler Design.pptx
Neelkaranbind
 
Compiler construction lecture 01 .pptx.pdf
Compiler construction  lecture 01 .pptx.pdfCompiler construction  lecture 01 .pptx.pdf
Compiler construction lecture 01 .pptx.pdf
zamanjktiktok
 
Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02
Tirumala Rao
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
DrIsikoIsaac
 
A basic introduction to compiler design.ppt
A basic introduction to compiler design.pptA basic introduction to compiler design.ppt
A basic introduction to compiler design.ppt
pandaashirbad9
 
A basic introduction to compiler design.ppt
A basic introduction to compiler design.pptA basic introduction to compiler design.ppt
A basic introduction to compiler design.ppt
pandaashirbad9
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
DrIsikoIsaac
 
Chapter One
Chapter OneChapter One
Chapter One
bolovv
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
Rana Ehtisham Ul Haq
 
Lecture 2.1 - Phase of a Commmmpiler.pdf
Lecture 2.1 - Phase of a Commmmpiler.pdfLecture 2.1 - Phase of a Commmmpiler.pdf
Lecture 2.1 - Phase of a Commmmpiler.pdf
AbuZahed5
 
Compiler_Lecture1.pdf
Compiler_Lecture1.pdfCompiler_Lecture1.pdf
Compiler_Lecture1.pdf
AkarTaher
 
Embedded systems designUNIT 4 PART 2.pdf
Embedded systems designUNIT 4 PART 2.pdfEmbedded systems designUNIT 4 PART 2.pdf
Embedded systems designUNIT 4 PART 2.pdf
vmspraneeth
 
Compiler design and lexical analyser
Compiler design and lexical analyserCompiler design and lexical analyser
Compiler design and lexical analyser
abhishek gupta
 
Unit 1 part1 Introduction of Compiler Design.pptx
Unit 1 part1 Introduction of Compiler Design.pptxUnit 1 part1 Introduction of Compiler Design.pptx
Unit 1 part1 Introduction of Compiler Design.pptx
Neelkaranbind
 
Ad

Recently uploaded (20)

Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Does Pornify Allow NSFW? Everything You Should Know
Does Pornify Allow NSFW? Everything You Should KnowDoes Pornify Allow NSFW? Everything You Should Know
Does Pornify Allow NSFW? Everything You Should Know
Pornify CC
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
The Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdfThe Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdf
Precisely
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Financial Services Technology Summit 2025
Financial Services Technology Summit 2025Financial Services Technology Summit 2025
Financial Services Technology Summit 2025
Ray Bugg
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Does Pornify Allow NSFW? Everything You Should Know
Does Pornify Allow NSFW? Everything You Should KnowDoes Pornify Allow NSFW? Everything You Should Know
Does Pornify Allow NSFW? Everything You Should Know
Pornify CC
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
The Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdfThe Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdf
Precisely
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Financial Services Technology Summit 2025
Financial Services Technology Summit 2025Financial Services Technology Summit 2025
Financial Services Technology Summit 2025
Ray Bugg
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Ad

Compilation

  • 1. Compilation From code to executable By David Halliday
  • 2. Stages from Source to Executable Compilation: source code ==> relocatable object code (binaries) Linking: many relocatable binaries (modules plus libraries) ==> one relocatable binary (with all external references satisfied) Loading: relocatable ==> absolute binary (with all code and data references bound to the addresses occupied in memory) Execution: control is transferred to the first instruction of the program
  • 3. Phases of the Compilation Process 1 Lexical analysis (scanning): the source text is broken into tokens. Syntactic analysis (parsing): tokens are combined to form syntactic structures, typically represented by a parse tree. The parser may be replaced by a syntax-directed editor, which directly generates a parse tree as a product of editing. Semantic analysis: intermediate code is generated for each syntactic structure. Type checking is performed in this phase.
  • 4. Phases of the Compilation Process 2 Machine-independent optimization: intermediate code is optimized to improve efficiency. Code generation: intermediate code is translated to relocatable object code for the target machine. Machine-dependent optimization: the machine code is optimized. On some systems (e.g., C under Unix), the compiler produces assembly code, which is then translated by an assembler.
  翻译: