COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Intermediate code generation for a compiler is
A
Must
B
Optional
C
depends on language
D
none of the above
Explanation: 

Detailed explanation-1: -Intermediate code eliminates the need of a new full compiler for every unique machine by keeping the analysis portion same for all the compilers. The second part of compiler, synthesis, is changed according to the target machine.

Detailed explanation-2: -In the intermediate code generation, compiler generates the source code into the intermediate code. Intermediate code is generated between the high-level language and the machine language. The intermediate code should be generated in such a way that you can easily translate it into the target machine code.

Detailed explanation-3: -Role of Code Optimization It is the fifth stage of a compiler, and it allows you to choose whether or not to optimize your code, making it really optional. It aids in reducing the storage space and increases compilation speed.

There is 1 question to complete.