SlideShare a Scribd company logo
1 of 11
Compiler
Compiler and Translators
Translator is a program that takes as input a program written in one
programming language (the source language) and produces as output
a program in another language (the object or target language).
Source
Program
Object
Program
Translator
Compiler
Types of translator
There are four types of translator according to the source
language as well as target language:
Compiler is a translator that translates a high-level language
program such as FORTRAN, PASCAL, C++
, to low-level language
program such as an assembly language or machine language.
Note: The translation process should also report the presence of
errors in the source program.
High-level
language
Low-level
language
(machine 01)
Compiler
Compiler
Others Translators:
Interpreters are another kind of translators. An Interpreter is a
translator that effectively accepts a source program and executes it
directly, without, producing any object code first. It does this by
fetching the source program instructions one by one, analyzing them
one by one, and then "executing" them one by one.
1- Smaller (advantage)
2- Slower (disadvantage)
High-level
language
Intermediate code
directly execution
An Assembler is a translator that translates the assembly language
program (mnemonic program) to machine language program.
Assembly
Program
Low-level language
Machine
Program
Low-level language
Pre-processor: is a Translator Translate program written by H.L.L
in to an equivalent program in H.L.L.
High-level
language
High-level
Language
Why do we Need Translations?
If there are no translators, then we must be programming in machine
language. With machine language we must be communicate directly
with a computer in terms of bits, registers, and very primitive
machine operations. Since a machine language program is nothing
more than a sequence of 0's and 1's, programming a complex
Pre-processor
Assembler
Interpreter
Compiler
Why we Write Programs in High-Level Language?
We write programs in high-level language (advantages of high-level
language) because it is:
1) Readability: high-level language will allow programs to be
written in the same ways that used in description of the
algorithms.
2) Portability: High-level languages can be run without
changing on a variety of different computers.
3) Generality: Most high-level languages allow the writing of a
wide variety of programs, thus relieving the programmer of the
need to become expert in many languages.
4) Brevity: Programs expressed in high-level languages are often
considerably shorter (in terms of their number of source lines)
than their low-level equivalents.
5) It's easy in the Error checking process.
The Structure of a Compiler
The process of compilation is so complex to be
achieved in one single step, either from a logical
point of view or from an implementation point of
view. For this reason it is partition into a series of
sub processes called Phases.
The different phases of a compiler are as follows
Analysis Phases:
Lexical Analysis
Syntax Analysis
Compiler
1. Semantic Analysis
Synthesis Phases:
2. Intermediate Code generator
3. Code Optimization
4. Code generation..
The typical compiler consists of several phases each of which
passes its output to the next phase plus symbol table manager and an
error handler as shown below:
Source Program
Target Program
Code
Generating
Code
Optimization
Intermediate
Code Generating
Error
Handler
Symbol Table
management
Semantic
Analysis
Syntax
Analysis
Lexical
Analysis

More Related Content

Similar to lce1 مترجمات.pptx

Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdfRakibRahman19
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide shareSudhaa Ravi
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)nharsh2308
 
Program, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxProgram, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxHariharPaudel1
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compilerA. S. M. Shafi
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Arslan Hussain
 
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming LanguagesMuhammad Hammad Waseem
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl TranslatorCma Mohd
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languagesraksharao
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler designPreeti Katiyar
 
compilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdfcompilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdfHarshaVardhan196987
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreterParas Patel
 
Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Safen D Taha
 

Similar to lce1 مترجمات.pptx (20)

C_NOTES.pdf
C_NOTES.pdfC_NOTES.pdf
C_NOTES.pdf
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdf
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
 
Computer language
Computer languageComputer language
Computer language
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
 
compiler vs interpreter
compiler vs interpretercompiler vs interpreter
compiler vs interpreter
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Program, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxProgram, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptx
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
 
Computer languages
Computer languagesComputer languages
Computer languages
 
class1.pdf
class1.pdfclass1.pdf
class1.pdf
 
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languages
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler design
 
compilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdfcompilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdf
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Cf&oa
Cf&oaCf&oa
Cf&oa
 
Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ
 

More from SamiAAli44

المحاضرة الاولى بور بوينت تعليم اساسي.pptx
المحاضرة  الاولى      بور بوينت تعليم اساسي.pptxالمحاضرة  الاولى      بور بوينت تعليم اساسي.pptx
المحاضرة الاولى بور بوينت تعليم اساسي.pptxSamiAAli44
 
م.م عقيل ثامر (4).pptx
م.م عقيل ثامر (4).pptxم.م عقيل ثامر (4).pptx
م.م عقيل ثامر (4).pptxSamiAAli44
 
Lecture 10.pptx
Lecture 10.pptxLecture 10.pptx
Lecture 10.pptxSamiAAli44
 
م.م عقيل ثامر (9).pptx
م.م عقيل ثامر (9).pptxم.م عقيل ثامر (9).pptx
م.م عقيل ثامر (9).pptxSamiAAli44
 
