Fundamentals of The Language Processor: This Semantic Gap Has Some Drawbacks
Fundamentals of The Language Processor: This Semantic Gap Has Some Drawbacks
The designer expresses the ideas in terms of application domain. To implement these
ideas execution domain is used . For this purpose the rules of meaning of a domain is
defined which is called as semantic. The gap between application domain and
execution domain is called as semantic gap.
The input program for language processor is termed as source program and language
use for that is termed as source language. The output program from language processor
is termed as target program. A detranslator converts program from one language i.e.
machine code to other language. It might he high level or low level program.
Preprocessor converts input source program to output target program other than
machine code. Preprocessor and language migrator works same, but preprocessor
minimizes Execution gap and Language Migrator minimizes specification gap.
1. Lexical Analysis :- It governs lexical rules in the source language (e.g Identifier
name is proper or not )
2. Syntax Analysis :- It checks validity of statements for syntax in the source
language
3. Semantic Analysis :- It checks the semantic rules in the source language.
Figure shows phases of language processor.
Source program passed through analysis phase and it generate IR which is intermediate
representation which is further passed to synthesis phase which finally generates target
program.
1. Ease of use
2. Processing and memory efficiency.
Language processor are used to bridge the specification gap as well as execution gap.
The language processing activities are divided into two groups
1. Translation :- This bridges the execution gap by translating source program into
an target program.
The instruction uses program counter to fetch instruction from memory then decode it
and execute the instruction. In similar way interpreter fetch the statement from memory.
Analyze the statement and determine its meaning. Execute the meaning of the
statement. Thus it bridges that execution gap.