Vidyalelo
Computer Fundamentals · Q476

Operating System

Computer Related · Computer Fundamentals · question 476

Q476

Which of the following is a phase of a compilation process

A.
Lexical analysis
B.
Code generation
C.
Both of the above
Answer
D.
Static analysis
E.
None of the above

Answer: Option C

Solution

Answer: Option C
Solution:
Compiler operates in various phases each phase transforms the source program from one representation to another. Every phase takes inputs from its previous stage and feeds its output to the next phase of the compiler.
There are 6 phases in a compiler. Each of this phase help in converting the high-level langue the machine code. The phases of a compiler are:
I. Lexical analysis
II. Syntax analysis
III. Semantic analysis
IV. Intermediate code generator
V. Code optimizer
VI. Code generator