1.0 Introduction

1.1 History

1.2 Characteristics

1.3 Scanner Generators

1.4 Parser Generators

1.5 Semantic Analyzer Generators

1.6 Optimization

1.7 Code Generation

1.8 Summary

Web References

Exercises

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.