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

Discussion

The number of phases in the classical model of a compiler is usually given as

  • A.three, covering only the front end of the whole compiler
  • B.ten, one for each optimisation that a compiler may perform
  • C.two, being simply the analysis and the synthesis of a program
  • D.six, spanning lexical analysis through to code generation

Answer: D

Correct answer: six, spanning lexical analysis through to code generation

The classical model has lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimisation and code generation.

The first three are the analysis phase or front end and the last three the synthesis phase or back end, which is the two-part division the third option describes at a coarser grain. Alongside them run the symbol table manager and the error handler, which interact with every phase rather than occupying a position in the sequence.

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

Post your comment

Please log in or register to post a comment.