Modern compiler implementation in C = 现代编译原理 : C语言描述 /
副标题:无
作 者:Andrew W. Appel, Maia Ginsburg著.
分类号:
ISBN:9787115137715
微信扫一扫,移动浏览光盘
简介
本书全面讲述了现代编译器的各个组成部分,包括词法分析、语法分析、抽象语法、语义检查、中间代码表示、指令选择、数据流分析、寄存器分配以及运行时系统等。全书分成两部分,第一部分是编译的基础知识,适用于第一门编译原理课程(一个学期);第二部分是高级主题,包括面向对象语言和函数语言、垃圾收集、循环优化、ssa(静态单赋值)形式、循环调度、存储结构优化等,适合于后续课程或研究生教学。书中专门为学生提供了一个用c语言编写的实习项目,包括前端和后端设计,学生可以在一学期内创建一个功能完整的编译器。.
全书分成两部分,第一部分是编译的基础知识,适用于第一门编译原理课程(一个学期);第二部分是高级主题,包括面向对象语言和函数式语言。垃圾收集,循环优化、ssa(静态单赋值)形式。循环调度、存储结构优化等,适合于专题选讲,后续课程或研究生教学。..
本书在国外享有“虎书”的称号,与有“龙书”之称的《编译原理》(alfred aho等编著)齐名,而在先进性和新颖性方面则更胜后者一筹。国际上众多名校均采用本书作为编译原理课程的教材,包括美国麻省理工学院,加州大学伯克利分校、普林斯顿大学和英国剑桥大学等。...
目录
preface vii
part i fundamentals of compilation
1 introduction 3
1.1 modules and interfaces 4
1.2 tools and software 5
1.3 data structures for tree languages 7
2 lexical analysis 16
2.1 lexical tokens 17
2.2 regular expressions 18
2.3 finite automata 21
2.4 nondeterministic finite automata 24
2.5 lex: a lexical analyzer generator 30
3 parsing 39
3.1 context-free grammars 41
3.2 predictive parsing 46
3.3 lr parsing 56
3.4 using parser generators 69
3.5 error recovery 76
4 abstract syntax 88
4.1 semantic actions 88
.4.2 abstract parse trees 92
5 semantic analysis 103
5.1 symbol tables 103
5.2 bindings for the tiger compiler 112
5.3 type-checking expressions 115
5.4 type-checking declarations 118
6 activation records 125
6.1 stack frames 127
6.2 frames in the tiger compiler 135
7 translation to intermediate code 150
7.1 intermediate representation trees 151
7.2 translation into trees 154
7.3 declarations 170
8 basic blocks and traces 176
8.1 canonical trees 177
8.2 taming conditional branches 185
9 instruction selection 191
9.1 algorithms for instruction selection 194
9.2 cisc machines 202
9.3 instruction selection for the tiger compiler 205
10 liveness analysis 218
10.1 solution of dataflow equations 220
10.2 liveness in the tiger compiler 229
11 register allocation 235
11.1 coloring by simplification 236
11.2 coalescing 239
11.3 precolored nodes 243
11.4 graph coloring implementation 248
11.5 register allocation for trees 257
12 putting it all together 265
part ii advanced topics
13 garbage collection 273
13.1 mark-and-sweep collection 273
13.2 reference counts 278
13.3 copying collection 280
13.4 generational collection 285
13.5 incremental collection 287
13.6 baker's algorithm 290
13.7 interface to the compiler 291
14 object-oriented languages 299
14.1 classes 299
14.2 single inheritance of data fields 302
14.3 multiple inheritance 304
14.4 testing class membership 306
14.5 private fields and methods 310
14.6 classless languages 310
14.7 optimizing object-oriented programs 311
15 functional programming languages 315
15.1 a simple functional language 316
15.2 closures 318
15.3 immutable variables 319
15.4 inline expansion 326
15.5 closure conversion 332
15.6 efficient tail recursion 335
15.7 lazy evaluation 337
16 polymorphic types 350
16.1 parametric polymorphism 351
16.2 type inference 359
16.3 representation of polymorphic variables 369
16.4 resolution of static overloading 378
17 dataflow analysis 383
17.1 intermediate representation for flow analysis 384
17.2 various dataflow analyses 387
17.3 transformations using dataflow analysis 392
17.4 speeding up dataflow analysis 393
17.5 alias analysis 402
18 loop optimizations 410
18.1 dominators 413
18.2 loop-invariant computations 418
18.3 induction variables 419
18.4 array-bounds checks 425
18.5 loop unrolling 429
19 static single-assignment form 433
19.1 converting to ssa form 436
19.2 efficient computation of the dominator tree 444
19.3 optimization algorithms using ssa 451
19.4 arrays, pointers, and memory 457
19.5 the control-dependence graph 459
19.6 converting back from ssa form 462
19.7 a functional intermediate form 464
20 pipelining and scheduling 474
20.1 loop scheduling without resource bounds 478
20.2 resource-bounded loop pipelining 482
20.3 branch prediction 490
21 the memory hierarchy 498
21.1 cache organization 499
21.2 cache-block alignment 502
21.3 prefetching 504
21.4 loop interchange 510
21.5 blocking 511
21.6 garbage collection and the memory hierarchy 514
appendix: tiger language reference manual 518
a. 1 lexical issues 518
a.2 declarations 518
a.3 variables and expressions 521
a.4 standard library 525
a.5 sample tiger programs 526
bibliography 528
index 537
part i fundamentals of compilation
1 introduction 3
1.1 modules and interfaces 4
1.2 tools and software 5
1.3 data structures for tree languages 7
2 lexical analysis 16
2.1 lexical tokens 17
2.2 regular expressions 18
2.3 finite automata 21
2.4 nondeterministic finite automata 24
2.5 lex: a lexical analyzer generator 30
3 parsing 39
3.1 context-free grammars 41
3.2 predictive parsing 46
3.3 lr parsing 56
3.4 using parser generators 69
3.5 error recovery 76
4 abstract syntax 88
4.1 semantic actions 88
.4.2 abstract parse trees 92
5 semantic analysis 103
5.1 symbol tables 103
5.2 bindings for the tiger compiler 112
5.3 type-checking expressions 115
5.4 type-checking declarations 118
6 activation records 125
6.1 stack frames 127
6.2 frames in the tiger compiler 135
7 translation to intermediate code 150
7.1 intermediate representation trees 151
7.2 translation into trees 154
7.3 declarations 170
8 basic blocks and traces 176
8.1 canonical trees 177
8.2 taming conditional branches 185
9 instruction selection 191
9.1 algorithms for instruction selection 194
9.2 cisc machines 202
9.3 instruction selection for the tiger compiler 205
10 liveness analysis 218
10.1 solution of dataflow equations 220
10.2 liveness in the tiger compiler 229
11 register allocation 235
11.1 coloring by simplification 236
11.2 coalescing 239
11.3 precolored nodes 243
11.4 graph coloring implementation 248
11.5 register allocation for trees 257
12 putting it all together 265
part ii advanced topics
13 garbage collection 273
13.1 mark-and-sweep collection 273
13.2 reference counts 278
13.3 copying collection 280
13.4 generational collection 285
13.5 incremental collection 287
13.6 baker's algorithm 290
13.7 interface to the compiler 291
14 object-oriented languages 299
14.1 classes 299
14.2 single inheritance of data fields 302
14.3 multiple inheritance 304
14.4 testing class membership 306
14.5 private fields and methods 310
14.6 classless languages 310
14.7 optimizing object-oriented programs 311
15 functional programming languages 315
15.1 a simple functional language 316
15.2 closures 318
15.3 immutable variables 319
15.4 inline expansion 326
15.5 closure conversion 332
15.6 efficient tail recursion 335
15.7 lazy evaluation 337
16 polymorphic types 350
16.1 parametric polymorphism 351
16.2 type inference 359
16.3 representation of polymorphic variables 369
16.4 resolution of static overloading 378
17 dataflow analysis 383
17.1 intermediate representation for flow analysis 384
17.2 various dataflow analyses 387
17.3 transformations using dataflow analysis 392
17.4 speeding up dataflow analysis 393
17.5 alias analysis 402
18 loop optimizations 410
18.1 dominators 413
18.2 loop-invariant computations 418
18.3 induction variables 419
18.4 array-bounds checks 425
18.5 loop unrolling 429
19 static single-assignment form 433
19.1 converting to ssa form 436
19.2 efficient computation of the dominator tree 444
19.3 optimization algorithms using ssa 451
19.4 arrays, pointers, and memory 457
19.5 the control-dependence graph 459
19.6 converting back from ssa form 462
19.7 a functional intermediate form 464
20 pipelining and scheduling 474
20.1 loop scheduling without resource bounds 478
20.2 resource-bounded loop pipelining 482
20.3 branch prediction 490
21 the memory hierarchy 498
21.1 cache organization 499
21.2 cache-block alignment 502
21.3 prefetching 504
21.4 loop interchange 510
21.5 blocking 511
21.6 garbage collection and the memory hierarchy 514
appendix: tiger language reference manual 518
a. 1 lexical issues 518
a.2 declarations 518
a.3 variables and expressions 521
a.4 standard library 525
a.5 sample tiger programs 526
bibliography 528
index 537
Modern compiler implementation in C = 现代编译原理 : C语言描述 /
- 名称
- 类型
- 大小
光盘服务联系方式: 020-38250260 客服QQ:4006604884
云图客服:
用户发送的提问,这种方式就需要有位在线客服来回答用户的问题,这种 就属于对话式的,问题是这种提问是否需要用户登录才能提问
Video Player
×
Audio Player
×
pdf Player
×