Types of Language Processor

Language processor is a type of software that is used to translate a program from a high-level language into a low-level language. Because computer only understands the program written in the low-level language.  Let’s read further for more information.

Language Processor

The computer understands only machine language.  A computer cannot directly execute a program written in high level or assembly language.  Before execution, the program must be converted into machine language. Language processor or translators is a software that converts these programs into machine languages. Every computer language has its own translators also.

Types of Language Processor

Different types of language processors are as follows:

Advertisement
  • Compiler
  • Interpreter
  • Assembler

Compiler

A compiler is a program that converts the instructions of high-level language into machine language as a whole. A high-level language program is called a source program. Compiler converts source program into machine code. This machine code is known as an object program.

language processor

Furthermore, The compiler verifies every statement in the source program and produces machine instructions. Syntax errors in the program are also checked by the compiler. A source program containing an error cannot be compiled.

A compiler translates the programs of only that language for which it is written. For example, the C compiler can translate only those programs that are written in C language.

Interpreter

An interpreter is a program that converts one statement of a program at one time. Before translating the next statement of the source program, It executes this statement first. if there is an error in the statements, the interpreter stops working and displays the error message.

language processor

Advertisement

Furthermore, the advantages of interpreters over compilers are that an error is found immediately. so the programmer can correct errors during program development.

The drawback of an interpreter is that it is not very competent. The interpreter does not generate an object program. It must convert the program each time it is executed. Visual Basic also uses an interpreter.

Assembler

language processor

An assembler is translating program that converts assembly language programs into machine language.

Advertisement

Difference between Compiler and Interpreter

Following is a brief difference between compiler and interpreter:

CompilerInterpreter
The compiler converts a program into machine code as a wholeInterpreter converts the program into machine code statement by statement
The compiler creates object code fileInterpreter does not create object code file
A compiler converts a high-level program that can be executed many timesAn interpreter converts high-level program each time it is executed.
Programs execution is fastPrograms execution is slow
Compiler displays syntax errors after compiling the whole programInterpreter displays syntax error on each statement of program

 

Relationship of Object Program, Source Program, and Compiler

A source program is written by a programmer in a programming language such as C. This program is not in a form that a computer can understand. A compiler translates the source program into the object program that the computer can understand and execute.

 

 

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close