SlideShare une entreprise Scribd logo
1  sur  42
Compiler Design
(CSE-405-F)
Akhil Kaushik
Asstt. Prof., CE Deptt.,
TIT Bhiwani
Programming….Why?
What is a Compiler?
• A compiler is a computer program (or set of
programs) that transforms source code written in a
high level language (the source language) into low
level language (the target language may be assembly
language or machine language (0,1)).
What is a Compiler?
What is a Compiler?
Source Language Target Language
Introduction
Compiler basically does two things:
• Analysis: Compiling source code & detecting
errors in it.
• Synthesis: Translating the source code into
object code depending upon the type of
machine.
Introduction
• Program errors are difficult to track, if the
compiler is wrongly designed.
• Hence, compiler construction is a very
tedious and long process.
One-pass Compiler
• It compiles the that passes through the source
code of each compilation unit only once.
• They are faster than multi-pass compiler.
• Their efficiency is limited because they don’t
produce intermediate codes which can be
refined easily.
• Also known as ‘Narrow Compiler’.
Multi-pass Compiler
• It processes the source code or abstract syntax
tree of a program several times.
• It may create one or more intermediate codes
(easy to refine).
• Each pass takes output of previous phase as
input; hence requires less memory.
• Also known as ‘Wide Compiler’.
Type of Languages
1. Binary Level
Language
2. Assembly Level
Language
3. High Level
Language
Need for programming languages?
• Closer to human thinking behavior.
• Program’s size is shorter.
• Error detection is easy.
• Same program can be compiled in accordance
to different machine architectures.
History
• Software for early computers were
written in assembly language.
• The need of reusability of code gave
birth to programming languages.
• This need grow huge to overcome the
cost restriction of compiler.
History
• The concept of machine independent
programming gave birth to the need of
compilers in 1950s.
• The 1st compiler was written by
Grace Hopper in 1952 for A-0
programming language.
History
• The 1st complete compiler was developed by
FORTRAN team lead by John Backus @ IBM in
1957.
• COBOL was the 1st language to be compiled on
multiple platforms in 1960.
History
• Earlier compilers were written in
assembly languages.
• The 1st compiler in HLL was
created for LISP by Tim Hart &
Mike Levin @ MIT, USA in 1962,
which was a self-hosting
Compiler.
History
• Most compilers are made in C or Pascal
languages.
• However the trend is changing to self-hosting
compilers, which can compile the source code of
the same language in which they are created.
Why Study Compiler?
• Its essential to understand the
heart of programming by
computer science engineering
students.
• There may be need of
designing a compiler for any
software language in the
profession.
Why Study Compiler?
• Increases understanding of
language semantics.
• Helps to handle language
performance issues.
• Opportunity for non-trivial
programming project
Translators
• It is important to understand that compiler is a
kind of translator, which translates high level
language (human understandable) to low-level
language(machine understandable).
Translators
Translators - Preprocessor
• It is a program that processes its input data to
produce output that is used as input to another
program.
• The output is said to be a preprocessed form of the
input data, which is often used by some subsequent
programs like compilers.
Translators - Preprocessor
• The amount and kind of processing done depends on
the nature of the preprocessor.
• some preprocessors are only capable of performing
simple textual substitutions and macro expansions,
while others have the power of full-
fledged programming languages.
• It can also include macro processing, file inclusion and
language extensions.
Translators - Interpreter
• It is another common kind of language processor.
• Instead of producing a target program as a
translation, it directly execute the operations
specified in the source program on inputs supplied
by the user.
Translators - Interpreter
• This software converts the high-level language
into low-level language line by line.
• It takes less memory than compiler.
• It takes more time than compiler.
• It is more efficient in error detection than
compiler.
• It takes more time to build.
Translators - Interpreter
• Java language processors combine compilation
and interpretation.
• A Java source program may first be compiled into
an intermediate form called bytecodes.
• The bytecodes are then interpreted by a virtual
machine.
• A benefit of this arrangement is that bytecodes
compiled on one machine can be interpreted on
another machine, perhaps across a network.
Translators - Interpreter
Translators - Assembler
• This software converts the assembly language
(assembly instruction mnemonics) into machine
level language (opcodes i.e. 0,1).
• It offers reusability of assembly codes on different
machine platforms.
Translators - Assembler
• It generates instructions by evaluating the
mnemonics (symbols) in operation field and find
the value of symbol and literals to produce
machine code.
• Now, if assembler do all this work in one scan then
it is called single pass assembler, otherwise if it
does in multiple scans then called multiple pass
assembler.
Translators - Assembler
• Pass-1:
– Define symbols and literals and remember them in
symbol table and literal table respectively.
– Keep track of location counter
– Process pseudo-operations
• Pass-2:
– Generate object code by converting symbolic op-code
into respective numeric op-code
– Generate data for literals and look for values of
symbols
Translators - Assembler
Translators - Linker
• A linker is a program that allows a user
to link library programs or separate
modules of code into their own
programs.
• It is used to combine different modules
of object code into one single
executable code program.
Translators - Linker
• This may involve combining a program with library
programs, or involve recombining blocks of object
code from the same program, or a mixture of both.
• The linker program is used to recombine the
blocks of object code in RAM to get a working full
program.
• Linker is helpful if there is a shortage of RAM.
Translators - Loader
• A loader is a piece of software that chooses
exactly where to put object code in RAM, ready for
it to be run.
• It also adjusts the memory references in programs.
Translators - Loader
• Programs can be written by programmers using
either ‘absolute addressing’ or ‘relative addressing’.
• Relative addressing is more common because then
the loader can put the program anywhere in RAM -
absolute addressing isn't flexible.
• Linker & Loader may overlap.
Translators - Loader
Translators - Cross-Compiler
• If the compiled program can run on a computer
whose C.P.U or O.S is different from the one on
which the compiler runs, the compiler is known
as a cross-complier.
Translators - Cross-Compiler
Translator – Language Converter
• Also called Language Translator / Source to
source translator.
• It converts programs in one high-level language to
another high-level language.
• Ex: Cfront converts C++ into C language.
Translator – Language Rewriter
• It is a program that changes
form of expression of the same
language.
• It does not changes the
language of source code.
Translator - Decompiler
• It is a piece of software that converts the low-level
language to high-level language .
• It is not as famous, but may prove a useful tool
sometimes.
• Ex: JD Compiler, .JAD decompiler, NET Reflector
Translator – Compiler-Compiler
• It is a tool that creates a compiler, interpreter or
parser from the information provided on formal
description of any language.
• The earliest & most common type is parser-
generator.
• It is also called compiler-generator.
• Ex: Yacc, JavaCC, etc.
CONTACT ME AT:
Akhil Kaushik
akhilkaushik05@gmail.com
9416910303
CONTACT ME AT:
Akhil Kaushik
akhilkaushik05@gmail.com
9416910303
Thank You !!!

