SlideShare a Scribd company logo
14
Most read
15
Most read
16
Most read
Introduction to Compiler
1
Compiler
• Programming languages are notations for describing computations to people
and to machines. The world as we know it depends on programming
languages, because all the software running on all the computers was
written in some programming language. But, 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.
• A compiler is a program that can read a program in one language - the
source language - and translate it into an equivalent program in another
language - the target language; An important role of the compiler is to
report any errors in the source program that it detects during the
translation process.
2
3
• If the target program is an executable machine-language program, it can then
be called by the user to process inputs and produce outputs.
4
Interpreter
An interpreter is another common kind of language processor. Instead of
producing a target program as a translation, an interpreter appears to directly
execute the operations specified in the source program on inputs supplied by
the user.
5
• The machine-language target program produced by a compiler is usually much
faster than an interpreter at mapping inputs to outputs . An interpreter, however,
can usually give better error diagnostics than a compiler, because it executes
the source program statement by statement.
• Java language processors combine compilation and interpretation, as shown in
Fig. 1.4. 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.
6
7
Compiler & Interpreter
8
9
Interpreter Compiler
Translates program one
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.
It takes a large amount
of time to analyze the
source code but the
overall execution time is
comparatively faster.
No intermediate object
code is generated,
hence are memory
efficient.
Generates intermediate
object code which
further requires linking,
hence requires more
memory.
Interpreter Compiler
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 languages
like Python, Ruby use
interpreters.
Programming languages
like C, C++, Java use
compilers.
Difference between Interpreter and Compiler
10
Key Differences Between Compiler and Interpreter
Let’s look at major differences between Compiler and Interpreter:
1. The compiler takes a program as a whole and translates it, but interpreter translates a
program statement by statement.
2. Intermediate code or target code is generated in case of a compiler. As against
interpreter doesn’t create intermediate code.
3. A compiler is comparatively faster than Interpreter as the compiler take the whole
program at one go whereas interpreters compile each line of code after the other.
4. The compiler requires more memory than interpreter because of the generation of
object code.
5. Compiler presents all errors concurrently, and it’s difficult to detect the errors in
contrast interpreter display errors of each statement one by one, and it’s easier to
detect errors.
6. In compiler when an error occurs in the program, it stops its translation and after
removing error whole program is translated again. On the contrary, when an error takes
place in the interpreter, it prevents its translation and after removing the error,
translation resumes.
11
7. In a compiler, the process requires two steps in which firstly source code is translated to
target program then executed. While in Interpreter It’s a one-step process in which Source
code is compiled and executed at the same time.
8. The compiler is used in programming languages like C, C++, C#, Scala, etc. On the other
Interpreter is employed in languages like PHP, Ruby, Python, etc.
12
We know a computer is a logical assembly of Software and Hardware. The
hardware knows a language, that is hard for us to understand, consequently we
tend to write programs in high-level language, that is much less complicated for us
to comprehend and maintain in thoughts. Now these programs go through a series
of transformation so that they can readily be used in machines. This is where
language procedure systems come handy.
13
Language Processing System
Language Processing System
14
•High Level Language – If a program contains #define or
#include directives such as #include or #define it is called HLL.
They are closer to humans but far from machines. These (#)
tags are called pre-processor directives. They direct the pre-
processor about what to do.
•Pre-Processor – The pre-processor removes all the #include
directives by including the files called file inclusion and all the
#define directives using macro expansion. It performs file
inclusion, augmentation, macro-processing etc.
•Assembly Language – Its neither in binary form nor high
level. It is an intermediate state that is a combination of
machine instructions and some other useful data needed for
execution.
•Assembler – For every platform (Hardware + OS) we will have
a assembler. They are not universal since for each platform we
have one. The output of assembler is called object file. Its
translates assembly language to machine code.
15
•Interpreter – An interpreter converts high level language into
low level machine language, just like a compiler. But they are
different in the way they read the input. The Compiler in one go
reads the inputs, does the processing and executes the source
code whereas the interpreter does the same line by line.
Compiler scans the entire program and translates it as a whole
into machine code whereas an interpreter translates the
program one statement at a time. Interpreted programs are
usually slower with respect to compiled ones.
•Relocatable Machine Code – It can be loaded at any point and
can be run. The address within the program will be in such a
way that it will cooperate for the program movement.
•Loader/Linker – It converts the relocatable code into absolute
code and tries to run the program resulting in a running
program or an error message (or sometimes both can happen).
Linker loads a variety of object files into a single file to make it
executable. Then loader loads it in memory and executes it.
16
THANK YOU
17

More Related Content

PPTX
Lexical analysis - Compiler Design
Muhammed Afsal Villan
 
PDF
Domain Modeling
Harsh Jegadeesan
 
PPTX
Critical section problem in operating system.
MOHIT DADU
 
PPTX
Phases of Compiler
Tanzeela_Hussain
 
PPTX
Syntax Analysis in Compiler Design
MAHASREEM
 
PPT
Introduction to Compiler Construction
Sarmad Ali
 
PDF
Memory management
Rajni Sirohi
 
PPTX
Macro assembler
Meghaj Mallick
 
Lexical analysis - Compiler Design
Muhammed Afsal Villan
 
Domain Modeling
Harsh Jegadeesan
 
Critical section problem in operating system.
MOHIT DADU
 
Phases of Compiler
Tanzeela_Hussain
 
Syntax Analysis in Compiler Design
MAHASREEM
 
Introduction to Compiler Construction
Sarmad Ali
 
Memory management
Rajni Sirohi
 
Macro assembler
Meghaj Mallick
 

What's hot (20)

PPTX
software cost factor
Abinaya B
 
PPTX
Error Detection & Recovery
Akhil Kaushik
 
PPTX
Chapter 1 2 - some size factors
NancyBeaulah_R
 
PPT
Assembler design options
Mohd Arif
 
PPTX
Reader/writer problem
RinkuMonani
 
PPTX
Lect2 conventional software management
meena466141
 
PDF
Multithreading
Dr. A. B. Shinde
 
PPTX
Lexical analyzer
Princess Doll
 
PDF
Agile model
DivyaStephen3
 
PPTX
System Programming Overview
Dattatray Gandhmal
 
PPTX
Compiler Chapter 1
Huawei Technologies
 
PPT
Compiler Design Unit 1
Jena Catherine Bel D
 
PPTX
Types of Language in Theory of Computation
Ankur Singh
 
PPTX
Pipelining and vector processing
Kamal Acharya
 
PDF
Lecture 01 introduction to compiler
Iffat Anjum
 
PPT
Scheduling algorithms
Chankey Pathak
 
PPTX
Inter Process Communication
Adeel Rasheed
 
PPT
Interpreters & Debuggers
Malek Sumaiya
 
PDF
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
software cost factor
Abinaya B
 
Error Detection & Recovery
Akhil Kaushik
 
Chapter 1 2 - some size factors
NancyBeaulah_R
 
Assembler design options
Mohd Arif
 
Reader/writer problem
RinkuMonani
 
Lect2 conventional software management
meena466141
 
Multithreading
Dr. A. B. Shinde
 
Lexical analyzer
Princess Doll
 
Agile model
DivyaStephen3
 
System Programming Overview
Dattatray Gandhmal
 
Compiler Chapter 1
Huawei Technologies
 
Compiler Design Unit 1
Jena Catherine Bel D
 
Types of Language in Theory of Computation
Ankur Singh
 
Pipelining and vector processing
Kamal Acharya
 
Lecture 01 introduction to compiler
Iffat Anjum
 
Scheduling algorithms
Chankey Pathak
 
Inter Process Communication
Adeel Rasheed
 
Interpreters & Debuggers
Malek Sumaiya
 
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Ad

Similar to Language processing system.pdf (20)

DOCX
Computer assignment for grade 9
nahomyitbarek
 
PPTX
COMPILER DESIGN OPTIONS
sonalikharade3
 
DOCX
Compliers and interpreters
shivasdhtsvmic
 
DOCX
COMPILER DESIGN.docx
Revathiparamanathan
 
DOC
compiler vs interpreter
Faculty of Science , portsaid Univeristy
 
PPTX
Compiler design slide share
Sudhaa Ravi
 
PDF
compilervsinterpreter-161008074915.pdf
HarshaVardhan196987
 
PPTX
Compiler vs interpreter
Paras Patel
 
PPTX
Compiler vs interpreter
HarshaVardhan196987
 
PDF
Introduction to compiler
A. S. M. Shafi
 
PDF
Programming Languages
Mohamed Omar
 
PPT
La 5 Pl Translator
Cma Mohd
 
PPTX
Insight into progam execution ppt
Keerty Smile
 
PPTX
Compiler constuction lec 1 ( features of compiler and types of compiler).pptx
Aksakhalyd
 
PPT
programming languages
Rajendran
 
PPTX
Introduction to computer and its fundamentals.pptx
Guna Dhondwad
 
PPTX
Translators(Compiler, Assembler) and interpreter
baabtra.com - No. 1 supplier of quality freshers
 
PDF
LKGtoPG - Basics of C Language
lkgtopg jobs
 
PPTX
Introduction to Compilers
Akhil Kaushik
 
PPTX
For EETggggggggggggggggggggggggggggggggggg
narrowide762
 
Computer assignment for grade 9
nahomyitbarek
 
COMPILER DESIGN OPTIONS
sonalikharade3
 
Compliers and interpreters
shivasdhtsvmic
 
COMPILER DESIGN.docx
Revathiparamanathan
 
Compiler design slide share
Sudhaa Ravi
 
compilervsinterpreter-161008074915.pdf
HarshaVardhan196987
 
Compiler vs interpreter
Paras Patel
 
Compiler vs interpreter
HarshaVardhan196987
 
Introduction to compiler
A. S. M. Shafi
 
Programming Languages
Mohamed Omar
 
La 5 Pl Translator
Cma Mohd
 
Insight into progam execution ppt
Keerty Smile
 
Compiler constuction lec 1 ( features of compiler and types of compiler).pptx
Aksakhalyd
 
programming languages
Rajendran
 
Introduction to computer and its fundamentals.pptx
Guna Dhondwad
 
Translators(Compiler, Assembler) and interpreter
baabtra.com - No. 1 supplier of quality freshers
 
LKGtoPG - Basics of C Language
lkgtopg jobs
 
Introduction to Compilers
Akhil Kaushik
 
For EETggggggggggggggggggggggggggggggggggg
narrowide762
 
Ad

Recently uploaded (20)

PPTX
Residential_Interior_Design_No_Images.pptx
hasansarkeraidt
 
PPTX
Design & Thinking for Engineering graduates
NEELAMRAWAT48
 
PPTX
confluence of tradition in modernity- design approaches and design thinking
madhuvidya7
 
PDF
Shayna Andrieze Yjasmin Goles - Your VA!
shaynagoles31
 
PPTX
佛罗伦萨大学文凭办理|办理UNIFI毕业证学费单购买文凭在线制作
1cz3lou8
 
PDF
Line Sizing presentation about pipe sizes
anniebuzzfeed
 
PPTX
Engagement for marriage life ethics b.pptx
SyedBabar19
 
PDF
Hossain Kamyab on Mixing and Matching Furniture.pdf
Hossain Kamyab
 
PDF
SS27 Women's Fashion Trend Book Peclers Paris
Peclers Paris
 
PPTX
700315768-Linguistic-Connnnnnnnnntext.pptx
rossanthonytan1
 
PPTX
DISS-Group-5_110345.pptx Basic Concepts of the major social science
mattygido
 
PPT
UNIT- 2 CARBON FOOT PRINT.ppt yvvuvvvvvvyvy
sriram270905
 
DOCX
Amplopxxxxxxxxxvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Lm Hardin 'Idin'
 
DOCX
Personalized Jewellery Guide: Engraved Rings, Initial Necklaces & Birthstones...
Dishis jewels
 
PPTX
Aldol_Condensation_Presentation (1).pptx
mahatosandip1888
 
PPTX
Style and aesthetic about fashion lifestyle
Khushi Bera
 
PDF
TAIPAN99 Situs Pkv Games Terbaik Bermain Kapan Pun Dimana Dengan Mudah #1
TAIPAN 99
 
PPTX
Mini-Project description of design of expert project
peter349484
 
PPTX
Model PPT-1.pptx for research protocol or
drkalaivani
 
PPTX
Morph Slide Presentation transition.pptx
ArifaAkter10
 
Residential_Interior_Design_No_Images.pptx
hasansarkeraidt
 
Design & Thinking for Engineering graduates
NEELAMRAWAT48
 
confluence of tradition in modernity- design approaches and design thinking
madhuvidya7
 
Shayna Andrieze Yjasmin Goles - Your VA!
shaynagoles31
 
佛罗伦萨大学文凭办理|办理UNIFI毕业证学费单购买文凭在线制作
1cz3lou8
 
Line Sizing presentation about pipe sizes
anniebuzzfeed
 
Engagement for marriage life ethics b.pptx
SyedBabar19
 
Hossain Kamyab on Mixing and Matching Furniture.pdf
Hossain Kamyab
 
SS27 Women's Fashion Trend Book Peclers Paris
Peclers Paris
 
700315768-Linguistic-Connnnnnnnnntext.pptx
rossanthonytan1
 
DISS-Group-5_110345.pptx Basic Concepts of the major social science
mattygido
 
UNIT- 2 CARBON FOOT PRINT.ppt yvvuvvvvvvyvy
sriram270905
 
Amplopxxxxxxxxxvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Lm Hardin 'Idin'
 
Personalized Jewellery Guide: Engraved Rings, Initial Necklaces & Birthstones...
Dishis jewels
 
Aldol_Condensation_Presentation (1).pptx
mahatosandip1888
 
Style and aesthetic about fashion lifestyle
Khushi Bera
 
TAIPAN99 Situs Pkv Games Terbaik Bermain Kapan Pun Dimana Dengan Mudah #1
TAIPAN 99
 
Mini-Project description of design of expert project
peter349484
 
Model PPT-1.pptx for research protocol or
drkalaivani
 
Morph Slide Presentation transition.pptx
ArifaAkter10
 

Language processing system.pdf

  • 2. Compiler • Programming languages are notations for describing computations to people and to machines. The world as we know it depends on programming languages, because all the software running on all the computers was written in some programming language. But, 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. • A compiler is a program that can read a program in one language - the source language - and translate it into an equivalent program in another language - the target language; An important role of the compiler is to report any errors in the source program that it detects during the translation process. 2
  • 3. 3
  • 4. • If the target program is an executable machine-language program, it can then be called by the user to process inputs and produce outputs. 4
  • 5. Interpreter An interpreter is another common kind of language processor. Instead of producing a target program as a translation, an interpreter appears to directly execute the operations specified in the source program on inputs supplied by the user. 5
  • 6. • The machine-language target program produced by a compiler is usually much faster than an interpreter at mapping inputs to outputs . An interpreter, however, can usually give better error diagnostics than a compiler, because it executes the source program statement by statement. • Java language processors combine compilation and interpretation, as shown in Fig. 1.4. 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. 6
  • 7. 7
  • 9. 9
  • 10. Interpreter Compiler Translates program one 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. It takes a large amount of time to analyze the source code but the overall execution time is comparatively faster. No intermediate object code is generated, hence are memory efficient. Generates intermediate object code which further requires linking, hence requires more memory. Interpreter Compiler 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 languages like Python, Ruby use interpreters. Programming languages like C, C++, Java use compilers. Difference between Interpreter and Compiler 10
  • 11. Key Differences Between Compiler and Interpreter Let’s look at major differences between Compiler and Interpreter: 1. The compiler takes a program as a whole and translates it, but interpreter translates a program statement by statement. 2. Intermediate code or target code is generated in case of a compiler. As against interpreter doesn’t create intermediate code. 3. A compiler is comparatively faster than Interpreter as the compiler take the whole program at one go whereas interpreters compile each line of code after the other. 4. The compiler requires more memory than interpreter because of the generation of object code. 5. Compiler presents all errors concurrently, and it’s difficult to detect the errors in contrast interpreter display errors of each statement one by one, and it’s easier to detect errors. 6. In compiler when an error occurs in the program, it stops its translation and after removing error whole program is translated again. On the contrary, when an error takes place in the interpreter, it prevents its translation and after removing the error, translation resumes. 11
  • 12. 7. In a compiler, the process requires two steps in which firstly source code is translated to target program then executed. While in Interpreter It’s a one-step process in which Source code is compiled and executed at the same time. 8. The compiler is used in programming languages like C, C++, C#, Scala, etc. On the other Interpreter is employed in languages like PHP, Ruby, Python, etc. 12
  • 13. We know a computer is a logical assembly of Software and Hardware. The hardware knows a language, that is hard for us to understand, consequently we tend to write programs in high-level language, that is much less complicated for us to comprehend and maintain in thoughts. Now these programs go through a series of transformation so that they can readily be used in machines. This is where language procedure systems come handy. 13 Language Processing System
  • 15. •High Level Language – If a program contains #define or #include directives such as #include or #define it is called HLL. They are closer to humans but far from machines. These (#) tags are called pre-processor directives. They direct the pre- processor about what to do. •Pre-Processor – The pre-processor removes all the #include directives by including the files called file inclusion and all the #define directives using macro expansion. It performs file inclusion, augmentation, macro-processing etc. •Assembly Language – Its neither in binary form nor high level. It is an intermediate state that is a combination of machine instructions and some other useful data needed for execution. •Assembler – For every platform (Hardware + OS) we will have a assembler. They are not universal since for each platform we have one. The output of assembler is called object file. Its translates assembly language to machine code. 15
  • 16. •Interpreter – An interpreter converts high level language into low level machine language, just like a compiler. But they are different in the way they read the input. The Compiler in one go reads the inputs, does the processing and executes the source code whereas the interpreter does the same line by line. Compiler scans the entire program and translates it as a whole into machine code whereas an interpreter translates the program one statement at a time. Interpreted programs are usually slower with respect to compiled ones. •Relocatable Machine Code – It can be loaded at any point and can be run. The address within the program will be in such a way that it will cooperate for the program movement. •Loader/Linker – It converts the relocatable code into absolute code and tries to run the program resulting in a running program or an error message (or sometimes both can happen). Linker loads a variety of object files into a single file to make it executable. Then loader loads it in memory and executes it. 16