The compilation process consists of multiple phases that each take the output from the previous phase as input. The phases are: lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and code generation. The analysis phase consists of three sub-phases: lexical analysis, syntax analysis, and semantic analysis. Lexical analysis converts the source code characters into tokens. Syntax analysis constructs a parse tree from the tokens. Semantic analysis checks that the program instructions are valid for the programming language. The entire compilation process takes the source code as input and outputs the target program after multiple analysis and synthesis phases.