4 LanguageProcessors
4 LanguageProcessors
Software
System software is the backbone of a computer, responsible for managing
hardware resources and providing a platform for running applications. In this
presentation, we'll explore the functions, types, and importance of system
software in modern computing.
SP by Swapnali Pawar
Language Processor
SWAPNALI R PAWAR
SWAPNALI R.PAWAR~(RIT) 2
Agenda
▪ About Language processor
▪ Language processor Definition
▪ Complier and Interpreter
▪ Comparison between Compiler and Interpreter
SWAPNALI R.PAWAR~(RIT) 3
Language processor
• The manner in which a software designer describes the ideas concerning the behaviour
of the software.
• The designer expresses these ideas in the application domain.
• These ideas are actually implemented in the execution domain
• The gap between the application domain and execution domain is called semantic gap.
Semantic gap
SWAPNALI R.PAWAR~(RIT) 4
Language processor
• The semantic gap has many difficulties, some of the important ones
being large development time and efforts, and poor quality of
software.
• These issues are tackled through the use of (PL) Software
implementation using PL introduces new domain as PL domain.
• The semantic gap is bridged by the software engineering steps, that
are specification. design and coding.
• Bridges gap between application domain and PL domain known as
specification gap.
• Bridges the gap between PL domain and execution domain as
execution gap.
SWAPNALI R.PAWAR~(RIT) 5
Language processor
SWAPNALI R.PAWAR~(RIT) 6
SWAPNALI R.PAWAR~(RIT) 7
Language processor Definition
It is software which bridges a specification or execution gap.
Activity performed by language processor called as Language Processing activities.
▪ Source program
▪ Target program
Arrange of LP is defined to meet practical requirements-
▪ ✓ Language translator - bridges an execution gap to the machine languagelike
assembler and compiler
▪ ✓ Detranslator - bridges the same as the language translator, but in thereverse
manner.
▪ ✓ Preprocessor - is a language processor which bridges an execution gap but
not translator.
▪ ✓ Language migrator - bridges specification gap between two PLs.
SWAPNALI R.PAWAR~(RIT) 8
Think & Write
1.The designer expresses the ideas in terms related to the........ of the software.
A. Application Domain
B. Execution Domain
C. PL Domain
D. Program Generator Domain
SWAPNALI R.PAWAR~(RIT) 9
Think and Write Ans:
A. Application Domain
SWAPNALI R.PAWAR~(RIT) 10
Complier and Interpreter Complier
Compiler:
It is a translator which takes input i.e. High-Level Language and produces an output of low-
level language i.e. machine or assembly language.
A compiler is more intelligent than an assembler it checks all kinds of limits, ranges, errors,
etc
Interpreter:
An interpreter is a program that translates a programming language into a comprehensible
language.
It translates only one statement of the program at a time.
SWAPNALI R.PAWAR~(RIT) 11
Interpreter
Advantages of Interpreter
Disadvantages of Interpreter
SWAPNALI R.PAWAR~(RIT) 12
Compiler
Advantages of Compiler
Disadvantages of Compiler
•The compiler can catch only syntax errors and some semantic errors.
•Compilation can take more time in the case of bulky code.
SWAPNALI R.PAWAR~(RIT) 13
Comparison between Compiler & Interpreter
Interpreter Compiler
Translates program one statement at a Scans the entire program and translates it
time. as a whole into machine code.
Interpreters usually take less amount of Compilers usually take a large amount of
time to analyze the source code. However, time to analyze the source code. However,
the overall execution time is comparatively the overall execution time is comparatively
slower than compilers. faster than interpreters.
SWAPNALI R.PAWAR~(RIT) 14
SWAPNALI R.PAWAR~(RIT) 15
Language Processing Activities
SWAPNALI R.PAWAR~(RIT) 16
Language processing activity
The language processing activities divided into two parts, that
bridges the specification gap and execution gap.
1.Program generation activities
2.Program execution activities
SWAPNALI R.PAWAR~(RIT) 17
Program generation Activity
SWAPNALI R.PAWAR~(RIT) 18
SWAPNALI R.PAWAR~(RIT) 19
Program Execution activities
Two popular models for program execution are:
1.Program Translation
2.Program Interpretation
The program translation model bridges the execution gap by translating a program written in a
PL called source program(SP), into an equivalent program in the machine language called
target program(TP). Errors
M/C
Program Target
Translator Language
Specification Program
Program
SWAPNALI R.PAWAR~(RIT) 20
Program Translation activities
Characteristics of the program translation model are:
SWAPNALI R.PAWAR~(RIT) 22
Program Interpretation activities
In the program interpretation the CPU use a program counter(PC) to note
the address of the next instruction to be executed.
SWAPNALI R.PAWAR~(RIT) 23
Program Interpretation activities
• At the end of the cycle. The PC is updated and the cycle is repeated for
next instruction.
• Thus, the PC can indicate which statement of the source program is to
interpreted next.
SWAPNALI R.PAWAR~(RIT) 24
Think and Write
1.______________is a software system which generates a program in the target PL.
A. Program Generator
B. Program Specification
C. Program Execution
D. program Interpretation
2.The CPU use_____________ to note the address of the next instruction to be executed.
A. program counter(PC)
B. Pretty printer
C. static checker
D. None of these
SWAPNALI R.PAWAR~(RIT) 25
Think and Write
1.Program Generator
1.Program counter(PC)
SWAPNALI R.PAWAR~(RIT) 26
Advantage and disadvantage of interpreter
Advantage of interpreter:
is that it is executed line by line which helps users to find errors easily
Disadvantage of interpreter
is that it takes more time to execute successfully than compiler.
SWAPNALI R.PAWAR~(RIT) 27
Fundamentals of Language
Processing
SWAPNALI R.PAWAR~(RIT) 28
Language processing Language processing
SWAPNALI R.PAWAR~(RIT) 29
Language processing
SWAPNALI R.PAWAR~(RIT) 30
Language processing
• The specification consists of three components.
• The analysis phase uses each component of source language specification to
determine the relevant information concerning the statement in the source
program.
• Thus the analysis of source program consists of lexical, syntax and semantic
analysis.
• The synthesis phase is concerned with the construction of target language
statements which have same meaning as source statements.
• This consists of two main activities:
1. Creation of data structures in the target program.
2. Generation of target code
SWAPNALI R.PAWAR~(RIT) 31
SWAPNALI R.PAWAR~(RIT) 32
SWAPNALI R.PAWAR~(RIT) 33
SWAPNALI R.PAWAR~(RIT) 34
SWAPNALI R.PAWAR~(RIT) 35
SWAPNALI R.PAWAR~(RIT) 36
Think and Write
What is language processing pass? Illustrate.
SWAPNALI R.PAWAR~(RIT) 37
Think and Write
Language processing pass is the processing of every statement in a
source program, or its equivalent representation, to perform a set of
language processing function.
✔ For example, for a two pass translator, following activities are carried
out in two passes:
✓ Pass 1:
It performs analysis of source program and note relevant information.
✓ Pass 2:
Performs Synthesis of Target Program
SWAPNALI R.PAWAR~(RIT) 38
Thank You !
SP
SWAPNALI R.PAWAR~(RIT) 40