Which of the following is the CORRECT sequence of the phases of a compiler?

2023

Which of the following is the CORRECT sequence of the phases of a compiler?

  1. A.

    Lexical analysis, syntax analysis, intermediate code generation, code generation, code optimization

  2. B.

    Lexical analysis, intermediate code generation, syntax analysis, code generation, code optimization

  3. C.

    Lexical analysis, intermediate code generation, syntax analysis, code optimization, code generation

  4. D.

    Lexical analysis, syntax analysis, intermediate code generation, code optimization, code generation

Attempted by 82 students.

Show answer & explanation

Correct answer: D

The standard order among the listed phases is lexical analysis, syntax analysis, intermediate code generation, code optimization, and then code generation.

Explore the full course: Niacl Ao It Specialist