Chapter 2: Introduction to compilers

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

Syntax Analysis is modeled on the basis of context free grammars. Programming languages can be written using context free grammars. Based on the rules of the grammar, a syntax tree can be made from a correct code of the language. A code written in a CFG is recognized using Push Down Automata. If there is any error in the syntax of the code then an error is generated by the compiler. Some compilers also tell that what exactly is the error, if possible.