SlideShare une entreprise Scribd logo
1  sur  23
Compiler Construction
(Introduction)
Lecture-1
By
Shahid Akbar
MS (Computer Science)
Goals Of This Course
Know how to build a compiler for a (simplified) (programming)
language
Know how to use compiler construction tools, such as generators for
scanners (Lexical Analyzer) and parsers(Semantic Analyzer )
Be able to write LL(1), LR(1), and LALR(1) grammars (for new
languages)
Be familiar with compiler analysis and optimization techniques
8-Apr-17 2
Grading Policy
 Mid Term 20
 Final Term 60
 Quizzes / Assignments 20
Total 100
Note= 75% Attendance is compulsory for Exams
8-Apr-17
3
Textbook
Compilers: Principles, Techniques, and Tools, 2/E.
Alfred V. Aho, Columbia University
Monica S. Lam, Stanford University
Ravi Sethi, Avaya Labs
Jeffrey D. Ullman, Stanford University
Dragon
What is Compiler?
 The world as we know it depends on programming languages,
C, C++, Java, Web programming, and etc.
 All the software running on all the computers was written in some programming
language.
 Before a program can be run, it first must be translated into a form in which it
can be executed by a computer.
The software systems that do this translation are called compilers.
Different compilers
 VC, VC++ (visual compiler, Microsoft products)
 GCC
Dev C compiler , where Dev C is Integrated development environment (IDE)
 JavaC
Java compiler
 FORTRAN
 Pascal
 Visual Basic (internet programming)
Why Compilation?
The conversion of high level language into low level object code and
machine code.
High level language can be understandable by the human , contain
English words and phrases, but computer can only understand
machine language (Low level language), that’s we need compilation
for interaction between human and computer.
Computer Languages-1
 Machine language (Low Level Language)
 Only language computer directly understands
 Defined by hardware design
 Machine-dependent
 Generally consist of strings of numbers
 Ultimately 0s and 1s
 Instruct computers to perform elementary operations
 One at a time
 Cumbersome for humans
 Example:
+1300042774
+1400593419
+1200274027
8
Computer Languages-2
 Assembly language
 English-like abbreviations representing elementary
computer operations
 Clearer to humans
 Incomprehensible to computers
 Translator programs (assemblers)
 Convert to machine language
 Example:
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
9
Computer Languages-3
 High-level languages
 Similar to everyday English, use common mathematical
notations
 Single statements accomplish substantial tasks
 Assembly language requires many instructions to
accomplish simple tasks
 Translator programs (compilers)
 Convert to machine language
 Interpreter programs
 Directly execute high-level language programs
 Example:
grossPay = basePay + overTimePay
10
A compiler is program that covert high level language to
Assembly languages , similarly an Assembler is a program that
convert the Assembly language to Machine Level language
Compiler Vs Assembler
Assembler VS Compiler
It is used to translate the program written in assembly language
into Machine language.
An assembler perform the translation process in the similar way
as compiler, but Assembler is a translator program for low
level programming language , while a compiler is the translator
program for high level languages
Compilers and Interpreters
“Compilation”
Translation of a program written in a source language into a
semantically equivalent program written in a target language.
An important role of the compiler is to report any errors in the
source program , errors are detected during the translation
process.
Compiler
Error messages
Source
Program
(HLL)
Target
Program
Input
Output
Execution
Compilation (Error Checking
(A L L)
Compilers and Interpreters (cont’d)
Interpreter
Source
Program
Input (Execution)
Output
Error messages
“Interpretation”
 Language processor
Performing the operations implied in the source program on
input supplied by users.
Complier Vs Interpreter
 In interpreter both execution and compilation process are combined ,At first a
statement is compiled and then executed.
 In compiler , A program is compiled one time and it can be execute again and
again until you need.
 While in interpreter A program/statement will be compiled and executed again
and again (depend on number of execution)
 e.g: if you need to execute a program 100 times, it requires 100 time compilation
and 100 times execution in interpreter
 Note : 1) Compiler is fast than interpreter (Why)
