6.0 Introduction

6.1 Static Checking

6.2 Attribute Grammars

6.3 Translation to an IR

6.4 Semantic Analyzer Generators

6.5 More on Attribute Grammars

6.6 Attribute Evaluation

6.7 Summary

Web References

Exercises

6.3 Translation to an Intermediate
Representation

In order to perform optimizations on a program and to generate code, it is convenient to produce an intermediate representation better suited to these tasks than the parse tree representation. Abstract syntax trees (AST's), are used in many modern compilers. Diana, the intermediate language for Ada, is an attributed AST.

We will show the following intermediate representations: