Macmillan (now part of Palgrave) 1988; ISBN 0-333-47155-5
September 1998: Out of print. We hope to make the text available on-line - we are waiting to hear from Palgrave about the rights.
In chapters 1 to 5 a complete compiler for a simple language is presented. The simple language is a small subset of Pascal. This compiler is written in standard Pascal and generates code for a simple hypothetical machine. An interpreter for the hypothetical machine code is also provided to allow compiled programs to be run. These chapters form a self contained introduction to compilers and can be read independently from the rest of the book.
In chapters 6 to 15 the organisation of, the algorithms used in, and the form of compiled code generated by a complete Pascal system are considered in some detail. The ideas introduced in the simple compiler are developed, extended and applied to the construction of a Pascal compiler. The use of compiler construction tools, such as LEX and YACC, is described with further examples. In considering the compiled code, sufficient detail is given to expose typical constraints imposed by real computers which can be overlooked in hypothetical examples. Examples are given for DEC PDP11 and Motorola MC68000 series processors.
The final chapter discusses the differences between a compiler for Pascal and one for Modula-2.
At the end of this text the hope is that the reader will have firstly, a thorough comprehension of the correspondence between high level programming language statements and machine instructions. Secondly, he or she should understand how high level language constructs are transformed or translated into machine instructions. Finally, the reader should be able to tackle a compiler construction project, should the need arise.
Peter Jinks is Lecturer in Computer Science at Manchester University. He designed the instruction set for MU6. He constructed code generators for MU6 and for the PDP11. He is a member of the ParSiFal project team researching the mapping of algorithms onto parallel hardware.