GATE|GATE-CS-2014 PAPER-03|Question8
One of the purposes of using intermediate code in compilers is to
(A) make parsing and semantic analysis simpler.
(B) Improve error recovery and error reporting.
(C) Increase the chance of reusing the machine-independent code optimizer in other compilers.
(D)Improve the register allocation
Answer (C)
Intermediate code is machine independent code which makes it easy to retarget the compiler to generate code for newer and different processor.
Intermediate code is machine independent.So can be executed on different platforms.
It makes the task of code optimization easy.A machine independent codes optimizer can be applied to intermediate code to optimize code generation.
Types of intermediate code representation
- Postfix notation.
- Syntax tree
- Three address code.(Quadruples,Triples,Indirect triples).
0 Comments