Introduction to System Software and Assemblers
Introduction to language processing activities, fundamentals of language processing, fundamentals of language specification, elements of assembly language programming, simple assembly scheme, pass structure of assemblers, design of two pass assembler
Difference Between Search & Browse Methods in Odoo 17
4.LanguageProcessors and language Processing Activities.pdf
1. Introduction to System
Software
Systemsoftwareis thebackboneof a computer,responsibleformanaging
hardwareresourcesandprovidinga platformforrunningapplications.In this
presentation,we'llexplorethefunctions,types,andimportanceof system
softwarein moderncomputing.
SP by SwapnaliPawar
3. Agenda
▪ About Language processor
▪ Language processor Definition
▪ Complier and Interpreter
▪ Comparison between Compiler and Interpreter
SWAPNALI R.PAWAR~(RIT) 3
4. 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.
Execution domain
Application domain
Fig 1 Semantic gap
Semantic gap
SWAPNALI R.PAWAR~(RIT) 4
5. 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
6. Language processor
• The specification gap is bridge by the software development team.
• Execution gap is bridged by the designer of the programming language processor. Like
compiler or interpreter.
• Specification gap is semantic gap between two specification of the sametask.
• Execution gap is gap between semantics of programs (same task but different PL).
Fig.Specification and Execution gap
Application domain PL. Domain Execution domain
Execution gap
Specification Gap
SWAPNALI R.PAWAR~(RIT) 6
8. 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
9. 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
10. Think and Write Ans:
A. Application Domain
SWAPNALI R.PAWAR~(RIT) 10
11. 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
12. Advantages of Interpreter
•Programs written in an Interpreted language are easier to debug.
•Interpreters allow the management of memory automatically, which
reduces memory error risks.
•Interpreted Language is more flexible than a Compiled language.
Disadvantages of Interpreter
•The interpreter can run only the corresponding Interpreted program.
•Interpreted code runs slower in comparison to Compiled code.
Interpreter
SWAPNALI R.PAWAR~(RIT) 12
13. Advantages of Compiler
•Compiled code runs faster in comparison to Interpreted code.
•Compilers help in improving the security of Applications.
•As Compilers give Debugging tools, which help in fixing errors easily.
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.
Compiler
SWAPNALI R.PAWAR~(RIT) 13
14. Comparison between Compiler & Interpreter
Interpreter Compiler
Translates program one statement at a
time.
Scans the entire program and translates it
as a whole into machine code.
Interpreters usually take less amount of
time to analyze the source code. However,
the overall execution time is comparatively
slower than compilers.
Compilers usually take a large amount of
time to analyze the source code. However,
the overall execution time is comparatively
faster than interpreters.
No Object Code is generated, hence are
memory efficient.
Generates Object Code which further
requires linking, hence requires more
memory.
Programming languages like JavaScript,
Python, Ruby use interpreters.
Programming languages like C, C++, Java
use compilers.
SWAPNALI R.PAWAR~(RIT) 14
17. 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
Program generation activities:
Aims to generation of a program. Source is the application domain
and target is the PL domain. It bridges specification gap.
Program execution activities:
Aims to execute a program written in PL source is PL. domain and
target is execution domain.It bridges execution gap.
SWAPNALI R.PAWAR~(RIT) 17
18. Program generation Activity
• The program generator is a software system which accepts the specification
of a program to be generated and generates program in a the target
PL.Domain.
• This activity is done by program generator domain.
Errors
Program
Specification
Program
Generator
Program in Target
PL.
Fig-Program generation Activity
SWAPNALI R.PAWAR~(RIT) 18
20. 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
Program
Specification
Translator
M/C
Language
Program
Target
Program
Fig .Program Translation
SWAPNALI R.PAWAR~(RIT) 20
21. Program Translation activities
Characteristics of the program translation model are:
1. A program must be translated before it can be executed.
2. The translated program may be saved in file. The saved program
may be executed repeatedly.
3. A program must be retranslated following modifications.
4. It reads the source program and stores it in its memory.
SWAPNALI R.PAWAR~(RIT) 21
22. Program Translation:
During interpretation it takes a source statement, determines its
meaning, and performs actions like computation and I/O which
implement it.
SWAPNALI R.PAWAR~(RIT) 22
23. 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.
This instruction is subjected to the instruction execution cycle consisting
following step:
1. Fetch the instruction
2. Decode the instruction to determine the operation to be performed.
3. Execute the instruction.
SWAPNALI R.PAWAR~(RIT) 23
24. 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
25. 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
27. 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
29. Language processing Language processing
Analysis of source program + Synthesis of target program
• The collection of language processor components engaged in the analysis of source
program constitutes analysis phase of a language processor.
• Components engaged in synthesizing a target program constitutes synthesis phase of a
language processor.
• The specification of source language forms the basis of source program analysis
• The specification consists of three components.
• Lexical rules:
• Syntax rules:
• Semantic rules:
SWAPNALI R.PAWAR~(RIT) 29
30. Language processing
The specification consists of three components-
Lexical rules: These govern the formation of valid lexical units in
the source program.
Syntax rules: These govern the formation of valid statements in
source language,
A Semantic rules: These associate meaning with valid statements
of thelanguage.
SWAPNALI R.PAWAR~(RIT) 30
31. 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
37. Think and Write
What is language processing pass? Illustrate.
SWAPNALI R.PAWAR~(RIT) 37
38. 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