SlideShare a Scribd company logo
1 of 21
Chapter 1
Introduction to Compilers
Compilers and Interpreters
 “Compilation”
◦ Translation of a program written in a
source language into a semantically
equivalent program written in a target
language
◦ Oversimplified view:
2
Compiler
Error messages
Source
Program
Target
Program
Input
Output
Compilers and Interpreters
(cont’d)
 “Interpretation”
◦ Performing the operations implied by the
source program
◦ Oversimplified view:
3
Interpreter
Source
Program
Input
Output
Error messages
Compilers and Interpreters
(cont’d)
 Compiler: a program that translates an
executable program in one language into
an executable program in another
language
 Interpreter: a program that reads an
executable program and produces the
results of running that program
4
The Analysis-Synthesis Model of
Compilation
 There are two parts to compilation:
◦ Analysis
 Breaks up source program into pieces and
imposes a grammatical structure
 Creates intermediate representation of
source program
 Determines the operations and records them in
a tree structure, syntax tree
 Known as front end of compiler
5
The Analysis-Synthesis Model of
Compilation (cont’d)
◦ Synthesis
 Constructs target program from intermediate
representation
 Takes the tree structure and translates the
operations into the target program
 Known as back end of compiler
6
Other Tools that Use the
Analysis-Synthesis Model
 Editors (syntax highlighting)
 Pretty printers (e.g. Doxygen)
 Static checkers (e.g. Lint and Splint)
 Interpreters
 Text formatters (e.g. TeX and LaTeX)
 Silicon compilers (e.g. VHDL)
 Query interpreters/compilers
(Databases)
7
A language-processing
system
8
Preprocessor
Compiler
Assembler
Linker
Skeletal Source Program
Source Program
Target Assembly Program
Relocatable Object Code
Absolute Machine Code
Libraries and
Relocatable Object Files
Try for example:
gcc -v myprog.c
Analysis
 In compiling, analysis has three
phases:
◦ Linear analysis: stream of characters
read from left-to-right and grouped into
tokens; known as lexical analysis or
scanning
◦ Hierarchical analysis: tokens grouped
hierarchically with collective meaning;
known as parsing or syntax analysis
◦ Semantic analysis: check if the program
components fit together meaningfully
9
Lexical analysis
 Characters grouped into tokens.
10
Syntax analysis (Parsing)
 Grouping tokens into grammatical phrases
 Character groups recorded in symbol table
 Represented by a parse tree
11
Syntax analysis (cont’d)
 Hierarchical structure usually
expressed by recursive rules
 Rules for definition of expression:
12
Semantic analysis
 Checks source program for semantic
errors
 Gathers type information for
subsequent code generation (type
checking)
 Identifies operator and operands of
expressions and statements
13
Phases of a compiler
14
Symbol-Table Management
 Symbol table – data structure with a
record for each identifier and its
attributes
 Attributes include storage allocation,
type, scope, etc
 All the compiler phases insert and
modify the symbol table
15
Intermediate code generation
 Program representation for an
abstract machine
 Should have two properties
◦ Easy to produce
◦ Easy to translate into target program
 Three-address code is a commonly
used form – similar to assembly
language
16
Code optimization and generation
 Code Optimization
◦ Improve intermediate code by
producing code that runs faster
 Code Generation
◦ Generate target code, which is machine
code or assembly code
17
The Phases of a Compiler
18
Phase Output Sample
Programmer (source code
producer)
Source string A=B+C;
Scanner (performs lexical
analysis)
Token string ‘A’, ‘=’, ‘B’, ‘+’, ‘C’,
‘;’
And symbol table with names
Parser (performs syntax analysis
based on the grammar of the
programming language)
Parse tree or abstract syntax
tree
;
|
=
/ 
A +
/ 
B C
Semantic analyzer (type checking,
etc)
Annotated parse tree or
abstract syntax tree
Intermediate code generator Three-address code, quads, or
RTL
int2fp B t1
+ t1 C t2
:= t2 A
Optimizer Three-address code, quads, or
RTL
int2fp B t1
+ t1 #2.3 A
Code generator Assembly code MOVF #2.3,r1
ADDF2 r1,r2
The Grouping of Phases
 Compiler front and back ends:
◦ Front end:
 Analysis steps + Intermediate code generation
 Depends primarily on the source language
 Machine independent
