The Gateway to Computer Science Excellence
+22 votes

One of the purposes of using intermediate code in compilers is to

  1. make parsing and semantic analysis simpler.
  2. improve error recovery and error reporting.
  3. increase the chances of reusing the machine-independent code optimizer in other compilers.
  4. improve the register allocation.
in Compiler Design by Veteran (108k points)
edited | 2.4k views
why doesnt it improve register allocation? we allocate registers on the basis of 3 address code only. so why not d).


Nope. Register Allocation is part of Code Generation.

3 Answers

+30 votes
Best answer
C. that is the actual use of intermediate code generator in a compiler.
by Boss (19.9k points)
edited by
relocattable address is also a factor???
What does it mean by "code optimizer in other compilers." in question
it mean front end of that compiler can be used with back end of other compiler where we can also perform code optimization and code generation for actual code geeration
when we generate intermediate code it is independent of machine so we can easily implement the same code in different machines without performing the analysis phase of compiler again and again.
+3 votes
Intermediate code is machine independent code which makes it easy to retarget the compiler
to generate code for newer and different processors.
by Active (1.9k points)
+1 vote
Ans: C  intermediate code enhance the portability
by Loyal (7.4k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
51,925 questions
58,884 answers
112,471 users