SlideShare a Scribd company logo
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

PPTX
Compiler vs Interpreter-Compiler design ppt.
PPTX
Introduction to compiler interpreter
PDF
Compilation v. interpretation
PPT
Language translator
DOC
PPTX
Language Translator ( Compiler)
PPTX
Compiler vs interpreter
Compiler vs Interpreter-Compiler design ppt.
Introduction to compiler interpreter
Compilation v. interpretation
Language translator
Language Translator ( Compiler)
Compiler vs interpreter

What's hot (20)

PPT
Compiler Design Basics
PPTX
Computer Language Translator
PDF
Compiler design tutorial
PPTX
Chapter 5
PPT
La 5 Pl Translator
PPTX
Interpreter
PPTX
Interpreted and compiled language
PPT
Compiler interpreter and_bootstrapping
PPTX
Compiler design slide share
PPTX
Programming Languages / Translators
PPTX
Translators(Compiler, Assembler) and interpreter
PPTX
Presentation
PPTX
Language processor
PPTX
compiler and their types
PPSX
DOC
Assembler
PPTX
Compiler vs interpreter
PDF
Language translators
PPT
Compilers and interpreters
PPTX
COMPILER DESIGN OPTIONS
Compiler Design Basics
Computer Language Translator
Compiler design tutorial
Chapter 5
La 5 Pl Translator
Interpreter
Interpreted and compiled language
Compiler interpreter and_bootstrapping
Compiler design slide share
Programming Languages / Translators
Translators(Compiler, Assembler) and interpreter
Presentation
Language processor
compiler and their types
Assembler
Compiler vs interpreter
Language translators
Compilers and interpreters
COMPILER DESIGN OPTIONS
Ad

Similar to Compiler vs interpreter (20)

PPTX
Introduction to Compilers
PPTX
Compiler Design.pptx
PPTX
module 2 introduction to syntax analysis
PPTX
COMPILER CONSTRUCTION KU 1.pptx
PPTX
1._Introduction_.pptx
PPTX
ppt_cd.pptx ppt on phases of compiler of jntuk syllabus
PDF
Compiler design Introduction
PDF
An Introduction to the Compiler Designss
DOCX
Compiler Design
PDF
Lecture 01 introduction to compiler
PPT
Compiler Construction
PPTX
Syntax Analysis in Compiler Design
PDF
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
PPTX
PDF
11700220036.pdf
PPTX
Error-Handling-and-Recovery-in-Compilers.pptx
PDF
COMPILER DESIGN- Introduction & Lexical Analysis:
PPT
Unit1.ppt
PPTX
Plc part 2
PDF
Structure of a Compiler, Compiler and Interpreter, Lexical Analysis: Role of ...
Introduction to Compilers
Compiler Design.pptx
module 2 introduction to syntax analysis
COMPILER CONSTRUCTION KU 1.pptx
1._Introduction_.pptx
ppt_cd.pptx ppt on phases of compiler of jntuk syllabus
Compiler design Introduction
An Introduction to the Compiler Designss
Compiler Design
Lecture 01 introduction to compiler
Compiler Construction
Syntax Analysis in Compiler Design
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
11700220036.pdf
Error-Handling-and-Recovery-in-Compilers.pptx
COMPILER DESIGN- Introduction & Lexical Analysis:
Unit1.ppt
Plc part 2
Structure of a Compiler, Compiler and Interpreter, Lexical Analysis: Role of ...
Ad

More from Imran Hossain (20)

PDF
Artificial Intelligence (AI): Impact, Costs, and Future Prospects.
PDF
COMPUTER
PDF
The Power of Energy- A Journey Through Electricity
PDF
Mental Health Awareness in a Fast-Paced World
PDF
Artificial Intelligence and Its Role in Everyday Life.
PDF
SSD (Solid State Drive)
PDF
Smartphone, Mobile phone, Digital phone, Mobile, Handset
PPTX
Bangabandhu Sheikh Mujibur Rahman Tunnel
PDF
Rooppur Nuclear Power Plant, Pabna, Bangladesh
PPTX
Secondary storage
PPTX
Region based segmentation
PPTX
Thin film electroluminescent display
PPTX
CRT (Cathode ray tube)
PPTX
Color model
PPTX
Computer graphics
PPTX
DDA (digital differential analyzer)
PPTX
Led (light emitting diode )
PPTX
Virtual Blood Bank
PPTX
Monopoly and monopolistic
PPTX
Monopolistic market
Artificial Intelligence (AI): Impact, Costs, and Future Prospects.
COMPUTER
The Power of Energy- A Journey Through Electricity
Mental Health Awareness in a Fast-Paced World
Artificial Intelligence and Its Role in Everyday Life.
SSD (Solid State Drive)
Smartphone, Mobile phone, Digital phone, Mobile, Handset
Bangabandhu Sheikh Mujibur Rahman Tunnel
Rooppur Nuclear Power Plant, Pabna, Bangladesh
Secondary storage
Region based segmentation
Thin film electroluminescent display
CRT (Cathode ray tube)
Color model
Computer graphics
DDA (digital differential analyzer)
Led (light emitting diode )
Virtual Blood Bank
Monopoly and monopolistic
Monopolistic market

Recently uploaded (20)

PDF
Complications of Minimal Access Surgery at WLH
PPTX
Presentation on HIE in infants and its manifestations
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
master seminar digital applications in india
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Cell Structure & Organelles in detailed.
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Computing-Curriculum for Schools in Ghana
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Lesson notes of climatology university.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
Complications of Minimal Access Surgery at WLH
Presentation on HIE in infants and its manifestations
GDM (1) (1).pptx small presentation for students
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Chinmaya Tiranga quiz Grand Finale.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Microbial disease of the cardiovascular and lymphatic systems
master seminar digital applications in india
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Cell Structure & Organelles in detailed.
O7-L3 Supply Chain Operations - ICLT Program
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Computing-Curriculum for Schools in Ghana
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Lesson notes of climatology university.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
human mycosis Human fungal infections are called human mycosis..pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025

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.