SlideShare a Scribd company logo
1 of 13
DLP Presentation
PREPARED BY:
20CE093 NEEL PATEL
20CE108 UDAY PATEL
20CE112 YASH PATEL
Guided By :-
Prof. Trusha Patel
Table Of Content
1. Phases Of Compiler
2. Statement
3. Phase 1: Lexical Analyser
4. Phase 2: Syntax Analyser
5. Phase 3: Semantic Analyser
6. Phase 4: Intermediate Code Generator
7. Phase 5: Code Optimizer
8. Phase 6: Code Generator
Phases Of Compiler
Statement
Phase 1: Lexical Analyser
1. The lexical analysis phase is the first step in the compilation process.
2. Its main purpose is to analyse the source code and break it down into individual tokens
3. These tokens are then passed on to the next phase , which is syntax analysis phase
Code:
Tokens
Phase 2: Syntax Analysis
 The syntax analysis is responsible for analysing the structure of the code and ensuring that it
adheres to the rules of the programming language.
This phase uses a grammar to parse the tokens generated in the previous phase and build a
syntax tree(Parse tree).
If a>5 then y=10 else y=20
Expression Statement Statement
If Statement
Statement
Phase 3: Semantic Analysis
 The semantic analysis phase is responsible for analysing the meaning of the
