SlideShare a Scribd company logo
1 of 18
Welcome To Our
Presentation
1. Sazzad Hossain Hasnat
2. Atik Hasan
3. Md. Ahad Kabir
4. Md. Imran Hossain
5.Md. Mohitul Islam
Group Members:
Sazzad Hossain Hasnat
What is a Compiler?
• A compiler is a computer program that transforms source code
written in a programming language into another computer
language.
Block Diagram Of Compiler
What is a Interpreter
• An interpreter is a computer program that directly executes
instructions written in a programming or scripting language,
without previously compiling them into a machine language
program.
Block Diagram Of Interpreter
Md.Mohitul Islam
Difference Between Compiler and Interpreter
• Input
• Intermediate Code
• Conditional Statement
• Memory Requirement
• Time Complexity
• Example
Md. Imran Hossain
Structure of a Compiler
• Lexical Analyzer
• Syntax Analyzer
• Semantic Analyzer
• Intermediate Code Generator
• Code Optimizer
• Code Generator
Atik Hasan
The Role of the Lexical Analyzer
• Scan a source program and break it up into small, meaningful units, called tokens
• Transform into meaningful units: identifiers, constants, operators, and punctuation
• Removal of comments
• Case conversion
• Removal of white spaces
• Communication with symbol table
What is Tokens, Lexemes, Patterns
• Token : A certain classification of entities of a program
• Example of tokens : Identifiers, Operators, Number, Symbols
• Lexeme : A specific instance of a token. It is used to differentiate tokens
• Patterns : Rule describing how tokens are specified in a program. It is needed
because a language can create infinite loops.
Type of Errors
• Lexical : Name of some identifier typed incorrectly
• Syntactical : Missing semicolon or unbalanced parenthesis
• Semantical : Incompatible value assignment
• Logical : Infinite loops, code not reachable
Md. Ahad Kabir
Errors Recovery Strategies
• There are four types of error recovery strategies
• 1. Panic Mode
• 2. Statement Mode
• 3. Error Productions
• 4. Global Correction
Errors Recovery Strategies
Panic Mode:
When a parser encounters an error anywhere in the statement, it ignores the
rest of the statement by not processing input from erroneous input to
delimiter, such as semi-colon. This is the easiest way of error-recovery
Statement Mode:
When a parser encounters an error, it tries to take corrective measures so that
the rest of inputs of statement allow the parser to parse ahead. For example,
inserting a missing semicolon, replacing comma with a semicolon etc.
Errors Recovery Strategies
Error productions:
Some common errors are known to the compiler designers that may occur in the code.
In addition, the designers can create augmented grammar to be used, as productions
that generate erroneous constructs when these errors are encountered
Global correction:
The parser considers the program in hand as a whole and tries to figure out what the
program is intended to do and tries to find out a closest match for it, which is error-
free.
Thank You

More Related Content

What's hot

La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
Cma Mohd
 
Language translators
Language translatorsLanguage translators
Language translators
Aditya Sharat
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
RAJU KATHI
 

What's hot (20)

Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Computer Language Translator
Computer Language TranslatorComputer Language Translator
Computer Language Translator
 
Compiler design tutorial
Compiler design tutorialCompiler design tutorial
Compiler design tutorial
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
Interpreter
InterpreterInterpreter
Interpreter
 
Interpreted and compiled language
Interpreted and compiled languageInterpreted and compiled language
Interpreted and compiled language
 
Compiler interpreter and_bootstrapping
Compiler interpreter and_bootstrappingCompiler interpreter and_bootstrapping
Compiler interpreter and_bootstrapping
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
 
Programming Languages / Translators
Programming Languages / TranslatorsProgramming Languages / Translators
Programming Languages / Translators
 
Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreterTranslators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
 
Presentation
PresentationPresentation
Presentation
 
Language processor
Language processorLanguage processor
Language processor
 
compiler and their types
compiler and their typescompiler and their types
compiler and their types
 
Compilers
CompilersCompilers
Compilers
 
Assembler
AssemblerAssembler
Assembler
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Language translators
Language translatorsLanguage translators
Language translators
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 

Similar to Compiler vs interpreter

Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
crAmth
 

Similar to Compiler vs interpreter (20)

System software module 4 presentation file
System software module 4 presentation fileSystem software module 4 presentation file
System software module 4 presentation file
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
Compiler an overview
Compiler  an overviewCompiler  an overview
Compiler an overview
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction
 
Principles of Compiler Design - Introduction
Principles of Compiler Design - IntroductionPrinciples of Compiler Design - Introduction
Principles of Compiler Design - Introduction
 
COMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptxCOMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptx
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
compiler construction tool in computer science .
compiler construction tool in computer science .compiler construction tool in computer science .
compiler construction tool in computer science .
 
Phases of Compiler.pptx
Phases of Compiler.pptxPhases of Compiler.pptx
Phases of Compiler.pptx
 
Compiler design
Compiler designCompiler design
Compiler design
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
 
