Construction
1
,The Role of the Parser
The parser obtains a string of tokens from the
lexical analyzer
Verifies that the string of token names can be
generated by the grammar for the source
language
2
, The Role of the Parser
The parser is expected to report any syntax
errors and to recover from commonly
occurring errors to continue processing
The parser constructs a parse tree and
passes it to the rest of the compiler for
further processing
3