A Retargetable C Compiler: Design and Implementation (Hardcover)
David R. Hanson, Christopher W. Fraser
- 出版商: Benjamin Cummins
- 出版日期: 1995-01-31
- 售價: $2,650
- 貴賓價: 9.5 折 $2,518
- 語言: 英文
- 頁數: 584
- 裝訂: Paperback
- ISBN: 0805316701
- ISBN-13: 9780805316704
-
相關分類:
C 程式語言、Compiler
-
相關翻譯:
可變目標C編譯器:設計與實現 (簡中版)
海外代購書籍(需單獨結帳)
買這商品的人也買了...
-
$580$458 -
$680$537 -
$980$774 -
$920$727 -
$720$569 -
$450$360 -
$450$351 -
$1,840$1,748 -
$1,880$1,786 -
$690$587 -
$620$558 -
$780$741 -
$750$638 -
$760$600 -
$580$458 -
$590$466 -
$680$537 -
$690$538 -
$720$569 -
$750$675 -
$560$504 -
$480$379 -
$750$593 -
$780$616 -
$680$537
相關主題
商品描述
Description
Designed as a self-study guide, the book describes the real-world tradeoffs encountered in building a production-quality, platform-retargetable compiler. The authors examine the implementation of lcc, a production-quality, research-oriented retargetable compiler, designed at AT&T Bell Laboratories for the ANSI C programming language. The authors' innovative approach-a "literate program" that intermingles the text with the source code-uses a line-by-line explanation of the code to demonstrate how lcc is built.
Table Of Contents
Preface.
1. Introduction.
How to Read This Book.
Overview.
Design.
Common Declarations.
Syntax Specifications.
Errors.
2. Storage Management.
Arena Representation.
Allocating Space.
Deallocating Space.
Strings.
3. Types.
Representing Symbol Tables.
Changing Scope.
Finding and Installing Identifiers.
Labels.
Constants.
Generated Variables.
4. Code Generation Interface.
Type Management.
Type Predicates.
Type Constructors.
Function Types.
Structure and Enumeration Types.
Type-Checking Functions.
Type Mapping.
5. Lexical Analysis.
Interface Records.
Symbols.
Types.
Dag Operators.
Interface Flags.
Initialization.
Definitions.
Constants.
Functions.
Interface Binding.
Upcalls.
6. Parsing.
Recognizing Tokens.
Recognizing Keywords.
Recognizing Identifiers.
Recognizing Numbers.
Recognizing Character Constants and Strings.
7. Expressions.
Ambiguity and Parse Trees.
Top-Down Parsing.
FIRST and FOLLOW Sets.
Writing Parsing Functions.
Handling Syntax Errors.
8. Expression Semantics.
Parsing Expressions.
Parsing C Expressions.
Assignment Expressions.
Conditional Expressions.
Binary Expressions.
Unary and Postfix Expressions.
Primary Expressions.
9. Expression Semantics.
Unary and Postfix Operators.
Function Calls.
Binary Operators.
Assignments.
Conditionals.
Constant Folding.
10. Statements.
Execution Points.
Recognizing Statements.
If Statements.
Labels and Gotos.
Loops.
Switch Statements.
Return Statements.
Managing Labels and Jumps.
11. Declarations.
Declarations.
Declarators.
Function Declarators.
Structure Specifiers.
Function Definitions.
Compound Statements.
Finalization.
The Main Program.
12. Generating Immediate Code.
Building Nodes.
Flow of Control.
Assignments.
Function Calls.
Enforcing Evaluation Order.
Driving Code Generation.
Eliminating Multiply Referenced Nodes.
13. Structuring the Code Generator.
Interface Extensions.
Upcalls.
Node Extensions.
Symbol Extensions.
Frame Layout.
Generating Code to Copy Blocks.
Initialization.
14. Selecting and Emitting instructions.
Labelling the Tree.
Reducing the Tree.
Cost Functions.
Debugging.
The Emitter.
Register Targeting.
Coordinating Instruction Selection.
Shared Rules.
15. Register Allocation.
Tracking the Register State.
Allocating Registers.
Spilling.
16. Generating MIPS R3000 Code.
Selecting Instructions.
Implementing Functions.
Defining Data.
Segments.
Copying Blocks.
17. Generating SPARC Code.
Selecting Instructions.
Implementing Functions.
Defining Data.
Copying Blocks.
18. Generating X86 Code.
Selecting Instructions.
Implementing Functions.
Defining Data.
19. Retrospective.
Interface.
Syntactic and Semantic Analyses.
Code Generation and Optimization.
Testing and Validation.
Bibliography.
Index.
How to Obtain ICC. 0805316701T04062001
商品描述(中文翻譯)
描述
設計為自學指南,本書描述了在建立一個生產品質、可重新定位平台的編譯器時所遇到的現實折衷。作者們檢視了lcc的實現,這是一個在AT&T貝爾實驗室為ANSI C編程語言設計的生產品質、研究導向的可重新定位編譯器。作者們創新的方法是一種「可讀程式」,將文本與源代碼交織在一起,通過對代碼的逐行解釋來展示lcc的構建過程。
目錄
前言
1. 簡介
可讀程式
如何閱讀本書
概述
設計
常見聲明
語法規範
錯誤
2. 儲存管理
記憶體管理介面
Arena表示
分配空間
釋放空間
字串
3. 類型
表示符號
表示符號表
更改範圍
查找和安裝識別符
標籤
常數
生成的變數
4. 代碼生成介面
表示類型
類型管理
類型預測
類型構造函數
函數類型
結構和枚舉類型
類型檢查函數
類型映射
5. 語法分析
類型度量
介面記錄
符號
類型
Dag運算符
介面標誌
初始化
定義
常數
函數
介面綁定
上調
6. 解析
輸入
識別標記
識別關鍵字
識別符
識別數字
識別字符常數和字串
7. 表達式
語言和文法
歧義和解析樹
自上而下解析
FIRST