Phases of Compiler.pdf
Phases of Compiler.pdfPhases of Compiler.pdf
Phases of Compiler.pdf
 
Code design
Code designCode design
Code design
 
An Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationAn Introduction To Software Development - Implementation
An Introduction To Software Development - Implementation
 
Code Inspection
Code InspectionCode Inspection
Code Inspection
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
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
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 

More from Inamul Hossain Imran

More from Inamul Hossain Imran (20)

Secondary storage.pptx
Secondary storage.pptxSecondary storage.pptx
Secondary storage.pptx
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Thin film electroluminescent display
Thin film electroluminescent displayThin film electroluminescent display
Thin film electroluminescent display
 
CRT (Cathode ray tube)
CRT (Cathode ray tube)CRT (Cathode ray tube)
CRT (Cathode ray tube)
 
Color model
Color modelColor model
Color model
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
DDA (digital differential analyzer)
DDA (digital differential analyzer)DDA (digital differential analyzer)
DDA (digital differential analyzer)
 
Led (light emitting diode )
Led (light emitting diode )Led (light emitting diode )
Led (light emitting diode )
 
Virtual Blood Bank
Virtual Blood BankVirtual Blood Bank
Virtual Blood Bank
 
Monopoly and monopolistic
Monopoly and monopolisticMonopoly and monopolistic
Monopoly and monopolistic
 
Monopolistic market
Monopolistic marketMonopolistic market
Monopolistic market
 
Oligopoly market
Oligopoly  marketOligopoly  market
Oligopoly market
 
Microeconomics vs macroeconomics
Microeconomics vs macroeconomicsMicroeconomics vs macroeconomics
Microeconomics vs macroeconomics
 
Cost and cost curve
Cost and cost curveCost and cost curve
Cost and cost curve
 
Historical Significance of Ahsan Manzil
Historical Significance of  Ahsan ManzilHistorical Significance of  Ahsan Manzil
Historical Significance of Ahsan Manzil
 
Measures of dispersions
Measures of dispersionsMeasures of dispersions
Measures of dispersions
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Agriculture in bangladesh
Agriculture in bangladeshAgriculture in bangladesh
Agriculture in bangladesh
 
Properties of relations
Properties of relationsProperties of relations
Properties of relations
 
Graph and tree
Graph and treeGraph and tree
Graph and tree
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Compiler vs interpreter

  • 2. 1. Sazzad Hossain Hasnat 2. Atik Hasan 3. Md. Ahad Kabir 4. Md. Imran Hossain 5.Md. Mohitul Islam Group Members:
  • 4. What is a Compiler? • A compiler is a computer program that transforms source code written in a programming language into another computer language. Block Diagram Of Compiler
  • 5. What is a Interpreter • An interpreter is a computer program that directly executes instructions written in a programming or scripting language, without previously compiling them into a machine language program. Block Diagram Of Interpreter
  • 7. Difference Between Compiler and Interpreter • Input • Intermediate Code • Conditional Statement • Memory Requirement • Time Complexity • Example
  • 9. Structure of a Compiler • Lexical Analyzer • Syntax Analyzer • Semantic Analyzer • Intermediate Code Generator • Code Optimizer • Code Generator
  • 11. The Role of the Lexical Analyzer • Scan a source program and break it up into small, meaningful units, called tokens • Transform into meaningful units: identifiers, constants, operators, and punctuation • Removal of comments • Case conversion • Removal of white spaces • Communication with symbol table
  • 12. What is Tokens, Lexemes, Patterns • Token : A certain classification of entities of a program • Example of tokens : Identifiers, Operators, Number, Symbols • Lexeme : A specific instance of a token. It is used to differentiate tokens • Patterns : Rule describing how tokens are specified in a program. It is needed because a language can create infinite loops.
  • 13. Type of Errors • Lexical : Name of some identifier typed incorrectly • Syntactical : Missing semicolon or unbalanced parenthesis • Semantical : Incompatible value assignment • Logical : Infinite loops, code not reachable
  • 15. Errors Recovery Strategies • There are four types of error recovery strategies • 1. Panic Mode • 2. Statement Mode • 3. Error Productions • 4. Global Correction
  • 16. Errors Recovery Strategies Panic Mode: When a parser encounters an error anywhere in the statement, it ignores the rest of the statement by not processing input from erroneous input to delimiter, such as semi-colon. This is the easiest way of error-recovery Statement Mode: When a parser encounters an error, it tries to take corrective measures so that the rest of inputs of statement allow the parser to parse ahead. For example, inserting a missing semicolon, replacing comma with a semicolon etc.
  • 17. Errors Recovery Strategies Error productions: Some common errors are known to the compiler designers that may occur in the code. In addition, the designers can create augmented grammar to be used, as productions that generate erroneous constructs when these errors are encountered Global correction: The parser considers the program in hand as a whole and tries to figure out what the program is intended to do and tries to find out a closest match for it, which is error- free.