Contenu connexe

Tendances

1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
Harish Kumawat
 

Tendances (20)

DOT Net overview
DOT Net overviewDOT Net overview
DOT Net overview
 
C#.NET
C#.NETC#.NET
C#.NET
 
Compilers
CompilersCompilers
Compilers
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
C programming language
C programming languageC programming language
C programming language
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
 
Introduction to Makefile
Introduction to MakefileIntroduction to Makefile
Introduction to Makefile
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 
COMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed TranslationCOMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed Translation
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Types of Parser
Types of ParserTypes of Parser
Types of Parser
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 

Similaire à Introduction to Compilers

Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdf
RakibRahman19
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
crAmth
 

Similaire à Introduction to Compilers (20)

Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
 
Life cycle of a computer program
Life cycle of a computer programLife cycle of a computer program
Life cycle of a computer program
 
compiler vs interpreter
compiler vs interpretercompiler vs interpreter
compiler vs interpreter
 
Session01 basics programming
Session01 basics programmingSession01 basics programming
Session01 basics programming
 
aditya malkani compiler.pptx
aditya malkani compiler.pptxaditya malkani compiler.pptx
aditya malkani compiler.pptx
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)
 
COMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptxCOMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptx
 
Week 08_Basics of Compiler Construction.pdf
Week 08_Basics of Compiler Construction.pdfWeek 08_Basics of Compiler Construction.pdf
Week 08_Basics of Compiler Construction.pdf
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdf
 
Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design Introduction
 
