Computer Language Translator Programs.
They work electronically and therefore, must represent data and instructions in binary (1st and 0s) form. Language Translator Programs are those programs who converts or translates programming language (high-level language) into 1s and 0s, or machine language (low-level language) language translators use two methods to translate the high-level language. They either compile or interpret it.
Language Translator Programs or language processors are programs that translate programs into machine language instructions.
They also provide creative and editing facilities for writing programs, in high-level languages, such as BASIC, COBOL, or PASCAL. Programming language translator programs are of following types:
The assembler translates the programs written in an assembler language into machine language instructions for execution.
Last three generations are included in high-level languages.
A compiler is a program that translates a high-level language into machine language. It translates the whole high-level language program at once into machine language before it is executed.
Source programming A program written by a programmer in a high-level language is called a source program.After this source program has been converted into machine language by a compiler.
It is referred to as an object program.
Object programming The object program is saved as a program file ready for execution at any time desired.
The input to a compiler (program) is a source program written in a high-level language and its output is an object program which consists of machine language instructions.
Note that the source program and the object program are the same programs but at different stages of development.
The compiler can diagnose the following kinds of errors in a source program.
- Illegal characters.
- Illegal combinations of characters.
- Improper sequencing of instruction in a program.
A source program containing an error diagnosed by the compiler will not be compiled into an object program. The compiler will print out a suitable message indicating this along with a list of the error message which indicates the type of errors committed.
An interpreter is a program that translates a high-level programming language into machine language during the actual step execution of a program. Translation and execution alternate for each statement encountered in the high-level language program.
In other words, an interpreter translates one instruction and the control unit executes the resulting machine language the next instruction is translated and the control unit executes the machine language instruction and so on if the program is run seven times a day the programming language is reinterpreted seven times.