2) Error diagnosis of interpreter is better than compiler
Interpreter Compiler
Translates program statement by statement at a
time.
Scans the entire program and translates it as a
whole into machine code
It takes less amount of time to analyze the
source code but the overall execution time is
slower.(Time consuming)
It takes large amount of time to analyze the
source code but the overall execution time is
comparatively faster.
Continues translating the program until the first
error is met, in which case it stops. Hence
debugging is easy.
It generates the error message only after
scanning the whole program. Hence debugging
is comparatively hard.
Programming language like Python, Ruby use
interpreters.
Programming language like C, C++ use
compilers.
Compiler History
1952: First compiler (linker/loader) written by Grace Hopper for A-0
programming language
1957: First complete compiler for FORTRAN by John Backus and team
1960: COBOL compilers for multiple architectures
1962: First self-hosting compiler for LISP
Compiler Construction requirements
Programming languages (parameter passing, variable scoping,
memory allocation, etc)
theory (automata, context-free languages, etc)
Algorithms and data structures (hash tables, graph algorithms,
dynamic programming, etc)
Computer architecture (assembly programming)
Software Engineering.
Compiler Qualities
Make the Code Accurate
Compiler runs fast
Compile time proportional to program size
Support for separate compilation
Efficient to check syntax errors
Works well with the debugger
Good diagnostics for flow anomalies
Cross language calls --- interface compatibilities
Consistent, predictable optimization
A General language processing System
Preprocessor
HLL
Pure HLL
Compiler
Assembler
Linker/Loader
Assembly Language
Relocatable machine Code
Target Machine Code
#include < ?? . h >
# define Const variable
File Inclusion
Macro Expansion
NO preprocessor Directives
MOV a, R1
ADD #2, R1
MOV R1, b
i.e. b:= a +2
0001 01 00 00000000
0011 01 10 00000010
0010 01 00 00000100
Loading the data(relocatable
machine Code) and instruction to the
proper locations
Phases of Compiler
Lexical Analyzer
Syntax Analyzer
Semantic Analyzer
Intermediate Code
Generator
Code Optimizer
Target Code Generator
Character Stream (H L L)
Token Stream
Syntax Tree
Syntax Tree
(semantically verified
meaningful)
3 Address Code
Assembly code
Symbol Table
Reduce size of program
(number of lines)
Error Handler
Phase Output Sample
Programmer Source string A=B+C;
Scanner (performs lexical
analysis)
Token string ‘A’, ‘=’, ‘B’, ‘+’, ‘C’, ‘;’
And symbol table for identifiers
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)
Parse tree or abstract syntax tree
Intermediate code generator Three-address code int2fp B t1
+ t1 C t2
:= t2 A
Optimizer Three-address code int2fp B t1
+ t1 #2.3 A
Code generator Assembly code MOVF #2.3,r1
ADDF2 r1,r2
MOVF r2,A
Peephole optimizer Assembly code ADDF2 #2.3,r2
MOVF r2,A

Contenu connexe

Tendances

Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
Abha Damani
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principles
NIKANOR THOMAS
 

Tendances (20)

COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
Compilers
CompilersCompilers
Compilers
 
Programming Languages / Translators
Programming Languages / TranslatorsProgramming Languages / Translators
Programming Languages / Translators
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
 
What is Compiler?
What is Compiler?What is Compiler?
What is Compiler?
 
Language translator
Language translatorLanguage translator
Language translator
 
Language Translator ( Compiler)
Language Translator ( Compiler)Language Translator ( Compiler)
Language Translator ( Compiler)
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwares
 
Algorithms - Introduction to computer programming
Algorithms - Introduction to computer programmingAlgorithms - Introduction to computer programming
Algorithms - Introduction to computer programming
 
Compiler design tutorial
Compiler design tutorialCompiler design tutorial
Compiler design tutorial
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principles
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Computer Language Translator
Computer Language TranslatorComputer Language Translator
Computer Language Translator
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Computer
ComputerComputer
Computer
 