◦ Back end:
 Code optimization and generation
 Independent of source language
 Machine dependent
19
The Grouping of Phases
(cont’d)
 Compiler passes:
◦ A collection of phases is done only once (single
pass) or multiple times (multi pass)
 Single pass: reading input, processing, and producing
output by one large compiler program; usually runs faster
 Multi pass: compiler split into smaller programs, each
making a pass over the source; performs better code
optimization
20
Compiler-Construction Tools
 Software development tools are
available to implement one or more
compiler phases
◦ Scanner generators
◦ Parser generators
◦ Syntax-directed translation engines
◦ Automatic code generators
◦ Data-flow engines
21

More Related Content

What's hot (20)

Operator precedence
Operator precedenceOperator precedence
Operator precedence
 
Ooad ppt
Ooad pptOoad ppt
Ooad ppt
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
Symbol Table
Symbol TableSymbol Table
Symbol Table
 
Types of Parser
Types of ParserTypes of Parser
Types of Parser
 
COMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time EnvironmentsCOMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time Environments
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
 
Macro Processor
Macro ProcessorMacro Processor
Macro Processor
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
Software development process
Software development processSoftware development process
Software development process
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
 
Compiler Design Unit 1
Compiler Design Unit 1Compiler Design Unit 1
Compiler Design Unit 1
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Unit 3
Unit 3Unit 3
Unit 3
 

Similar to 1 - Introduction to Compilers.ppt

Chapter-1.pptx compiler Design Course Material
Chapter-1.pptx compiler Design Course MaterialChapter-1.pptx compiler Design Course Material
Chapter-1.pptx compiler Design Course MaterialgadisaAdamu
 
Compiler design and lexical analyser
Compiler design and lexical analyserCompiler design and lexical analyser
Compiler design and lexical analyserabhishek gupta
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilersvijaya603274
 
Chapter One
Chapter OneChapter One
Chapter Onebolovv
 
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
 
C Language Compiler in Python c language compiler using python
C Language Compiler in Python c language compiler using pythonC Language Compiler in Python c language compiler using python
C Language Compiler in Python c language compiler using pythonAmmarAhmed900673
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfDrIsikoIsaac
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introductionRana Ehtisham Ul Haq
 
Concept of compiler in details
Concept of compiler in detailsConcept of compiler in details
Concept of compiler in detailskazi_aihtesham
 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docxvenkatapranaykumarGa
 

Similar to 1 - Introduction to Compilers.ppt (20)

Chapter-1.pptx compiler Design Course Material
Chapter-1.pptx compiler Design Course MaterialChapter-1.pptx compiler Design Course Material
Chapter-1.pptx compiler Design Course Material
 
Compiler design
Compiler designCompiler design
Compiler design
 
Cd econtent link1
Cd econtent link1Cd econtent link1
Cd econtent link1
 
Ch1 (1).ppt
Ch1 (1).pptCh1 (1).ppt
Ch1 (1).ppt
 
CD U1-5.pptx
CD U1-5.pptxCD U1-5.pptx
CD U1-5.pptx
 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
 
Compiler design and lexical analyser
Compiler design and lexical analyserCompiler design and lexical analyser
Compiler design and lexical analyser
 
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
 
Chapter One
Chapter OneChapter One
Chapter One
 
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
 
C Language Compiler in Python c language compiler using python
C Language Compiler in Python c language compiler using pythonC Language Compiler in Python c language compiler using python
C Language Compiler in Python c language compiler using python
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 
Concept of compiler in details
Concept of compiler in detailsConcept of compiler in details
Concept of compiler in details
 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
 
Compiler
Compiler Compiler
Compiler
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 

Recently uploaded

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
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
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
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
 
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
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
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
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
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
 

Recently uploaded (20)

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
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
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
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
 
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
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
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
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
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 )
 

