没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
8=6GA:HC#;>H8=:G
8dbejiZgHX^ZcXZh
Jc^kZgh^ind[L^hXdch^cÄBVY^hdc
GDC@#8NIGDC
8dbejiZgHX^ZcXZVcY:c\^cZZg^c\
LVh]^c\idcJc^kZgh^in
G>8=6G9?#AZ7A6C8!?g#
8dbejiZgHX^ZcXZ
VcYHd[ilVgZ:c\^cZZg^c\
HZViiaZJc^kZgh^in
Addison-Wesley
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
8gV[i^c\
V8dbe^aZg
Editor-in-Chief: Michael Hirsch
Acquisitions Editor: Matt Goldstein
Editorial Assistant: Chelsea Bell
Managing Editor: Jeff Holcomb
Director of Marketing: Margaret Waples
Marketing Manager: Erin Davis
Marketing Coordinator: Kathryn Ferranti
Media Producer: Katelyn Boller
Senior Manufacturing Buyer: Carol Melville
Senior Media Buyer: Ginny Michaud
Art Director: Linda Knowles
Cover Designer: Elena Sidorova
Printer/Binder: Hamilton Printing Co.
Cover Printer: Lehigh Phoenix Hagerstown
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
The programs and applications presented in this book have been included for their instructional value.
They have been tested with care, but are not guaranteed for any particular purpose. The publisher does
not offer any warranties or representations, nor does it accept any liabilities with respect to the
programs or applications.
Library of Congress Cataloging-in-Publication Data
Fischer, Charles N.
Crafting a compiler / Charles N. Fischer, Ron K. Cytron, Richard J. LeBlanc, Jr.
p. cm. -- (Crafting a compiler with C)
Includes bibliographical references and index.
ISBN 978-0-13-606705-4 (alk. paper)
1. Compilers (Computer programs) I. Cytron, Ron K. (Ronald Kaplan), 1958- II. LeBlanc, Richard J.
(Richard Joseph), 1950- III. Title.
QA76.76.C65F57 2009
005.4'53--dc22
2009038265
Copyright © 2010 Pearson Education, Inc., publishing as Addison-Wesley. All rights reserved.
Manufactured in the United States of America. This publication is protected by Copyright, and
permission should be obtained from the publisher prior to any prohibited reproduction, storage in a
retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying,
recording, or likewise. To obtain permission(s) to use material from this work, please submit a written
request to Pearson Education, Inc., Permissions Department, 501 Boylston Street, Suite 900, Boston,
Massachusetts, 02116.
10 9 8 7 6 5 4 3 2 1—HA—13 12 11 10 09
Addison-Wesley
is an imprint of
www.pearsonhighered.com
ISBN 10: 0-13-606705-0
ISBN 13: 978-0-13-606705-4
Preface
Much has changed since Crafting a Compiler, by Fischer and LeBlanc, was
published in 1988. While instructors may remember the 5
1
4
-inch floppy disk of
software that accompanied that text, most students today have neither seen nor
held such a disk. Many changes have occurred in the programming languages
that students experience in class and in the marketplace. In 1991 the book
was available in two forms, with algorithms presented in either C or Ada.
While C remains a popular language, Ada has become relatively obscure and
did not achieve its predicted popularity. The C++ language evolved from
C with the addition of object-oriented features. Java
TM
was developed as a
simpler object-oriented language, gaining popularity because of its security
and ability to be run within a Web browser. The College Board Advanced
Placement curriculum moved from Pascal to C++ to Java.
While much has changed, students and faculty alike continue to study and
teach the subject of compiler construction. Research in the area of compilers
and programing language translation continues at a brisk pace, as compilers
are tasked with accommodating an increasing diversity of architectures and
programming languages. Software development environments depend on
compilers interacting successfully with a variety of software toolchain compo-
nents such as syntax-informed editors, performance profilers, and debuggers.
All modern software efforts rely on their compilers to check vigorously for
errors and to translate programs faithfully.
Some texts experience relatively minor changes over time, acquiring per-
haps some new exercises or examples. This book reflects a substantive revision
of the material from 1988 and 1991. While the focus of this text remains on
teaching the fundamentals of compiler construction, the algorithms and ap-
proaches have been brought into modern practice:
• Coverage of topics that have faded from practical use (e.g., attribute
grammars) has been minimized or removed altogether.
• Algorithms are presented in a pseudocode style that should be familiar to
students who have studied the fundamental algorithms of our discipline.
iii
iv Preface
Pseudocode enables a concise formulation of an algorithm and a rational
discussion of the algorithm’s purpose and construction.
The details of implementation in a particular language have been rele-
gated to the Crafting a Compiler Supplement which is available online:
http://www.pearsonhighered.com/fischer/
• Parsing theory and practice are organized to facilitate a variety of peda-
gogical approaches.
Some may study the material at a high level to gain a broad view of top-
down and bottom-up parsing. Others may study a particular approach
in greater detail.
• The front- and back-end phases of a compiler are connected by the ab-
stract syntax tree (AST), which is created as the primary artifact of pars-
ing. Most compilers build an AST, but relatively few texts articulate its
construction and use.
The visitor pattern is introduced for traversing the AST during semantic
analysis and code generation.
• Laboratory and studio exercises are available to instructors.
Instructors can assign some components as exercises for the students
while other components are supplied from our course-support Web site.
Some texts undergo revision by the addition of more graduate-level material.
While such information may be useful in an advanced course, the focus of
Crafting a Compiler remains on the undergraduate-level study of compiler con-
struction. A graduate course could be offered using Chapters 13 and 14, with
the earlier portions of the text serving as reference material.
Text and Reference
As a classroom text, this book is oriented toward a curriculum that we have
developed over the past 25 years. The book is very flexible and has been
adopted for courses ranging from a three-credit upper-level course taught in
a ten-week quarter to a six-credit semester-long graduate course. The text
is accessible to any student who has a basic background in programming,
algorithms, and data structures. The text is well suited to a single semester or
quarter offering because its flexibility allows an instructor to craft a syllabus
according to his or her interests. Author-sponsored solutions are available for
those components that are not studied in detail. It is feasible to write portions
of a compiler from parsing to code generation in a single semester.
剩余711页未读,继续阅读
资源评论
- zhuyingxiao2014-08-28这是一本国外计算机科学使用的教材
- zhjh_jh2014-06-10这是一本国外计算机科学使用的教材,看了看还不错,需要花点时间来仔细读读
- resource22015-09-24非常感谢~之前找了很久,但是没有找到java版的,这点比较可惜
zhaoyishuai1992
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功