编译器与语言设计导论
Introduction to Compilers and Language Design

原始链接: https://dthain.github.io/books/compiler/

《编译器与语言设计导论》(*Introduction to Compilers and Language Design*)由 Douglas Thain 教授编写,是一本为本科生一学期课程设计的免费开源教材。该书最初为圣母大学 CSE 40243 课程开发,旨在指导学生从零开始构建编译器。 读者将学习如何将一种类 C 语言编译为可运行的 X86 或 ARM 汇编代码。该课程最适合具备 C 语言、数据结构和计算机体系结构基础的学生。为辅助学习,作者在 GitHub 上提供了包含初始代码、扫描器、解析器和示例测试用例的代码库。 本书可供个人及学术免费使用,但禁止商业分发。建议用户直接链接至官方网站 [compilerbook.org](http://compilerbook.org),以获取最新版本。作者欢迎通过电子邮件反馈意见或勘误。偏好纸质书的读者也可购买精装或平装版本。

抱歉。
相关文章

原文

Introduction to Compilers and Language Design

This is a free online textbook: you are welcome to access the chapter PDFs directly below. If you prefer to hold a real book, you can also purchase a hardcover or paperback below. The textbook and materials have been developed by Prof. Douglas Thain as part of the CSE 40243 compilers class at the University of Notre Dame. Join our mailing list to receive occasional announcements of new editions and other updates.

A compiler translates a program written in a high level language into a program written in a lower level language. For students of computer science, building a compiler from scratch is a rite of passage: a challenging and fun project that offers insight into many different aspects of computer science, some deeply theoretical, and others highly practical. This book offers a one semester introduction into compiler construction, enabling the reader to build a simple compiler that accepts a C-like language and translates it into working X86 or ARM assembly language. It is most suitable for undergraduate students who have some experience programming in C, and have taken courses in data structures and computer architecture.

Introduction to Compilers and Language Design, 2nd Edition

The author grants permission to download, print, and use these PDFs for personal and academic use. Commercial printing or distribution is prohibited. Instead of copying PDFs locally, please point students to this page (compilerbook.org) so that they can access the latest version.

Code Resources. The compilerbook-examples github repository contains additional resources that correspond to the book, including several scanners and parsers, a starter code structure for the project compiler, and sample test cases for each stage of the scanner, parser, typechecker, and code generator.

Errata. Found a typo or mistake? Please send an email to the author `[email protected]` with the title "Compiler Book Errata" and I'll be happy to correct it and acknowledge you in the next edition.

联系我们 contact @ memedata.com