recategorized by
19,970 views
47 votes
47 votes

Generation of intermediate code based on an abstract machine model is useful in compilers because

  1. it makes implementation of lexical analysis and syntax analysis easier

  2. syntax-directed translations can be written for intermediate code generation

  3. it enhances the portability of the front end of the compiler

  4. it is not possible to generate code for real machines directly from high level language programs

recategorized by

2 Answers

Best answer
49 votes
49 votes
C. stating the actual use of the Intermediate Code.

Also optimizations can be done on intermediate code enhancing the portability of the optimizer.
selected by
0 votes
0 votes
Answer- C  ( it enhances the portability of the front end of the compiler )
Using an abstract machine model for intermediate code generation enables the front end of the compiler to be more portable across different hardware platforms, as it can produce intermediate code that can later be translated into machine code for various target architectures.

When compilers generate intermediate code based on an abstract machine model, they create a representation of the program's logic that is independent of the target hardware architecture. This means that the intermediate code is designed to work on a hypothetical machine, abstracting away specific hardware details.

This abstraction enhances the portability of the compiler's front end because it allows the front end to focus on translating high-level language constructs into the intermediate code without worrying about the intricacies of different hardware platforms. Once the front end generates the intermediate code, the back end of the compiler can then translate this intermediate code into machine code tailored to the specific target architecture.
Answer:

Related questions

17 votes
17 votes
3 answers
1
Kathleen asked Oct 5, 2014
4,616 views
Find the inverse of the matrix $\begin{bmatrix} 1 & 0 & 1 \\ -1 & 1 & 1 \\ 0 & 1 & 0 \end{bmatrix}$
21 votes
21 votes
7 answers
2
Kathleen asked Oct 4, 2014
18,432 views
Algorithm design technique used in quicksort algorithm is?Dynamic programmingBacktrackingDivide and conquerGreedy method
19 votes
19 votes
3 answers
3
33 votes
33 votes
2 answers
4
Kathleen asked Oct 4, 2014
11,407 views
A memory page containing a heavily used variable that was initialized very early and is in constant use is removed thenLRU page replacement algorithm is usedFIFO page rep...