A semantic analyzer is a 3rd phase of the compiler. The following program makes use of grammar used in a desktop calculator. The user has to enter a mathematical expression, based on the grammar of a desktop calculator it creates a parse tree for order of evaluation.