COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is an interpreter?
A
Converts source code one instruction at a time
B
Converts source code between 2 HLLs
C
Converts source code between HLL and Assembly
D
Converts keyboard presses to an ASCII code
Explanation: 

Detailed explanation-1: -An interpreter is a translator that converts source code into machine code one instruction at a time. Or by using a compiler, which allows to translate all the instructions at once. What is a compiler? A compiler is a translator that converts source code into machine code all in one go.

Detailed explanation-2: -An interpreter translates source code into object code one instruction at a time. It is similar to a human translator translating what a person says into another language, sentence by sentence. The resulting object code is then executed immediately. The process is called interpretation .

Detailed explanation-3: -An interpreter translates one instruction at a time and executes that instruction immediately. Examples of interpreted languages are JavaScript, Python, Perl, etc.

Detailed explanation-4: -The correct answer is Compiler. Compiler-A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or “code” that a computer’s processor uses. Example-Pascal, C etc.

Detailed explanation-5: -A compiler does the translation all at once. It produces a complete machine language program that can then be executed. An interpreter, on the other hand, just translates one instruction at a time, and then executes that instruction immediately.

There is 1 question to complete.