Syntactic Analysis:The Parser
A Parser: reads (token,lexeme) pairs from the Scanner and recognizes the tokens in the grammar of the language
builds a parse tree, corresponding to the grammar, for the semantic analyser
determines the structure of the language
doesnt know about the characters that make up the language (Scanner)
doesnt know anything about the meaning of the grammar (Semantics)
usually recursive, e.g. to handle nesting
- parentheses: S := ( expr )
- blocks: BEGIN, END