This repository contains handouts, PowerPoint slides, and Java source files to accompany the book Compiler Design Using Java®: An Object-Oriented Approach (Third Edition) by John I. Moore, Jr. The book covers implementation of a compiler for CPRL (Compiler PRoject Language), a programming language designed for teaching the basics of compiler construction. CPRL includes variables, statements, expressions, arrays, records, and subprograms. The target language for the compiler is assembly language for the CPRL Virtual Machine (CVM), a virtual machine with a stack-based architecture that is similar to but much simpler than the Java Virtual Machine (JVM). The book is available on Amazon and, at a discount, directly from the publisher IngramSpark.
The organization of the compiler project into modules has changed from the original printing of the book. The assembler has been moved into a separate module, so now there are four modules for the compiler project. See Appendix A listed below for details.
The following sections from the book are provided as PDF documents in the Book
folder.
- Table of Contents
- Preface
- Appendix A: The Compiler Project
- Appendix C: Definition of the Programming Language CPRL
- Appendix E: Definition of the CPRL Virtual Machine