Introduction to Compiler Design: An Object-Oriented Approach Using Java(R)

Moore, John I.

  • 出版商: Softmoore Consulting
  • 出版日期: 2020-10-05
  • 定價: $1,650
  • 售價: 9.5$1,568
  • 語言: 英文
  • 頁數: 302
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1734139110
  • ISBN-13: 9781734139112
  • 相關分類: Object-orientedCompiler
  • 立即出貨



This book is designed primarily for use as a textbook in a one-semester course on compiler design for undergraduate students and beginning graduate students. The only prerequisites for this book are familiarity with basic algorithms and data structures (lists, maps, recursion, etc.), a rudimentary knowledge of computer architecture and assembly language, and some experience with the Java programming language.


A complete study of compilers could easily fill several graduate-level courses, and therefore some simplifications and compromises are necessary for a one-semester course that is accessible to undergraduate students. Following are some of the decisions made in order to accommodate the goals of this book.


  1. The book has a narrow focus as a project-oriented course on compilers. Compiler theory is kept to a minimum, but the project orientation retains the "fun" part of studying compilers.
  2. The source language being compiled is relatively simple, but it is powerful enough to be interesting and challenging. It has basic data types, arrays, procedures, functions, and parameters, but it relegates many other interesting language features to the project exercises.
  3. The target language is assembly language for a virtual machine with a stack-based architecture, similar to but much simpler than the Java Virtual Machine (JVM). This approach greatly simplifies code generation. Both an assembler and an emulator for the virtual machine are provided on the course web site.
  4. No special compiler-related tools are required or used within the book. Students require access only to a Java compiler and a text editor, but most students will want to use Java with an Integrated Development Environment (IDE).
  5. One very important component of a compiler is the parser, which verifies that a source program conforms to the language syntax and produces an intermediate representation of the program that is suitable for additional analysis and code generation. There are several different approaches to parsing, but in keeping with the focus on a one-semester course, this book emphasizes only one approach, recursive descent parsing with one symbol lookahead.





1. 本書以項目導向的方式,專注於編譯器課程。編譯器理論被降到最低限度,但項目導向保留了學習編譯器的「有趣」部分。

2. 被編譯的源語言相對簡單,但足夠有趣和具有挑戰性。它具有基本的數據類型、數組、過程、函數和參數,但將許多其他有趣的語言特性留給項目練習。

3. 目標語言是一個基於堆疊架構的虛擬機器的組合語言,類似於但比Java虛擬機器(JVM)簡單得多。這種方法極大地簡化了代碼生成。課程網站上提供了虛擬機器的組合語言編譯器和仿真器。

4. 本書不需要或使用任何特殊的與編譯器相關的工具。學生只需要一個Java編譯器和一個文本編輯器,但大多數學生可能會選擇使用帶有集成開發環境(IDE)的Java。

5. 編譯器的一個非常重要的組件是解析器,它驗證源程序是否符合語言語法並生成適合進一步分析和代碼生成的中間表示。解析有幾種不同的方法,但為了保持一學期課程的重點,本書僅強調一種方法,即具有一個符號向前展望的遞歸下降解析。