×
暂无评论
图文详情
  • ISBN:9787302227205
  • 装帧:暂无
  • 册数:暂无
  • 重量:暂无
  • 开本:其它
  • 页数:683
  • 出版时间:2010-06-01
  • 条形码:9787302227205 ; 978-7-302-22720-5

本书特色

《编译器构造(影印版)》:大学计算机教育国外著名教材系列

内容简介

本书是一本面向计算机系本科生的编译器教材。作者在三所美国大学拥有长达25年的编译器教学经验,在本书中对编译器构造的基本知识与关键技术进行了全新的讲解。本书的主要内容包括:编译器历史和概述、词法分析(扫描)、语法分析(包括自顶向下和自底向上的分析)、语法制导翻译、符号表和声明处理、语义分析、中间表示形式、虚拟机上的代码生成、运行时支持、目标代码生成和程序优化等。
  本书提供了详尽清晰的算法,主推在实践中学习编译器构造的相关技术,同时提供了配合教材使用的教学网站、参考资料以及源码下载。不仅可以作为计算机专业本科生或研究生的参考教材,同时也适合相关领域的软件工程师、系统分析师等作为参考资料。

目录

1 introduction 1
 1.1 history of compilation 2
 1.2 what compilers do 4
 1.2.1 machine codegenerated bycompilers 4
 1.2.2 targetcode formats 7
 1.3 interpreters 9
 1.4 syntax and semantics 10
 1.4.1 static semantics 11
 1.4.2 runtime semantics 12
 1.5 organization of acompiler 14
 1.5.1 thescanner 16
 1.5.2 theparser 16
 1.5.3 thetypechecker(semantic analysis) 17
 1.5.4 translator(program synthesis) 17
 1.5.5 symbol tables 18
 1.5.6 theoptimizer 18
 1.5.7 thecode generator 19
 1.5.8 compiler writing tools 19
 1.6 programming language and compiler design 20
 1.7 computer architecture and compiler design 21
 1.8 compiler designconsiderations 22
 1.8.1 debugging(development)compilers 22
 1.8.2 optimizing compilers 23
 1.8.3 retargetable compilers 23
 1.9 integrated developmentenvironments 24
 exercises 26
2 a simple compiler 31
 2.1 aninformalde.nition of the aclanguage 32
 2.2 formalde.nition of ac 33
 2.2.1 syntaxspeci.cation 33
 2.2.2 tokenspeci.cation 36
 2.3 phasesof asimplecompiler 37
 2.4 scanning 38
 2.5 parsing 39
 2.5.1 predicting aparsingprocedure 41
 2.5.2 implementing theproduction 43
 2.6 abstractsyntaxtrees 45
 2.7 semantic analysis 46
 2.7.1 symbol tables 47
 2.7.2 typechecking 48
 2.8 code generation 51
 exercises 54
3 scanning—theory and practice 57
 3.1 overviewof ascanner 58
 3.2 regular expressions 60
 3.3 examples 62
 3.4 finite automata and scanners 64
 3.4.1 deterministic finite automata 65
 3.5 the lexscannergenerator 69
 3.5.1 de.ning tokensin lex 70
 3.5.2 thecharacterclass 71
 3.5.3 usingregular expressions to de.netokens 73
 3.5.4 characterprocessingusinglex 76
 3.6 otherscannergenerators 77
 3.7 practicalconsiderations ofbuildingscanners 79
 3.7.1 processingidenti.ers andliterals 79
 3.7.2 usingcompiler directives and listing sourcelines 83
 3.7.3 terminating thescanner 85
 3.7.4 multicharacter lookahead 86
 3.7.5 performanceconsiderations 87
 3.7.6 lexicalerrorrecovery 89
 3.8 regular expressions and finite automata 92
 3.8.1 transforming aregularexpressioninto annfa 93
 3.8.2 creating thedfa 94
 3.8.3 optimizing finite automata 97
 3.8.4 translating finite automata into regular expressions 100
 3.9 summary 103 exercises 106
