Parser Generators


The input to a parser generator is a Context-free grammar. Context-free grammars describe the constructs found by a parser. We will use BNF for our example. BNF is actually a notation (or yet another metalanguage) for context-free grammars.

Example 4 shows the results when the generated parser is used. (The nonterminal Expression has been abbreviated Expr. ) The tokens have been parsed, producing a parse tree.

As with the generated scanner, the output is produced only during the debugging of the generated compiler pieces.

Send questions and comment to: Karen Lemone