Introduction to
Language
Processor
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Introduction
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Need of Language processing
activities
Difference in
manner of description of idea by designer
and
manner of implementation of idea in computer system
E.g.
implement a android based mobile application for CHARUSAT
Application Execution
Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Semantic gap
Semantic ( Representation of rules of meaning ) is different in both domains
Difference of semantics of two domain is called semantic gap
semantic gap
Application Execution
Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Semantic gap
Consequences / drawbacks
• Large development time
• Large development effort
• Poor quality of software
semantic gap
Application Execution
Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Role of SE
Software Engineering Steps fill this gap
Introduce one more domain in between i.e. PL domain (Programming Language domain)
PL has
• Specification, design and coding steps
• PL implementation steps
semantic gap
Application PL Execution
Domain Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Specification & Execution gap
Gap between Application & PL domain is Gap between PL & Execution domain is
called specification & design gap or called Execution gap
specification gap
This is the difference between semantics of
This is the difference between specification program written in different language
of same task in different domain
semantic gap
Application specification gap PL execution gap Execution
Domain Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Bridge the Specification &
Execution gap
Software Development Designer of programming
Team language processor
semantic gap
Application specification gap PL execution gap Execution
Domain Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
What is Language processor?
Language
Source Language Target Language
Processor
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Spectrum of language processor
Language translator
High level code Compiler Mid / Low level code
Mid level code Assembler Low level code
Language
Source Language Target Language
Translator
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Spectrum of language processor
Language translator
Detranslator
Source Language
Language Target Language
Detranslator
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Spectrum of language processor
Language translator
Detranslator
Preprocessor
C
C code Expanded C code
Preprocessor
Language
Source Language Target Language
Preprocessor
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Spectrum of language processor
Language translator
Detranslator
Preprocessor
Language migrator
C++ code Migrator Java code
Language
Source Language Target Language
Migrator
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Language
Processing
Activities
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Language Processing Activities
Program generation Program execution
activities activities
semantic gap
Specification gap execution gap
Application PL Execution
Domain Domain Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Program generation
Program generation Program execution
activities activities
Automatic generation of program semantic gap
from application domain
Specification
to targeted programming gap
language execution gap
Program
Application PL Execution
Generation
Domain Domain Domain
Domain
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Program execution
Program generation Program execution
activities activities
Models
Execution of a program written in PL
on a computer system
Translation
Interpretation
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Program execution
Program generation Program execution
activities activities
TRANSLATION INTERPRETATION
Translate program before execution Read source code & store in its memory
Translated program save in a file which can Fetch the statement, Analyze statement,
be executed separately find meaning & perform computation
Need to do retranslation if any modification Execute the meaning of statement
takes place
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Program execution
Program generation Program execution
activities activities
TRANSLATION INTERPRETATION
Advantage: Advantage:
• No need of retranslate every time so time saving • Handle frequent modification because every time
interpretation takers place
Disadvantage:
• Translated file is saved separately so need to Disadvantage:
recompile after each modification • Every time interpretation takes place so time consuming
Used when modifications are less Used when frequent modifications are required
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Fundamental of
Language
Processing
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Language processing
Language
Processing = Analysis of
Source Program + Synthesis of
Target program
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Language processing
Language Processor
Front End Back End
Analysis Phase IR Synthesis Phase
Source Target
Program Program
Error Error
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
I calare the apel to eat ?
I colour the apple to eat ?
I colour the apple to eat .
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT
Language processing
Language Processor
Front End Back End
Analysis Phase Synthesis Phase
IR
Source Scanner Parser
Semantic Memory Code Target
Program Analyzer allocation generation Program
Check Check Check
Lexical rules Syntax rules Semantic rules
(Lexical Error) (Syntax Error) (Semantic Error)
TRUSHA R. PATEL, CE DEPT., CSPIT, CHARUSAT