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

Example 7

In this example, at code generator generation time, tables are created which describe abstract syntax tree patterns to be matched (at code generation time) and the code to be generated. Thus, the pattern for an abstract syntax (sub) tree node whose root is a * operator and whose children are a symbol and a constant, is stored together with the code that gets the next the next available register and emits a move instructiom and a multiply instruction.

At code generation time, when an abstract syntax tree that matches this is input, the code is output. This is called retargetable since the tables can be easily changed to output code for another machine.