1. Lexical analysis (Scanning)
Breaking out the source code into token(keywords, identifiers, operators and literals
The stream of tokens acts as an input to the next phase
2. Syntax analysis(parsing )
Checks the sequence of the tokens for syntactic errors as per the Grammer rules of the programming language
Constructs a parse tree (syntax) tree that represents the syntactic structure of the program
3. Semantic analysis
Checks the meaning of each statement as per the language rules
Ensures the the declaration, types and usage is variables and functions are semantically correct
Generates an annoyed syntax tree ( AST) with type informs and references