Which translation is needed for c programming language




















A program written in high-level language is called as source code. To convert the source code into machine code, translators are needed. A translator takes a program written in source language as input and converts it into a program in target language as output. It also detects and reports the error during translation. Roles of translator are:. The different types of translator are as follows:. Compiler is a translator which is used to convert programs in high-level language to low-level language.

It translates the entire program and also reports the errors in source program encountered during the translation. Interpreter is a translator which is used to convert programs in high-level language to low-level language. It converts the whole program in one session and reports errors detected after the conversion. Compiler takes time to do its work as it translates high-level code to lower-level code all at once and then saves it to memory. A compiler is processor-dependent and platform-dependent.

But it has been addressed by a special compiler, a cross-compiler and a source-to-source compiler. Before choosing a compiler, user has to identify first the Instruction Set Architecture ISA , the operating system OS and the programming language that will be used to ensure that it will be compatible. Just like a compiler, is a translator used to convert high-level programming language to low-level programming language.

It converts the program one at a time and reports errors detected at once, while doing the conversion. With this, it is easier to detect errors than in a compiler. Any program written in a high level language is known as source code. However, computers cannot understand source code. Before it can be run, source code must first be translated into a form which a computer understands - this form is called object code. A translator is a program that converts source code into object code.

Generally, there are three types of translator:. Translating source code into machine code. A compiler takes the source code as a whole and translates it into object code all in one go.



0コメント

  • 1000 / 1000