in Compiler Design edited
6,880 views
34 votes
34 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 edited
6.9k views

3 Comments

1
1
why doesnt it improve register allocation? we allocate registers on the basis of 3 address code only. so why not d).
0
0

@Rhythm

Nope. Register Allocation is part of Code Generation.

0
0

3 Answers

36 votes
36 votes
Best answer
C. that is the actual use of intermediate code generator in a compiler.
edited by

4 Comments

relocattable address is also a factor???
0
0
What does it mean by "code optimizer in other compilers." in question
0
0
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
4
4
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.
7
7
6 votes
6 votes
Intermediate code is machine independent code which makes it easy to retarget the compiler
to generate code for newer and different processors.
1 vote
1 vote
Ans: C  intermediate code enhance the portability
Answer:

Related questions