Language
Processor and its types
The program or software
which is used to convert the program written in high-level languages to machine
code is known as language processor.
Different types of
language processor are as here under.
·
Compiler
·
Interpreter
·
Assembler
Compiler
A compiler is a
translating program that is used to translate high level program into machine
codes. Before execution it translate whole program in machine code. If there
are any errors in the source program errors must be removed before compiler
translate the program.
The compiler translates
whole program at once rather than a single statement into machine language
instruction. Separate compiler is required for each and every programming
language.
Interpreter
Interpreters translate single
line at a time. The translated line is immediately executed before the next
line is taken up for translation. Object program cannot produce by it. Every
time the program is run, it has to be translated and executed.. Compilation is
lengthy process and it can be postponed till the program has been thoroughly
tested for logical and grammatical errors. For beginners and learners who do
not need object programs for permanent storage and repeated use, interpreters
are best suited.
Following
are the difference between Compiler and Interpreter
S.N. |
Compiler |
Interpreter |
1 |
It
convert high level language into machine code |
It
also translate high level language to machine code |
2 |
It
translate whole program at a time. |
It
translate each statement at a time |
3 |
It
is slow for correcting errors. |
It
correct errors faster. |
4 |
Object
program created by compiler |
Object
program cannot create by interpreter. |
5 |
All
the errors in the program are displayed at once. |
It
reports the error at each time. |
6 |
It
takes less time to execute the program. |
More
time takes to execute the program. |
7 |
Example:
C, C++ etc. |
Examples:
QBASIC, Visual BASIC etc. |
Assembler
An assembler is a
translating program that translates (converts) an assembly language program
into its equivalent machine language program. An input to the assembler is the
assembly language program(also called source program), and its output is the
machine language program(also called object program).
No comments:
Post a Comment