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

Moore, John I.

  • 出版商: Softmoore Consulting
  • 出版日期: 2022-09-16
  • 售價: $1,720
  • 貴賓價: 9.5$1,634
  • 語言: 英文
  • 頁數: 352
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1734139129
  • ISBN-13: 9781734139129
  • 相關分類: 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 several lookahead tokens.

商品描述(中文翻譯)

這本書主要設計為大學生和初級研究生的一學期編譯器設計課程教材。這本書的先決條件是熟悉基本算法和數據結構(列表、映射、遞歸等),對計算機體系結構和組合語言有基本了解,以及一些使用Java編程語言的經驗。

完整學習編譯器可能需要數個研究生課程的時間,因此為了讓本書適合大學生,需要進行一些簡化和妥協。以下是為了達到本書目標所做的一些決策。

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

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

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

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

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