Compiler design: phases of compiler


Tokens are generated after which of the following phases?
A) lexical analysis
B) semantic analysis
D) Code optimisation


the answer is lexical analyser.
it takes the source language as input and generate tokens from it which are passed as input to next phase.