COMPILER DESIGN
Addison-Wesley Publishing Co. -
0-201-42290-5 * Hardback * 608 pages * ©1995
Their functionality is (almost) well defined. Ideally, there exist formal, or at least precise descriptions of the source language and the target language. Frequently, there also exist descriptions of the interfaces to the operating system, to the programming environment, to other compilers and to program libraries.
The decomposition of the compilation tasks into subtasks with well-defined interfaces is well understood. This results in a natural modular structure, which, incidentally, is also reflected in the usual structure of books on compiler design.
Some of the various subtasks of compilation have been very extensively studied. The corresponding theories were developed specifically or taken over from the theory of formal languages and automata. They provide a good basis for the implementation of modules for compiler subtasks. For some of the subtasks, there even exist mechanisms for their formal description and generation procedures that generate parts of compilers automatically from such formal descriptions. Many such generators are available and in use.
This book is not a cook book. You will not find recipes of the form "to construct a compiler from source language X into machine language Y, take . . .". The presentation reflects the special characteristics of compiler design listed above, including, in particular, the existence of the theory and the automatic generation methods.
This book is intended for advanced undergraduate and graduate students specializing in computer science. A knowledge of imperative programming languages is a prerequisite. While the chapters on the compilation of functional, logic and object-oriented programming languages each contain a long introduction to the concepts of these language classes, it is advisable to learn a modern functional language, Prolog and Smalltalk, Eiffel or C++, for a better understanding of the corresponding chapters. In addition, the reader will profit from a good grounding in the theory of formal languages and automata, although the theory needed is always presented in full.
In each case, the starting point is an analysed source program which we shall later refer to as associated decorated abstract syntax.
In Chapters 6 to 12 we describe the how of compilation, namely how the compilation process is divided into individual phases, the tasks performed by these phases, the techniques used in them, how what they do can be formally described and how a compiler module can be generated (even automatically) from such a description.
Material for a two- or three-term lecture course can be selected from this book, depending on the time available. Chapter 2 and material from Chapters 6-9, 11 and 12 would su±ce for a conventional one-term lecture course on the compilation of imperative programming languages. A two-term lecture course would cover the compilation of functional, logic and object-oriented programming languages together with areas of current research such as abstract interpretation and code generation for parallel target architectures.
The number of those who have actively cooperated in this work and/or provided constructive criticism of it is so large that we are unable to thank them all personally here. We are particularly grateful to Martin Alt, Ingrid Biehl, Christian Fecht, Christian Ferdinand, Reinhold Heckmann, Adreas Hense, Stefan Kahrs, Peter Lipps, Gudula Rünger, Georg Sander and Helmut Seidl. The TeXnicians Christine Wentz and Patrik Zeimetz have patiently processed several revisions.
Reinhard Wilhelm, Dieter Maurer April 1992
Since the German edition is apparently extensively used, we have received numerous suggestions for improvements, for which we are especially grateful to Reinhold Heckmann, Helmut Seidl and, in particular, Helmut Partsch. Material related to this book, for example, a specification of an accompanying compiler laboratory project, can be obtained by anonymous ftp from ftp.cs.uni-sb.de in /pub/compiler.
Reinhard Wilhelm, Dieter Maurer