Language translator
Language translatorLanguage translator
Language translator
 
computer languages
computer languagescomputer languages
computer languages
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
 

Plus de Akhil Kaushik

Plus de Akhil Kaushik (20)

Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
 
Symbol Table
Symbol TableSymbol Table
Symbol Table
 
Lexical Analyzer Implementation
Lexical Analyzer ImplementationLexical Analyzer Implementation
Lexical Analyzer Implementation
 
NFA & DFA
NFA & DFANFA & DFA
NFA & DFA
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity Calculation
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
 
Basic programs in Python
Basic programs in PythonBasic programs in Python
Basic programs in Python
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Bootstrapping in Compiler
Bootstrapping in CompilerBootstrapping in Compiler
Bootstrapping in Compiler
 
Compiler construction tools
Compiler construction toolsCompiler construction tools
Compiler construction tools
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Dernier (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

Introduction to Compilers

  • 1. Compiler Design (CSE-405-F) Akhil Kaushik Asstt. Prof., CE Deptt., TIT Bhiwani
  • 3. What is a Compiler? • A compiler is a computer program (or set of programs) that transforms source code written in a high level language (the source language) into low level language (the target language may be assembly language or machine language (0,1)).
  • 4. What is a Compiler?
  • 5. What is a Compiler? Source Language Target Language
  • 6. Introduction Compiler basically does two things: • Analysis: Compiling source code & detecting errors in it. • Synthesis: Translating the source code into object code depending upon the type of machine.
  • 7. Introduction • Program errors are difficult to track, if the compiler is wrongly designed. • Hence, compiler construction is a very tedious and long process.
  • 8. One-pass Compiler • It compiles the that passes through the source code of each compilation unit only once. • They are faster than multi-pass compiler. • Their efficiency is limited because they don’t produce intermediate codes which can be refined easily. • Also known as ‘Narrow Compiler’.
  • 9. Multi-pass Compiler • It processes the source code or abstract syntax tree of a program several times. • It may create one or more intermediate codes (easy to refine). • Each pass takes output of previous phase as input; hence requires less memory. • Also known as ‘Wide Compiler’.
  • 10. Type of Languages 1. Binary Level Language 2. Assembly Level Language 3. High Level Language
  • 11. Need for programming languages? • Closer to human thinking behavior. • Program’s size is shorter. • Error detection is easy. • Same program can be compiled in accordance to different machine architectures.
  • 12. History • Software for early computers were written in assembly language. • The need of reusability of code gave birth to programming languages. • This need grow huge to overcome the cost restriction of compiler.
  • 13. History • The concept of machine independent programming gave birth to the need of compilers in 1950s. • The 1st compiler was written by Grace Hopper in 1952 for A-0 programming language.
  • 14. History • The 1st complete compiler was developed by FORTRAN team lead by John Backus @ IBM in 1957. • COBOL was the 1st language to be compiled on multiple platforms in 1960.
  • 15. History • Earlier compilers were written in assembly languages. • The 1st compiler in HLL was created for LISP by Tim Hart & Mike Levin @ MIT, USA in 1962, which was a self-hosting Compiler.
  • 16. History • Most compilers are made in C or Pascal languages. • However the trend is changing to self-hosting compilers, which can compile the source code of the same language in which they are created.
  • 17. Why Study Compiler? • Its essential to understand the heart of programming by computer science engineering students. • There may be need of designing a compiler for any software language in the profession.
  • 18. Why Study Compiler? • Increases understanding of language semantics. • Helps to handle language performance issues. • Opportunity for non-trivial programming project
  • 19. Translators • It is important to understand that compiler is a kind of translator, which translates high level language (human understandable) to low-level language(machine understandable).
  • 21. Translators - Preprocessor • It is a program that processes its input data to produce output that is used as input to another program. • The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers.
  • 22. Translators - Preprocessor • The amount and kind of processing done depends on the nature of the preprocessor. • some preprocessors are only capable of performing simple textual substitutions and macro expansions, while others have the power of full- fledged programming languages. • It can also include macro processing, file inclusion and language extensions.
  • 23. Translators - Interpreter • It is another common kind of language processor. • Instead of producing a target program as a translation, it directly execute the operations specified in the source program on inputs supplied by the user.
  • 24. Translators - Interpreter • This software converts the high-level language into low-level language line by line. • It takes less memory than compiler. • It takes more time than compiler. • It is more efficient in error detection than compiler. • It takes more time to build.
  • 25. Translators - Interpreter • Java language processors combine compilation and interpretation. • A Java source program may first be compiled into an intermediate form called bytecodes. • The bytecodes are then interpreted by a virtual machine. • A benefit of this arrangement is that bytecodes compiled on one machine can be interpreted on another machine, perhaps across a network.
  • 27. Translators - Assembler • This software converts the assembly language (assembly instruction mnemonics) into machine level language (opcodes i.e. 0,1). • It offers reusability of assembly codes on different machine platforms.
  • 28. Translators - Assembler • It generates instructions by evaluating the mnemonics (symbols) in operation field and find the value of symbol and literals to produce machine code. • Now, if assembler do all this work in one scan then it is called single pass assembler, otherwise if it does in multiple scans then called multiple pass assembler.
  • 29. Translators - Assembler • Pass-1: – Define symbols and literals and remember them in symbol table and literal table respectively. – Keep track of location counter – Process pseudo-operations • Pass-2: – Generate object code by converting symbolic op-code into respective numeric op-code – Generate data for literals and look for values of symbols
  • 31. Translators - Linker • A linker is a program that allows a user to link library programs or separate modules of code into their own programs. • It is used to combine different modules of object code into one single executable code program.
  • 32. Translators - Linker • This may involve combining a program with library programs, or involve recombining blocks of object code from the same program, or a mixture of both. • The linker program is used to recombine the blocks of object code in RAM to get a working full program. • Linker is helpful if there is a shortage of RAM.
  • 33. Translators - Loader • A loader is a piece of software that chooses exactly where to put object code in RAM, ready for it to be run. • It also adjusts the memory references in programs.
  • 34. Translators - Loader • Programs can be written by programmers using either ‘absolute addressing’ or ‘relative addressing’. • Relative addressing is more common because then the loader can put the program anywhere in RAM - absolute addressing isn't flexible. • Linker & Loader may overlap.
  • 36. Translators - Cross-Compiler • If the compiled program can run on a computer whose C.P.U or O.S is different from the one on which the compiler runs, the compiler is known as a cross-complier.
  • 38. Translator – Language Converter • Also called Language Translator / Source to source translator. • It converts programs in one high-level language to another high-level language. • Ex: Cfront converts C++ into C language.
  • 39. Translator – Language Rewriter • It is a program that changes form of expression of the same language. • It does not changes the language of source code.
  • 40. Translator - Decompiler • It is a piece of software that converts the low-level language to high-level language . • It is not as famous, but may prove a useful tool sometimes. • Ex: JD Compiler, .JAD decompiler, NET Reflector
  • 41. Translator – Compiler-Compiler • It is a tool that creates a compiler, interpreter or parser from the information provided on formal description of any language. • The earliest & most common type is parser- generator. • It is also called compiler-generator. • Ex: Yacc, JavaCC, etc.
  • 42. CONTACT ME AT: Akhil Kaushik akhilkaushik05@gmail.com 9416910303 CONTACT ME AT: Akhil Kaushik akhilkaushik05@gmail.com 9416910303 Thank You !!!