SlideShare a Scribd company logo
Compiler Construction
By Noor wali khan
Uoch
Phases of compiler
• Phase:
• A logical activity which transforms the source code from one representation to
another representation.
• There are eight phases of compiler:
• Lexical Analyzer
• Syntax Analyzer
• Semantic Analyzer
• Intermediate Code Generator
• Code Optimizer
• Code Generator
• Symbol Table Manager
• Error handler
Analysis Portion
Synthesis Portion
Formal
Phases
Informal
Phases
Target Code
Explanation
• The first six phases are called formal phases of
compiler. While the last two are informal phases of
compiler.
• The last two symbol table manager and Error Handler
are not the formal phases of compiler but these help
in the activities of the formal phases.
• The first three phases form the bulk of the analysis
portion and 4, 5, 6 are the synthesis portion of
compiler.
Symbol Table Manager
• It is a data structure which contains a record for each
keyword, reserved word, and identifier in the source
program, with fields for various attributes of the
identifier.
• It serves as a dictionary for the compiler.
• Here the identifier can be:
• Variable name
• Function name
Symbol Table Manager
• In case of a variable name the attributes are:
• Type of variable
• Scope of variable
• Storage classes
• Size
• Life time
• In case of function name the attributes are:
• Name
• Method of passing arguments
• Order of arguments
• Return type
Symbol Table Manager
• Different phases of compiler enters information into symbol table e.g.
• lexical analyzer enters identifier names into the symbol table.
• Semantic analyzer enters type information into the symbol table
• e.t.c
• Different phases use information from symbol table e.g.
• Semantic analyzer frequently uses symbol table information
Continue to Next lecture

More Related Content

PPTX
phases of compiler-analysis phase
PPT
phases of a compiler
PPTX
Compiler design
PDF
Phases of Compiler
PPTX
Phases of Compiler
PPSX
Spr ch-05-compilers
PPTX
Basic of compiler
PPTX
Phases of a Compiler
phases of compiler-analysis phase
phases of a compiler
Compiler design
Phases of Compiler
Phases of Compiler
Spr ch-05-compilers
Basic of compiler
Phases of a Compiler

What's hot (20)

PDF
Compiler Design Introduction
PPTX
Phases of-compiler
PPTX
Phases of compiler
PPT
Passes of compilers
PPTX
PPT
what is compiler and five phases of compiler
PPT
Analysis of the source program
PPT
Cpcs302 1
PPT
Phases of compiler
PPT
Lexical analyzer
PDF
Phases of the Compiler - Systems Programming
PDF
Lecture1 introduction compilers
PPTX
The analysis synthesis model of compilation
PPT
PPT
Compiler Construction
PPT
Cd unit i
PPTX
Compiler Chapter 1
PPT
Compiler1
PPTX
Error detection recovery
DOC
Compiler Design(NANTHU NOTES)
Compiler Design Introduction
Phases of-compiler
Phases of compiler
Passes of compilers
what is compiler and five phases of compiler
Analysis of the source program
Cpcs302 1
Phases of compiler
Lexical analyzer
Phases of the Compiler - Systems Programming
Lecture1 introduction compilers
The analysis synthesis model of compilation
Compiler Construction
Cd unit i
Compiler Chapter 1
Compiler1
Error detection recovery
Compiler Design(NANTHU NOTES)
Ad

Similar to Compiler lecture 03 (20)

