Analysis Phase : 2nd Phase of Compiler (Syntax Analysis)
Syntax Analysis :
- It is Second Phase Of Compiler after Lexical Analyzer
- It is also Called as Hierarchical Analysis or Parsing.
- It Groups Tokens of source Program into Grammatical Production.
- In Short Syntax Analysis Generates Parse Tree.
sum = num1 + num2
It only Checks for Syntax not meaning ,
- Example : ‘+’ Operators on two Operands
- It does not checks which type of operands they are.
- Suppose One of the Operand is String and other is Integer then it does not throw error as it only checks whether there are two operands associated with ‘+’ or not .
- So this Phase is also called Hierarchical Analysis as it generates Parse Tree Representation of the Tokens generated by Lexical Analyzer


