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

Scanner Generators

A scanner, or lexical analyzer, finds the elementary pieces of the program called tokens.

The metalanguage to a scanner generator consists of regular expressions. These regular expressions describe tokens that the generated scanner will then be able to find when a source program is input.

Example 1 shows the regular expressions for the tokens for the components of typical assignment statements.

Example 2 shows an input and output for the generated scanner.

Module 3 discusses the details of generating such a scanner.