PPTX
System software module 4 presentation file
PPTX
Compiler Construction
PPTX
Principles of Compiler Design - Introduction
PPTX
Unit 1.pptx
PPTX
Presentation 1(Compiler Construction).pptx
PDF
Phases of Compiler.pdf
PPTX
Phases of Compiler.pptx
PPT
Assembler
PPTX
Compiler Design Introduction With Design
PPTX
Chapter 1.pptx
PDF
Compilers Principles, Practice & Tools Compilers
PDF
Principles of Compiler Design
PPT
Compier Design_Unit I.ppt
PPT
Compier Design_Unit I.ppt
PPTX
16 compiler-151129060845-lva1-app6892-converted.pptx
PPTX
COMPILER DESIGN PPTS.pptx
PPT
compiler construvtion aaaaaaaaaaaaaaaaaads
PPTX
Valuable Information on Lexical Analysis in Compiler Design
PPTX
Compiler Construction-2 for bs computer science.pptx
PPT
Compier Design_Unit I_SRM.ppt
System software module 4 presentation file
Compiler Construction
Principles of Compiler Design - Introduction
Unit 1.pptx
Presentation 1(Compiler Construction).pptx
Phases of Compiler.pdf
Phases of Compiler.pptx
Assembler
Compiler Design Introduction With Design
Chapter 1.pptx
Compilers Principles, Practice & Tools Compilers
Principles of Compiler Design
Compier Design_Unit I.ppt
Compier Design_Unit I.ppt
16 compiler-151129060845-lva1-app6892-converted.pptx
COMPILER DESIGN PPTS.pptx
compiler construvtion aaaaaaaaaaaaaaaaaads
Valuable Information on Lexical Analysis in Compiler Design
Compiler Construction-2 for bs computer science.pptx
Compier Design_Unit I_SRM.ppt
Ad

More from University of Chitral (15)

PPTX
Compiler lecture 07
PPTX
Compiler lecture 06
PPTX
Compiler lecture 04
PPTX
Compiler lecture 05
PPTX
Oop lecture 06
PPTX
Oop lecture 05
PPTX
OOP lecture 04
PPTX
Compiler lecture 05
PPTX
Compiler lecture 04
PPTX
Compiler lecture 01
PPTX
Compiler lecture 02
PPTX
O op lecture 04
PPTX
Oop lecture 03
PPTX
Oop lecture 02
PPTX
Oop lecture 01
Compiler lecture 07
Compiler lecture 06
Compiler lecture 04
Compiler lecture 05
Oop lecture 06
Oop lecture 05
OOP lecture 04
Compiler lecture 05
Compiler lecture 04
Compiler lecture 01
Compiler lecture 02
O op lecture 04
Oop lecture 03
Oop lecture 02
Oop lecture 01

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
master seminar digital applications in india
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Insiders guide to clinical Medicine.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Classroom Observation Tools for Teachers
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
TR - Agricultural Crops Production NC III.pdf
Anesthesia in Laparoscopic Surgery in India
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
master seminar digital applications in india
Supply Chain Operations Speaking Notes -ICLT Program
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Insiders guide to clinical Medicine.pdf
RMMM.pdf make it easy to upload and study
01-Introduction-to-Information-Management.pdf
Pharma ospi slides which help in ospi learning
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Basic Mud Logging Guide for educational purpose
Renaissance Architecture: A Journey from Faith to Humanism
Abdominal Access Techniques with Prof. Dr. R K Mishra
Classroom Observation Tools for Teachers

Compiler lecture 03

  • 2. Phases of compiler • Phase: • A logical activity which transforms the source code from one representation to another representation. • There are eight phases of compiler: • Lexical Analyzer • Syntax Analyzer • Semantic Analyzer • Intermediate Code Generator • Code Optimizer • Code Generator • Symbol Table Manager • Error handler Analysis Portion Synthesis Portion Formal Phases Informal Phases
  • 4. Explanation • The first six phases are called formal phases of compiler. While the last two are informal phases of compiler. • The last two symbol table manager and Error Handler are not the formal phases of compiler but these help in the activities of the formal phases. • The first three phases form the bulk of the analysis portion and 4, 5, 6 are the synthesis portion of compiler.
  • 5. Symbol Table Manager • It is a data structure which contains a record for each keyword, reserved word, and identifier in the source program, with fields for various attributes of the identifier. • It serves as a dictionary for the compiler. • Here the identifier can be: • Variable name • Function name
  • 6. Symbol Table Manager • In case of a variable name the attributes are: • Type of variable • Scope of variable • Storage classes • Size • Life time • In case of function name the attributes are: • Name • Method of passing arguments • Order of arguments • Return type
  • 7. Symbol Table Manager • Different phases of compiler enters information into symbol table e.g. • lexical analyzer enters identifier names into the symbol table. • Semantic analyzer enters type information into the symbol table • e.t.c • Different phases use information from symbol table e.g. • Semantic analyzer frequently uses symbol table information