4 grammars and parsing 113
 4.1 context-freegrammars 114
 4.1.1 leftmost derivations 116
 4.1.2 rightmost derivations 116
 4.1.3 parsetrees 117
 4.1.4 othertypes ofgrammars 118
 4.2 properties of cfgs 120
 4.2.1 reduced grammars 120
 4.2.2 ambiguity 121
 4.2.3 faultylanguage de.nition 122
 4.3 transformingextended grammars 122
 4.4 parsers and recognizers 123
 4.5 grammaranalysisalgorithms 127
 4.5.1 grammarrepresentation 127
 4.5.2 deriving theempty string 128
 4.5.3 firstsets 130
 4.5.4 followsets 134
 exercises 138
5 top-down parsing 143
 5.1 overview 144
 5.2 ll(k)grammars 145
 5.3 recursive-descentll(1)parsers 149
 5.4 table-driven ll(1)parsers 150
 5.5 obtaining ll(1)grammars 154
 5.5.1 common pre.xes 156
 5.5.2 left recursion 157
 5.6 a non-ll(1)language 159
 5.7 properties ofll(1)parsers 161
 5.8 parsetable representation 163
 5.8.1 compaction 164
 5.8.2 compression 165
 5.9 syntacticerrorrecovery andrepair 168
 5.9.1 errorrecovery 169
 5.9.2 errorrepair 169
 5.9.3 errordetectionin ll(1)parsers 171
 5.9.4 errorrecoveryinll(1)parsers 171
 exercises 173
6 bottom-up parsing 179
 6.1 overview 180
 6.2 shift-reduce parsers 181
 6.2.1 lrparsers and rightmostderivations 182
 6.2.2 lrparsing asknitting 182
 6.2.3 lrparsing engine 184
 6.2.4 thelrparsetable 185
 6.2.5 lr(k)parsing 187
 6.3 lr(0)table construction 191
 6.4 con.ictdiagnos
展开全部

节选

《编译器构造(影印版)》是一本面向计算机系本科生的编译器教材。作者在三所美国大学拥有长达25年的编译器教学经验,在《编译器构造(影印版)》中对编译器构造的基本知识与关键技术进行了全新的讲解。《编译器构造(影印版)》的主要内容包括:编译器历史和概述、词法分析(扫描)、语法分析(包括自顶向下和自底向上的分析)、语法制导翻译、符号表和声明处理、语义分析、中间表示形式、虚拟机上的代码生成、运行时支持、目标代码生成和程序优化等。《编译器构造(影印版)》提供了详尽清晰的算法,主推在实践中学习编译器构造的相关技术,同时提供了配合教材使用的教学网站、参考资料以及源码下载。不仅可以作为计算机专业本科生或研究生的参考教材,同时也适合相关领域的软件工程师、系统分析师等作为参考资料。

相关资料

插图:An optimizing compiler is specially designed to produce efficient target codeat the cost of increased compiler complexity and possibly increased compila-tion times. In practice, all production-quality compilers (those whose outputwill be used in everyday work) make some effort to generate reasonable targetcode. For example, no add instruction would normally be generated for theexpression i+O.The term optimizing compiler is actually a misnomer. This is because nocompiler of any sophistication can produce optimal code for all programs. Thereason for this is twofold. First, theoretical computer science has shown thateven so simple a question as whether two programs are equivalent is undecid-able: such questions cannot generally be answered by arty computer program.Thus finding the simplest (and most efficient) translation of a program cannotalways be done. Second, many program optimizations require time propor-tional to an exponential function of the size of the program being compiled.Thus, optimal code, even when theoretically possible, is often infeasible inpractice.

作者简介

作者:(美国)费希尔(Charles N.Fischer) (美国)赛特郎(Ronald K.Cytron) (美国)勒布兰(Richard J.LeBlanc.Jr.)

预估到手价 ×

预估到手价是按参与促销活动、以最优惠的购买方案计算出的价格(不含优惠券部分),仅供参考,未必等同于实际到手价。

确定
快速
导航