LANGUAGE TRANSLATOR
LANGUAGE TRANSLATORLANGUAGE TRANSLATOR
LANGUAGE TRANSLATOR
 
13 A Programing Languages (IT) Lecture Slide
13 A Programing Languages (IT) Lecture Slide13 A Programing Languages (IT) Lecture Slide
13 A Programing Languages (IT) Lecture Slide
 
df
dfdf
df
 

Similaire à Lecture1 compilers

Similaire à Lecture1 compilers (20)

1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
COMPILER DESIGN.docx
COMPILER DESIGN.docxCOMPILER DESIGN.docx
COMPILER DESIGN.docx
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
 
Ss ui lecture 1
Ss ui lecture 1Ss ui lecture 1
Ss ui lecture 1
 
SS UI Lecture 1
SS UI Lecture 1SS UI Lecture 1
SS UI Lecture 1
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
Compiler an overview
Compiler  an overviewCompiler  an overview
Compiler an overview
 
Ic lecture8
Ic lecture8 Ic lecture8
Ic lecture8
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
X-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdfX-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdf
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Computer program, computer languages, computer software
Computer program, computer languages, computer softwareComputer program, computer languages, computer software
Computer program, computer languages, computer software
 

Dernier

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Dernier (20)

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 

Lecture1 compilers

  • 2. Goals Of This Course Know how to build a compiler for a (simplified) (programming) language Know how to use compiler construction tools, such as generators for scanners (Lexical Analyzer) and parsers(Semantic Analyzer ) Be able to write LL(1), LR(1), and LALR(1) grammars (for new languages) Be familiar with compiler analysis and optimization techniques 8-Apr-17 2
  • 3. Grading Policy  Mid Term 20  Final Term 60  Quizzes / Assignments 20 Total 100 Note= 75% Attendance is compulsory for Exams 8-Apr-17 3
  • 4. Textbook Compilers: Principles, Techniques, and Tools, 2/E. Alfred V. Aho, Columbia University Monica S. Lam, Stanford University Ravi Sethi, Avaya Labs Jeffrey D. Ullman, Stanford University Dragon
  • 5. What is Compiler?  The world as we know it depends on programming languages, C, C++, Java, Web programming, and etc.  All the software running on all the computers was written in some programming language.  Before a program can be run, it first must be translated into a form in which it can be executed by a computer. The software systems that do this translation are called compilers.
  • 6. Different compilers  VC, VC++ (visual compiler, Microsoft products)  GCC Dev C compiler , where Dev C is Integrated development environment (IDE)  JavaC Java compiler  FORTRAN  Pascal  Visual Basic (internet programming)
  • 7. Why Compilation? The conversion of high level language into low level object code and machine code. High level language can be understandable by the human , contain English words and phrases, but computer can only understand machine language (Low level language), that’s we need compilation for interaction between human and computer.
  • 8. Computer Languages-1  Machine language (Low Level Language)  Only language computer directly understands  Defined by hardware design  Machine-dependent  Generally consist of strings of numbers  Ultimately 0s and 1s  Instruct computers to perform elementary operations  One at a time  Cumbersome for humans  Example: +1300042774 +1400593419 +1200274027 8
  • 9. Computer Languages-2  Assembly language  English-like abbreviations representing elementary computer operations  Clearer to humans  Incomprehensible to computers  Translator programs (assemblers)  Convert to machine language  Example: LOAD BASEPAY ADD OVERPAY STORE GROSSPAY 9
  • 10. Computer Languages-3  High-level languages  Similar to everyday English, use common mathematical notations  Single statements accomplish substantial tasks  Assembly language requires many instructions to accomplish simple tasks  Translator programs (compilers)  Convert to machine language  Interpreter programs  Directly execute high-level language programs  Example: grossPay = basePay + overTimePay 10
  • 11. A compiler is program that covert high level language to Assembly languages , similarly an Assembler is a program that convert the Assembly language to Machine Level language Compiler Vs Assembler
  • 12. Assembler VS Compiler It is used to translate the program written in assembly language into Machine language. An assembler perform the translation process in the similar way as compiler, but Assembler is a translator program for low level programming language , while a compiler is the translator program for high level languages
  • 13. Compilers and Interpreters “Compilation” Translation of a program written in a source language into a semantically equivalent program written in a target language. An important role of the compiler is to report any errors in the source program , errors are detected during the translation process. Compiler Error messages Source Program (HLL) Target Program Input Output Execution Compilation (Error Checking (A L L)
  • 14. Compilers and Interpreters (cont’d) Interpreter Source Program Input (Execution) Output Error messages “Interpretation”  Language processor Performing the operations implied in the source program on input supplied by users.
  • 15. Complier Vs Interpreter  In interpreter both execution and compilation process are combined ,At first a statement is compiled and then executed.  In compiler , A program is compiled one time and it can be execute again and again until you need.  While in interpreter A program/statement will be compiled and executed again and again (depend on number of execution)  e.g: if you need to execute a program 100 times, it requires 100 time compilation and 100 times execution in interpreter  Note : 1) Compiler is fast than interpreter (Why) 2) Error diagnosis of interpreter is better than compiler
  • 16. Interpreter Compiler Translates program statement by statement at a time. Scans the entire program and translates it as a whole into machine code It takes less amount of time to analyze the source code but the overall execution time is slower.(Time consuming) It takes large amount of time to analyze the source code but the overall execution time is comparatively faster. Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. It generates the error message only after scanning the whole program. Hence debugging is comparatively hard. Programming language like Python, Ruby use interpreters. Programming language like C, C++ use compilers.
  • 17. Compiler History 1952: First compiler (linker/loader) written by Grace Hopper for A-0 programming language 1957: First complete compiler for FORTRAN by John Backus and team 1960: COBOL compilers for multiple architectures 1962: First self-hosting compiler for LISP
  • 18. Compiler Construction requirements Programming languages (parameter passing, variable scoping, memory allocation, etc) theory (automata, context-free languages, etc) Algorithms and data structures (hash tables, graph algorithms, dynamic programming, etc) Computer architecture (assembly programming) Software Engineering.
  • 19. Compiler Qualities Make the Code Accurate Compiler runs fast Compile time proportional to program size Support for separate compilation Efficient to check syntax errors Works well with the debugger Good diagnostics for flow anomalies Cross language calls --- interface compatibilities Consistent, predictable optimization
  • 20. A General language processing System Preprocessor HLL Pure HLL Compiler Assembler Linker/Loader Assembly Language Relocatable machine Code Target Machine Code #include < ?? . h > # define Const variable File Inclusion Macro Expansion NO preprocessor Directives MOV a, R1 ADD #2, R1 MOV R1, b i.e. b:= a +2 0001 01 00 00000000 0011 01 10 00000010 0010 01 00 00000100 Loading the data(relocatable machine Code) and instruction to the proper locations
  • 21. Phases of Compiler Lexical Analyzer Syntax Analyzer Semantic Analyzer Intermediate Code Generator Code Optimizer Target Code Generator Character Stream (H L L) Token Stream Syntax Tree Syntax Tree (semantically verified meaningful) 3 Address Code Assembly code Symbol Table Reduce size of program (number of lines) Error Handler
  • 22.
  • 23. Phase Output Sample Programmer Source string A=B+C; Scanner (performs lexical analysis) Token string ‘A’, ‘=’, ‘B’, ‘+’, ‘C’, ‘;’ And symbol table for identifiers 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) Parse tree or abstract syntax tree Intermediate code generator Three-address code int2fp B t1 + t1 C t2 := t2 A Optimizer Three-address code int2fp B t1 + t1 #2.3 A Code generator Assembly code MOVF #2.3,r1 ADDF2 r1,r2 MOVF r2,A Peephole optimizer Assembly code ADDF2 #2.3,r2 MOVF r2,A

Notes de l'éditeur

  1. 2
  2. 3