"Z Code Writer" is an Online Blog for Programmer & Beginner. Here, You will Find tech, Build your Programming Skills and other Programming Language Like C, C++, HTML, Java Script Java Code, Web Designing and University Of Sialkot (USKT) CGPA / GPA Calculator etc.

Thursday, 20 June 2019

Language Translator & Types of Language Translator.


Language Translator

                A computer only understand instruction in machine code (0 and 1). It is difficult to write computer program directly in machine code. Today, mostly the programs are written in high-level language such as  C/C++ ans BASIC.
                The program written in high-level language must be translated into machine code before running on computer. A type of system software that is used to translate the program written in high-level language ( or  assembly language ) into machine code is  called language translator. The language translator are also called language processor. Every language has its own language translator program.

Types of Language Translators

        The language processor are divided into three type.
i)        Compiler
ii)       Interpreter
iii)      Assembler

Compiler

                The language translator program that translate the complete source program into machine code as a whole is called compiler. The C and C++ compilers are example of compiles.
                The program translated into machine code is called the object program. The source code is translated into object code successfully if it is free of errors. If there are any error in the source code, the compiler specifies the errors at the end of compilation. The error must be removed before the compiler can successfully compile the source code. The object program can be executed a number of times without translating  it again.

Interpreter

          The language translator program that translates the source code into machine code statement by statement is called interpreter. It is translate one statement of source code into machine code and executes it immediately before translating the next statement. If there is an error in the statement, the interpreter terminates its translating process at that statement. It also displays an error message. The GWBASIC is an example of an interpreter program.
            The main advantage of interpreter is that it makes easier to detect and correct errors in source program.
 The main disadvantage of interpreter are as following:

  • It is a consuming process of translating and executing statement one by one.

  • Each time the program is run, the source code is translated again. For this purpose you must have a translator program (interpreter) permanently in your computer.

Assembler

            The language translator program that translates the program written in assembly language into machine code is called assembler.


No comments:

Post a Comment

Thanks For Visiting Here...!! I will Reply you as soon as possible.