This book provides a gently paced introduction to techniques for implementing programming languages by means of compilers and interpreters, using the object-oriented programming language Java. The book aims to exemplify good software engineering principles at the same time as explaining the specific techniques needed to build compilers and interpreters.
• The book shows clearly how a simple compiler can be decomposed into a syntactic analyzer, a contextual analyzer, and a code generator, communicating via an abstract syntax tree.
• The book is accompanied by a complete working compiler and interpreter, provided via the Internet, and free of charge for educational use.
• The book contains numerous exercises, together with sample answers to selected exercises. It also contains a number of suggested projects, involving extensions to the accompanying compiler.
• All examples in the book are expressed in Java, and the compiler and interpreter are structured using object-oriented design patterns.