Skip to main content
main-content

About this book

The second edition of this textbook has been fully revised and adds material about loop optimisation, function call optimisation and dataflow analysis. It presents techniques for making realistic compilers for simple programming languages, using techniques that are close to those used in "real" compilers, albeit in places slightly simplified for presentation purposes. All phases required for translating a high-level language to symbolic machine language are covered, including lexing, parsing, type checking, intermediate-code generation, machine-code generation, register allocation and optimisation, interpretation is covered briefly.

Aiming to be neutral with respect to implementation languages, algorithms are presented in pseudo-code rather than in any specific programming language, but suggestions are in many cases given for how these can be realised in different language flavours.

Introduction to Compiler Design is intended for an introductory course in compiler design, suitable for both undergraduate and graduate courses depending on which chapters are used.

Table of Contents

2017 | OriginalPaper | Chapter

Chapter 1. Lexical Analysis

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 2. Syntax Analysis

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 3. Scopes and Symbol Tables

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 4. Interpretation

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 5. Type Checking

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 6. Intermediate-Code Generation

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 7. Machine-Code Generation

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 8. Register Allocation

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 9. Functions

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 10. Data-Flow Analysis and Optimisation

Torben Ægidius Mogensen

2017 | OriginalPaper | Chapter

Chapter 11. Optimisations for Loops

Torben Ægidius Mogensen
Additional information