virus-140717152102-phpapp02.pdf
virus-140717152102-phpapp02.pdfvirus-140717152102-phpapp02.pdf
virus-140717152102-phpapp02.pdfSamiAAli44
 
________ ________1.ppt
________ ________1.ppt________ ________1.ppt
________ ________1.pptSamiAAli44
 
محاضرات في مادة طرائق التدريس التخصصية (1).pptx
محاضرات في مادة طرائق التدريس التخصصية (1).pptxمحاضرات في مادة طرائق التدريس التخصصية (1).pptx
محاضرات في مادة طرائق التدريس التخصصية (1).pptxSamiAAli44
 
Computer-Networks--Network.ppt
Computer-Networks--Network.pptComputer-Networks--Network.ppt
Computer-Networks--Network.pptSamiAAli44
 

More from SamiAAli44 (8)

المحاضرة الاولى بور بوينت تعليم اساسي.pptx
المحاضرة  الاولى      بور بوينت تعليم اساسي.pptxالمحاضرة  الاولى      بور بوينت تعليم اساسي.pptx
المحاضرة الاولى بور بوينت تعليم اساسي.pptx
 
م.م عقيل ثامر (4).pptx
م.م عقيل ثامر (4).pptxم.م عقيل ثامر (4).pptx
م.م عقيل ثامر (4).pptx
 
Lecture 10.pptx
Lecture 10.pptxLecture 10.pptx
Lecture 10.pptx
 
م.م عقيل ثامر (9).pptx
م.م عقيل ثامر (9).pptxم.م عقيل ثامر (9).pptx
م.م عقيل ثامر (9).pptx
 
virus-140717152102-phpapp02.pdf
virus-140717152102-phpapp02.pdfvirus-140717152102-phpapp02.pdf
virus-140717152102-phpapp02.pdf
 
________ ________1.ppt
________ ________1.ppt________ ________1.ppt
________ ________1.ppt
 
محاضرات في مادة طرائق التدريس التخصصية (1).pptx
محاضرات في مادة طرائق التدريس التخصصية (1).pptxمحاضرات في مادة طرائق التدريس التخصصية (1).pptx
محاضرات في مادة طرائق التدريس التخصصية (1).pptx
 
Computer-Networks--Network.ppt
Computer-Networks--Network.pptComputer-Networks--Network.ppt
Computer-Networks--Network.ppt
 

Recently uploaded

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

lce1 مترجمات.pptx

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Compiler Compiler and Translators Translator is a program that takes as input a program written in one programming language (the source language) and produces as output a program in another language (the object or target language). Source Program Object Program Translator
  • 7. Compiler Types of translator There are four types of translator according to the source language as well as target language: Compiler is a translator that translates a high-level language program such as FORTRAN, PASCAL, C++ , to low-level language program such as an assembly language or machine language. Note: The translation process should also report the presence of errors in the source program. High-level language Low-level language (machine 01) Compiler
  • 8. Compiler Others Translators: Interpreters are another kind of translators. An Interpreter is a translator that effectively accepts a source program and executes it directly, without, producing any object code first. It does this by fetching the source program instructions one by one, analyzing them one by one, and then "executing" them one by one. 1- Smaller (advantage) 2- Slower (disadvantage) High-level language Intermediate code directly execution An Assembler is a translator that translates the assembly language program (mnemonic program) to machine language program. Assembly Program Low-level language Machine Program Low-level language Pre-processor: is a Translator Translate program written by H.L.L in to an equivalent program in H.L.L. High-level language High-level Language Why do we Need Translations? If there are no translators, then we must be programming in machine language. With machine language we must be communicate directly with a computer in terms of bits, registers, and very primitive machine operations. Since a machine language program is nothing more than a sequence of 0's and 1's, programming a complex Pre-processor Assembler Interpreter
  • 9. Compiler Why we Write Programs in High-Level Language? We write programs in high-level language (advantages of high-level language) because it is: 1) Readability: high-level language will allow programs to be written in the same ways that used in description of the algorithms. 2) Portability: High-level languages can be run without changing on a variety of different computers. 3) Generality: Most high-level languages allow the writing of a wide variety of programs, thus relieving the programmer of the need to become expert in many languages. 4) Brevity: Programs expressed in high-level languages are often considerably shorter (in terms of their number of source lines) than their low-level equivalents. 5) It's easy in the Error checking process.
  • 10. The Structure of a Compiler The process of compilation is so complex to be achieved in one single step, either from a logical point of view or from an implementation point of view. For this reason it is partition into a series of sub processes called Phases. The different phases of a compiler are as follows Analysis Phases: Lexical Analysis Syntax Analysis
  • 11. Compiler 1. Semantic Analysis Synthesis Phases: 2. Intermediate Code generator 3. Code Optimization 4. Code generation.. The typical compiler consists of several phases each of which passes its output to the next phase plus symbol table manager and an error handler as shown below: Source Program Target Program Code Generating Code Optimization Intermediate Code Generating Error Handler Symbol Table management Semantic Analysis Syntax Analysis Lexical Analysis