code and ensuring that it makes sense.
This phase checks for things like type compatibility, variable declaration and
function calls. If the code does not make sense errors are generated.
Task of semantic analyser:
1). Type checking
2). Scope checking
3).Handling errors
Cont…
In this semantic tree, I've annotated 'x' and 'y'
wi t h their respective types ('int’).
 The '>' operator represents a comparison between
'x' and 5, which evaluates t o a boolean (true or
false) value.
 The '=' operator represents an assignment o f 10
t o 'y' in t h e 'if' block and 20 t o 'y' in t h e 'else' block.
Phase 4: Intermediate Code Generator
Intermediate code generator phase is responsible for generating an
intermediate representation of the code that can easily translated into machine
code
This phase takes the syntax tree generated in previous phase and converts it
into a form that can be optimized and translated into machine code.
Intermediate code:
1: if x > 5 goto L4
2: y = 20
3: goto L5
4: y = 10
Phase 5: Code Optimizer
Code optimization is a program modification strategy that endeavours to enhance the
intermediate code, so a program utilizes the least potential memory.
It minimizes its CPU time and offers high speed.
Phase 6: Code Generator
THANK YOU

More Related Content

Similar to DLP Presentation on Compiler Phases

Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine LearningStudent
 
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.pdfDrIsikoIsaac
 
1-Phases of compiler-26-04-2023.pptx
1-Phases of compiler-26-04-2023.pptx1-Phases of compiler-26-04-2023.pptx
1-Phases of compiler-26-04-2023.pptxvenkatapranaykumarGa
 
1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdfSemsemSameer1
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilersvijaya603274
 
265 ge8151 problem solving and python programming - 2 marks with answers
265   ge8151 problem solving and python programming - 2 marks with answers265   ge8151 problem solving and python programming - 2 marks with answers
265 ge8151 problem solving and python programming - 2 marks with answersvithyanila
 
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
 

Similar to DLP Presentation on Compiler Phases (20)

Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
Assignment4
Assignment4Assignment4
Assignment4
 
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
 
Phases of Compiler.pdf
Phases of Compiler.pdfPhases of Compiler.pdf
Phases of Compiler.pdf
 
1-Phases of compiler-26-04-2023.pptx
1-Phases of compiler-26-04-2023.pptx1-Phases of compiler-26-04-2023.pptx
1-Phases of compiler-26-04-2023.pptx
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Phases of Compiler.pptx
Phases of Compiler.pptxPhases of Compiler.pptx
Phases of Compiler.pptx
 
Compiler presentaion
Compiler presentaionCompiler presentaion
Compiler presentaion
 
Lecture 10 compiler i
Lecture 10 compiler iLecture 10 compiler i
Lecture 10 compiler i
 
Compiler
Compiler Compiler
Compiler
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
 
Ss ui lecture 2
Ss ui lecture 2Ss ui lecture 2
Ss ui lecture 2
 
Turbo prolog 2.0 basics
Turbo prolog 2.0 basicsTurbo prolog 2.0 basics
Turbo prolog 2.0 basics
 
1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 
265 ge8151 problem solving and python programming - 2 marks with answers
265   ge8151 problem solving and python programming - 2 marks with answers265   ge8151 problem solving and python programming - 2 marks with answers
265 ge8151 problem solving and python programming - 2 marks with answers
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
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
 
Assignment1
Assignment1Assignment1
Assignment1
 

More from 20CE112YASHPATEL

InternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptxInternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptx20CE112YASHPATEL
 
Data_Processing_and_communication_bluetooth.pptx
Data_Processing_and_communication_bluetooth.pptxData_Processing_and_communication_bluetooth.pptx
Data_Processing_and_communication_bluetooth.pptx20CE112YASHPATEL
 
Communication Technologies in IOT.pptx
Communication Technologies in IOT.pptxCommunication Technologies in IOT.pptx
Communication Technologies in IOT.pptx20CE112YASHPATEL
 
Network_Layer_and_Internet_Protocols_IPv.pptx
Network_Layer_and_Internet_Protocols_IPv.pptxNetwork_Layer_and_Internet_Protocols_IPv.pptx
Network_Layer_and_Internet_Protocols_IPv.pptx20CE112YASHPATEL
 
Money Manager Presentation-2.pptx
Money Manager Presentation-2.pptxMoney Manager Presentation-2.pptx
Money Manager Presentation-2.pptx20CE112YASHPATEL
 

More from 20CE112YASHPATEL (8)

InternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptxInternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptx
 
Data_Processing_and_communication_bluetooth.pptx
Data_Processing_and_communication_bluetooth.pptxData_Processing_and_communication_bluetooth.pptx
Data_Processing_and_communication_bluetooth.pptx
 
Communication Technologies in IOT.pptx
Communication Technologies in IOT.pptxCommunication Technologies in IOT.pptx
Communication Technologies in IOT.pptx
 
RFID.pptx
RFID.pptxRFID.pptx
RFID.pptx
 
Network_Layer_and_Internet_Protocols_IPv.pptx
Network_Layer_and_Internet_Protocols_IPv.pptxNetwork_Layer_and_Internet_Protocols_IPv.pptx
Network_Layer_and_Internet_Protocols_IPv.pptx
 
Project.pptx
Project.pptxProject.pptx
Project.pptx
 
Prolog PPT_merged.pdf
Prolog PPT_merged.pdfProlog PPT_merged.pdf
Prolog PPT_merged.pdf
 
Money Manager Presentation-2.pptx
Money Manager Presentation-2.pptxMoney Manager Presentation-2.pptx
Money Manager Presentation-2.pptx
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
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
 
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
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
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
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
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...
 
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🔝
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
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
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 

DLP Presentation on Compiler Phases

  • 1. DLP Presentation PREPARED BY: 20CE093 NEEL PATEL 20CE108 UDAY PATEL 20CE112 YASH PATEL Guided By :- Prof. Trusha Patel
  • 2. Table Of Content 1. Phases Of Compiler 2. Statement 3. Phase 1: Lexical Analyser 4. Phase 2: Syntax Analyser 5. Phase 3: Semantic Analyser 6. Phase 4: Intermediate Code Generator 7. Phase 5: Code Optimizer 8. Phase 6: Code Generator
  • 5. Phase 1: Lexical Analyser 1. The lexical analysis phase is the first step in the compilation process. 2. Its main purpose is to analyse the source code and break it down into individual tokens 3. These tokens are then passed on to the next phase , which is syntax analysis phase Code:
  • 7. Phase 2: Syntax Analysis  The syntax analysis is responsible for analysing the structure of the code and ensuring that it adheres to the rules of the programming language. This phase uses a grammar to parse the tokens generated in the previous phase and build a syntax tree(Parse tree). If a>5 then y=10 else y=20 Expression Statement Statement If Statement Statement
  • 8. Phase 3: Semantic Analysis  The semantic analysis phase is responsible for analysing the meaning of the code and ensuring that it makes sense. This phase checks for things like type compatibility, variable declaration and function calls. If the code does not make sense errors are generated. Task of semantic analyser: 1). Type checking 2). Scope checking 3).Handling errors
  • 9. Cont… In this semantic tree, I've annotated 'x' and 'y' wi t h their respective types ('int’).  The '>' operator represents a comparison between 'x' and 5, which evaluates t o a boolean (true or false) value.  The '=' operator represents an assignment o f 10 t o 'y' in t h e 'if' block and 20 t o 'y' in t h e 'else' block.
  • 10. Phase 4: Intermediate Code Generator Intermediate code generator phase is responsible for generating an intermediate representation of the code that can easily translated into machine code This phase takes the syntax tree generated in previous phase and converts it into a form that can be optimized and translated into machine code. Intermediate code: 1: if x > 5 goto L4 2: y = 20 3: goto L5 4: y = 10
  • 11. Phase 5: Code Optimizer Code optimization is a program modification strategy that endeavours to enhance the intermediate code, so a program utilizes the least potential memory. It minimizes its CPU time and offers high speed.
  • 12. Phase 6: Code Generator