COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Must
|
|
Optional
|
|
depends on language
|
|
none of the above
|
Detailed explanation-1: -If a compiler translates the source language to its target machine language without having the option for generating intermediate code, then for each new machine, a full native compiler is required.
Detailed explanation-2: -Intermediate code can translate the source program into the machine program. Intermediate code is generated because the compiler can’t generate machine code directly in one pass. Therefore, first, it converts the source program into intermediate code, which performs efficient generation of machine code further.
Detailed explanation-3: -Hence, one of the purposes of using intermediate code in compilers is to increase the chance of reusing the machine-independent code optimizer in other compilers.
Detailed explanation-4: -In the analysis-synthesis model of a compiler, the front end of a compiler translates a source program into an independent intermediate code, then the back end of the compiler uses this intermediate code to generate the target code (which can be understood by the machine).
Detailed explanation-5: -Intermediate code can be represented in three forms, which are postfix notation, Syntax trees, Three address code.