1 - Introduction to Compilers.ppt

  • 2. Compilers and Interpreters  “Compilation” ◦ Translation of a program written in a source language into a semantically equivalent program written in a target language ◦ Oversimplified view: 2 Compiler Error messages Source Program Target Program Input Output
  • 3. Compilers and Interpreters (cont’d)  “Interpretation” ◦ Performing the operations implied by the source program ◦ Oversimplified view: 3 Interpreter Source Program Input Output Error messages
  • 4. Compilers and Interpreters (cont’d)  Compiler: a program that translates an executable program in one language into an executable program in another language  Interpreter: a program that reads an executable program and produces the results of running that program 4
  • 5. The Analysis-Synthesis Model of Compilation  There are two parts to compilation: ◦ Analysis  Breaks up source program into pieces and imposes a grammatical structure  Creates intermediate representation of source program  Determines the operations and records them in a tree structure, syntax tree  Known as front end of compiler 5
  • 6. The Analysis-Synthesis Model of Compilation (cont’d) ◦ Synthesis  Constructs target program from intermediate representation  Takes the tree structure and translates the operations into the target program  Known as back end of compiler 6
  • 7. Other Tools that Use the Analysis-Synthesis Model  Editors (syntax highlighting)  Pretty printers (e.g. Doxygen)  Static checkers (e.g. Lint and Splint)  Interpreters  Text formatters (e.g. TeX and LaTeX)  Silicon compilers (e.g. VHDL)  Query interpreters/compilers (Databases) 7
  • 8. A language-processing system 8 Preprocessor Compiler Assembler Linker Skeletal Source Program Source Program Target Assembly Program Relocatable Object Code Absolute Machine Code Libraries and Relocatable Object Files Try for example: gcc -v myprog.c
  • 9. Analysis  In compiling, analysis has three phases: ◦ Linear analysis: stream of characters read from left-to-right and grouped into tokens; known as lexical analysis or scanning ◦ Hierarchical analysis: tokens grouped hierarchically with collective meaning; known as parsing or syntax analysis ◦ Semantic analysis: check if the program components fit together meaningfully 9
  • 10. Lexical analysis  Characters grouped into tokens. 10
  • 11. Syntax analysis (Parsing)  Grouping tokens into grammatical phrases  Character groups recorded in symbol table  Represented by a parse tree 11
  • 12. Syntax analysis (cont’d)  Hierarchical structure usually expressed by recursive rules  Rules for definition of expression: 12
  • 13. Semantic analysis  Checks source program for semantic errors  Gathers type information for subsequent code generation (type checking)  Identifies operator and operands of expressions and statements 13
  • 14. Phases of a compiler 14
  • 15. Symbol-Table Management  Symbol table – data structure with a record for each identifier and its attributes  Attributes include storage allocation, type, scope, etc  All the compiler phases insert and modify the symbol table 15
  • 16. Intermediate code generation  Program representation for an abstract machine  Should have two properties ◦ Easy to produce ◦ Easy to translate into target program  Three-address code is a commonly used form – similar to assembly language 16
  • 17. Code optimization and generation  Code Optimization ◦ Improve intermediate code by producing code that runs faster  Code Generation ◦ Generate target code, which is machine code or assembly code 17
  • 18. The Phases of a Compiler 18 Phase Output Sample Programmer (source code producer) Source string A=B+C; Scanner (performs lexical analysis) Token string ‘A’, ‘=’, ‘B’, ‘+’, ‘C’, ‘;’ And symbol table with names Parser (performs syntax analysis based on the grammar of the programming language) Parse tree or abstract syntax tree ; | = / A + / B C Semantic analyzer (type checking, etc) Annotated parse tree or abstract syntax tree Intermediate code generator Three-address code, quads, or RTL int2fp B t1 + t1 C t2 := t2 A Optimizer Three-address code, quads, or RTL int2fp B t1 + t1 #2.3 A Code generator Assembly code MOVF #2.3,r1 ADDF2 r1,r2
  • 19. The Grouping of Phases  Compiler front and back ends: ◦ Front end:  Analysis steps + Intermediate code generation  Depends primarily on the source language  Machine independent ◦ Back end:  Code optimization and generation  Independent of source language  Machine dependent 19
  • 20. The Grouping of Phases (cont’d)  Compiler passes: ◦ A collection of phases is done only once (single pass) or multiple times (multi pass)  Single pass: reading input, processing, and producing output by one large compiler program; usually runs faster  Multi pass: compiler split into smaller programs, each making a pass over the source; performs better code optimization 20
  • 21. Compiler-Construction Tools  Software development tools are available to implement one or more compiler phases ◦ Scanner generators ◦ Parser generators ◦ Syntax-directed translation engines ◦ Automatic code generators ◦ Data-flow engines 21