Syntax Analysis
. Check syntax and construct abstract syntax tree

. Error reporting and recovery
. Model using context free grammars
. Recognize using Push down automata/Table Driven Parsers
This is the second phase of the compiler. In this phase, we check the syntax and construct the abstract syntax tree. This phase is modeled through context free grammars and the structure is recognized through push down automata or table-driven parsers. The syntax analysis phase verifies that the string can be generated by the grammar for the source language. In case of any syntax errors in the program, the parser tries to report as many errors as possible. Error reporting and recovery form a very important part of the syntax analyzer. The error handler in the parser has the following goals:
. It should report the presence of errors clearly and accurately.
. It should recover from each error quickly enough to be able to detect subsequent errors.
. It should not significantly slow down the processing of correct programs.
|