|
|
1 | (26) |
|
1.1 Historical Perspective |
|
|
2 | (4) |
|
1.2 Models of Computation |
|
|
6 | (4) |
|
1.3 The Origins of a Few Programming Languages |
|
|
10 | (6) |
|
1.4 Language Implementation |
|
|
16 | (7) |
|
|
23 | (1) |
|
|
24 | (1) |
|
1.7 Solutions to Practice Problems |
|
|
25 | (2) |
|
|
27 | (26) |
|
|
27 | (2) |
|
2.2 Backus Naur Form (BNF) |
|
|
29 | (1) |
|
2.3 Context-Free Grammars |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
32 | (2) |
|
2.6 Abstract Syntax Trees |
|
|
34 | (1) |
|
|
34 | (4) |
|
|
38 | (1) |
|
|
38 | (3) |
|
|
41 | (3) |
|
2.11 Ambiguity in Grammars |
|
|
44 | (1) |
|
2.12 Other Forms of Grammars |
|
|
45 | (1) |
|
2.13 Limitations of Syntactic Definitions |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
47 | (1) |
|
2.17 Solutions to Practice Problems |
|
|
48 | (5) |
|
|
53 | (40) |
|
3.1 Overview of the CoCo VM |
|
|
54 | (3) |
|
|
57 | (2) |
|
|
59 | (2) |
|
3.4 If-Then-Else Statements |
|
|
61 | (5) |
|
|
66 | (2) |
|
|
68 | (3) |
|
|
71 | (1) |
|
|
72 | (2) |
|
3.9 Iterating Over a List |
|
|
74 | (1) |
|
3.10 Range Objects and Lazy Evaluation |
|
|
75 | (3) |
|
3.11 Functions and Closures |
|
|
78 | (4) |
|
|
82 | (2) |
|
|
84 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
3.16 Solutions to Practice Problems |
|
|
85 | (8) |
|
|
93 | (80) |
|
4.1 C++ Development Fundamentals |
|
|
95 | (4) |
|
4.2 Overview of the CoCo Virtual Machine |
|
|
99 | (2) |
|
4.3 Building a Large Project |
|
|
101 | (2) |
|
|
103 | (1) |
|
|
104 | (2) |
|
|
106 | (4) |
|
|
110 | (2) |
|
4.8 Parameter Passing and Return Values |
|
|
112 | (3) |
|
|
115 | (2) |
|
|
117 | (1) |
|
|
118 | (2) |
|
|
120 | (1) |
|
4.13 Pre-defined C++ Classes |
|
|
121 | (1) |
|
4.14 The Standard Template Library |
|
|
122 | (2) |
|
4.15 Operator Overloading |
|
|
124 | (1) |
|
|
124 | (3) |
|
|
127 | (1) |
|
4.18 Constructors and Initilization Lists |
|
|
127 | (4) |
|
|
131 | (1) |
|
|
132 | (1) |
|
|
133 | (2) |
|
|
135 | (3) |
|
|
138 | (1) |
|
|
138 | (2) |
|
|
140 | (1) |
|
|
140 | (19) |
|
4.27 Implementing Dictionaries |
|
|
159 | (7) |
|
|
166 | (1) |
|
|
167 | (1) |
|
|
168 | (2) |
|
4.31 Solutions to Practice Problems |
|
|
170 | (3) |
|
|
173 | (54) |
|
5.1 Imperative Versus Functional Programming |
|
|
174 | (2) |
|
|
176 | (2) |
|
5.3 Getting Started with Standard ML |
|
|
178 | (1) |
|
5.4 Expressions, Types, Structures, and Functions |
|
|
179 | (2) |
|
|
181 | (2) |
|
5.6 Characters, Strings, and Lists |
|
|
183 | (3) |
|
|
186 | (1) |
|
|
187 | (1) |
|
5.9 Let Expressions and Scope |
|
|
188 | (2) |
|
|
190 | (3) |
|
5.11 Parameter Passing in Standard ML |
|
|
193 | (1) |
|
5.12 Efficiency of Recursion |
|
|
193 | (2) |
|
|
195 | (2) |
|
|
197 | (1) |
|
|
198 | (1) |
|
5.16 Higher-Order Functions |
|
|
199 | (5) |
|
5.17 Continuation Passing Style |
|
|
204 | (1) |
|
|
205 | (1) |
|
5.19 Programming with Side-Effects |
|
|
206 | (2) |
|
|
208 | (1) |
|
|
208 | (2) |
|
|
210 | (2) |
|
5.23 Building a Prefix Caclculator Interpreter |
|
|
212 | (4) |
|
|
216 | (1) |
|
|
217 | (3) |
|
5.26 Solutions to Practice Problems |
|
|
220 | (7) |
|
|
227 | (40) |
|
|
229 | (4) |
|
6.2 The Small AST Definition |
|
|
233 | (2) |
|
|
235 | (5) |
|
6.4 Compiling and Running the Compiler |
|
|
240 | (4) |
|
|
244 | (2) |
|
|
246 | (2) |
|
|
248 | (3) |
|
6.8 If-Then-Else Expressions |
|
|
251 | (2) |
|
|
253 | (2) |
|
|
255 | (5) |
|
|
260 | (2) |
|
|
262 | (1) |
|
|
263 | (1) |
|
|
263 | (2) |
|
6.15 Solutions to Practice Problems |
|
|
265 | (2) |
|
|
267 | (28) |
|
7.1 Getting Started with Prolog |
|
|
269 | (1) |
|
|
270 | (1) |
|
|
271 | (1) |
|
|
272 | (1) |
|
7.5 The Accumulator Pattern |
|
|
273 | (1) |
|
|
274 | (1) |
|
7.7 Unification and Arithmetic |
|
|
275 | (1) |
|
|
276 | (1) |
|
|
277 | (1) |
|
|
278 | (4) |
|
7.11 Prolog Grammar Rules |
|
|
282 | (1) |
|
|
283 | (1) |
|
|
284 | (3) |
|
|
287 | (1) |
|
|
288 | (1) |
|
|
288 | (2) |
|
7.17 Solutions to Practice Problems |
|
|
290 | (5) |
|
|
295 | (30) |
|
8.1 Why Static Type Inference? |
|
|
296 | (2) |
|
|
298 | (1) |
|
|
298 | (4) |
|
|
302 | (1) |
|
8.5 Integers, Strings, and Boolean Constants |
|
|
303 | (1) |
|
8.6 List and Tuple Constants |
|
|
304 | (1) |
|
|
305 | (1) |
|
|
306 | (3) |
|
|
309 | (2) |
|
|
311 | (3) |
|
|
314 | (1) |
|
|
315 | (1) |
|
8.13 Sequential Execution |
|
|
316 | (1) |
|
8.14 If-Then and While-Do |
|
|
316 | (1) |
|
|
317 | (1) |
|
|
318 | (1) |
|
|
318 | (1) |
|
|
319 | (3) |
|
8.19 Solutions to Practice Problems |
|
|
322 | (3) |
|
9 Appendix A: The CoCo Virtual Machine Specification |
|
|
325 | (10) |
|
10 Appendix B: The Standard ML Basis Library |
|
|
335 | (18) |
References |
|
353 | |