Machine-translated by Google. Questions are authored in English.
Top

Discussion

The principal reason compiler construction is taught as a structured sequence of phases is that

  • A.the decomposition makes a large translation problem tractable
  • B.the phases must be implemented as separate programs by law
  • C.no compiler has ever been written without exactly six phases
  • D.the source language standard prescribes the phase structure

Answer: A

Correct answer: the decomposition makes a large translation problem tractable

Translating a high-level language to machine code is too large a problem to attack whole. Dividing it into phases with defined inputs and outputs lets each be designed, implemented and tested on its own.

It also creates the interfaces that make front ends and back ends interchangeable. The structure is an engineering convention, not a legal requirement or a standard's prescription, and real compilers merge phases into passes freely - the logical division survives the physical one.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.