读书人

编程语言:原理与范型(第2版)

发布时间: 2010-03-10 03:19:41 作者:

 编程语言:原理与范型(第2版)


基本信息出版社:清华大学出版社
页码:590 页
出版日期:2009年05月
ISBN:7302198063/9787302198062
条形码:9787302198062
版本:第2版
装帧:平装
开本:16
正文语种:中文
丛书名:大学计算机教育国外著名教材系列

内容简介 《编程语言:原理与范型(第2版)》以C、Java、Perl和Python编程语言为范型,介绍了编程语言的原理与设计。全书共有18章,第2~11章介绍了关于语言设计原理的内容,主要讲述编程语言的核心原理:语法、名称、类型、语义和函数等。第12~15章介绍了命令式编程、面向对象编程、函数式编程和逻辑式编程等。第16~18章详细介绍了事件处理、并发性和程序正确性。为了提高读者的上机学习能力,《编程语言:原理与范型(第2版)》为这些原理提供了丰富的应用范例。
《编程语言:原理与范型(第2版)》配套网站www.mhhe.com/tucker提供了丰富的教辅支持和参考素材。
编辑推荐 《编程语言:原理与范型(第2版)》是由清华大学出版社出版的。
目录
1 Overview
1.1 Principles
1.2 Paradigms
1.3 SpecialTopics
1.4 ABriefHistory
1.5 OnLanguageDesign
1.5.1 DesignConstraints
1.5.2 OutomesandGDals
1.6 CompilersandVirtualMachines
1.7 Summary
Exercises

2 Syntax
2.1 Grammars
2.1.1 Backus.NaurForm(BNF)Grammars
2.1.2 Derivations
2.1.3 ParseTrees
2.1.4 AssociativityandPrecedence
2.1.5 AmbigUOUSGrammars
2.2 ExtendedBNF
2.3 SyntaxofaSmallLanguage:Clite
2.3.1 LexicalSyntax
2.3.2 ConcreteSyntax
2.4 CompilersandInterpreters
2.5 LinkingSyntaxandSemantics
2.5.1 AbstractSyntax
2.5.2 AbstractSyntaxTretes
2.5.3 AbstractSyntaxofClite
2.6 Summary
Exercises

3 LexicalandSyntacticAnalysis
3.1 ChomskyHierarchy
3.2 LexicalAnalysis
3.2.1 RegularExpressions
3.2.2 FiniteStateAutomata
3.2.3 FromDesigntoCode
3.3 SyntacticAnalysis
3.3.1 PreliminaryDefinitions
3.3.2 RecursiveDescentParsin
3.4 Summary
Exercises

4 Names
4.1 SyntacticIssues
4.2 Variables
4.3 Scope
4.4 SymbolTable
4.5 ResolvingReferences
4.6 DynamicScoping
4.7 Visibility
4.8 Overloading
4.9 Lifetime
4.1 0Summary
Exercises

5 Types
5.1 TypeErrors
5.2 StaticandDynamicTDyping
5.3 BasicTypes
5.4 NonbasicTypes
5.4.1 Eumerations
5.4.2 Pointers
5.4.3 ArraysandLists
5.4.4 Strings
5.4.5 Structures
5.4.6 VariantRecordsandUnions
5.5 RecursiveDataTypes
5.6 FunctionsasTypes
5.7 TypeEquivalence
5.8 Subtypes
5.9 PolymorphismandGenerics
5.1 0Programmer.DefinedTypes
5.1 1Summary
Exercises

6 TypeSystems
6.1 TypeSystemforClite
6.2 ImplicitTypeConversion
6.3 FormalizingtheCliteTYpeSystem
6.4 Summary
Exercises

7 Semantics
7.1 Motivation
7.2 ExpressionSemantics
7.2.1 Notation
7.2.2 AssociativityandPrecedence
7.2.3 shoftCircuitEvaluation
7.2.4 TheMeaningofanExpression
7.3 ProgramState
7.4 AssignmentSemantics
7.4.1 MultipleAssignment
7.4.2 AssigrnmentStatementsVS.AssignmentExpressions
7.4.3 CopyVS.ReferenceSemantics
7.5 ControlFlowSemantics
7.5.1 Sequence
7.5.2 Conditionals
7.5.3 Loops
7.5.4 GoToControversy
7.6 Input/OutputSemantics
7.6.1 BasicConcepts
7.6.2 RandomAccessFiles
7.6.3 gOErrorHandlingSemantics
7.7 ExceptionHandingSemantics
7.7.1 StrategiesandDesignIssues
7.7.2 ExceptionHandlinginAda,C++,andJava
7.7.3 ExcepKonsandAssertions
7.8 Summary
Exercises

8 SemanticInterpretation
8.1 StateTransformationsandPartialFuncfions
8.2 SemanticsofClite
8.2.1 MeaningofaProgram
8.2.2 StatementSemantics
8.2.3 ExpressionSemantics
8.2.4 ExpressionswithSideEffects
8.3 SemanticswithDynamScTyping
8.4 AFormalTreatmentofSemantics
8.4.1 StateandStateTransformation
8.4.2 DenotationafSemanticsofaProgram
8.4.3 DenotationalSemanticsofStatements
8.4.4 DenotationalSemanticsofExpressions
8.4.5 LimitsofFormalSemanticModels
8.5 Summary
Exercises

9 Functions
9.1 BasicTerminology
9.2 FunctionCallandReturn
9.3 Parameters
9.4 ParameterPassingMechanisms
9.4.1 Passbyvalue
9.4.2 PassbyReference
9.4.3 PassbyValue.ResultandResult
9.4.4 PassbyName
9.4.5 ParameterPassinginAda
9.5 ActivationRecords
9.6 RecursiveFunctions
9.7 Run-TimeStack
9.8 Summary
Exercises

10 FunctionImplementation
10.1 FunctionDeclarationandCallinClite
10.1.1 ConcreteSyntax
10.1.2 AbstractSyntax
10.2 CompletingtheCliteTypeSystem
10.3 SemanticsofFunctionCallandReturn
10.3.1 Non.VoidFunctions
10.3.2 SideEffectsRevisited
10.4 FormalTreatmentofTypesandSemantics
10.4.1 TypeMapsforClite
10.4.2 FormalizingtheTypeRulesforClite
10.4.3 FormalizingtheSemanticsofClite
10.5 Summary
Exercises

11 MemoryManagement
11.1 TheHeap
11.2 ImplementationofDynamicArrays
11.2.1 HeapManagementProblems:Garbage
11.3 GarbageCollection
11.3.1 ReferenceCounting
11.3.2 Mark-Sweep
11.3.3 CopyCollection
11.3.4 ComparisonofStrategies
11.4 Summary
Exercises

12 ImperativeProgramming
12.1 WhatMakesaLanguageImperative?
12.2 ProceduralAbstraction
12.3 ExpressionsandAssignment
12.4 LibrarySupportforDataStructures
12.5 ImperativeProgrammingandC
12.5.1 GeneralCharacteristics
12.5.2 Example:Grep
12.5.3 Example:Average
12.5.4 Example:SymbolicDifferentiation
12.6 ImperativeProgrammingandADA
12.6.1 GeneralCharacteristics
12.6.2 Example:Average
12.6.3 Example:MatrixMultiplication
12.7 ImperativeProgrammingandPerl
12.7.1 GeneralCharacteristics
12.7.2 Example:Grep
12.7.3 Example:MailingGrades
12.8 Summary
Exercises

13 Obiect.OrientedProgramming
13.1 Prelude:AbstractDataTypes
13.2 TheObjectModel
13.2.1 Classes
13.2.2 VisibilityandInformationHiding
13.2.3 Inheritance
13.2.4 MultipleInheritance
13.2.5 Polymorphism
13.2.6 Templates
13.2.7 AbstractClasses
13.2.8 Interfaces
13.2.9 VirtualMethodTable
13.2.1 0Run-TimeTypeIdentification
13.2.1 1Reflection
13.3 Smalltalk
13.3.1 GeneralCharacte-ristics
13.3.2 Example:Polynomials
13.3.3 Example:ComplexNumbers
13.3.4 Example:BankAccount
13.4 Java
13.4.1 Example:SymbolicDifferentiation
13.4.2 Example:Backtracking
13.5 Pvthon
13.5.1 GeneralCharacteristics
13.5.2 Example:Polynomials
13.5.3 Example:Fractions
13.6 Summary
Exercises

14 FunctionalProgramming
14.1 FunctionsandtheLambdaCalculus
14.2 Scheme
14.2.1 Expressions
14.2.2 ExpressionEvaluation
14.2.3 Lists
14.2.4 ElementaryValues
14.2.5 ControlFlow
14.2.6 DefiningFunctions
14.2.7 LetExpressions
14.2.8 Example:SemanticsofClite
14.2.9 Example:SymbolicDifferentiafion
14.2.1 0Example:EightQueens
14.3 Haskell
14.3.1 Introduction
14.3.2 Expressions
14.3.3 ListsandListComprehensions
14.3.4 ElementaryTypesandValues
14.3.5 ControlFlow
14.3.6 Definingfunctions
14.3.7 Tuples
14.3.8 Example:SemanticsofClite
14.3.9 Example:SymbolicDifferentiation
14.3.1 0Example:EightQueens
14.4 Summary
Exercises

15 LogicProgramming
15.1 LogicandHornClauses
15.1.1 ResolutionandUnification
15.2 LogicProgramminginProlog
15.2.1 PrologProgramElements
15.2.2 PracticalAspectsofProlog
15.3 PrologExamples
15.3.1 SymbolicDifferentiation
15.3.2 SolvingWordPuzzles
15.3.3 NaturalLanguageProcessing
15.3.4 SemanticsofClite
15.3.5 EightQueensProblem
15.4 Summary
Exercises

16 Event.DrivenProgramming
16.1 Event-DrivenControl
16.1.1 ModeZ-View-Controller
16.1.2 EventsinJava
16.1.3 JavaGUIApplications
16.2 EventHandling
16.2.1 MouseClicks
16.2.2 MouseMotion
16.2.3 Buttons
16.2.4 Labels,TextAreas,andTextFields
16.2.5 ComboBoxes
16.3 ThreeExamples
16.3.1 ASimpleGUIInterface
16.3.2 DesigningaJavaApplet
16.3.3 Event.DrivenInteractiveGames
16.4 OtherEvent.DrivenApplications
16.4.1 ATMMachine
16.4.2 HomeSecuritySystem
16.5 Summary
Exercises

17 ConcurrentProgramming
17.1 ConcurrencyConcepts
17.1.1 HistoryandDefinitions
17.1.2 ThreadControlandCommunication
17.1.3 RacesandDeadlocks
17.2 SynchronizationStrategies
17.2.1 Semaphores
17.2.2 Monitors
……
18 ProgramCorrectness
A DefinitionofClite
B DiscreteMathReview
……
序言 自本书第1版于1999年出版以来,编程语言的研究已得到迅猛发展。例如,从CSl开始,Java已经成为计算机科学课程的一门重要语言。敏捷编程与软件设计如影随形,且其语言习惯有别于传统的程序。用正规的方法进行软件设计已渐入主流,且作用显著。
有鉴于此,新版希望能够适应在当前和未来编程语言设计过程中所伴随的激励和新挑战。例如,新版对全部4种程序设计范例及其所用的语言在广度和深度上都有进一步的提高,如表O一1所示。
新版第二个主要的变化是大大丰富了第2-11章关于语言设计原理的内容。我们使用不太正式的描述风格,增加了新的来自流行编程语言(如Python和Perl)的例子。此外,对于已经不再广泛应用的语言(如Pascal和Modula),新版多已略去。
第2、4、5、7、9章主要讲述编程语言的核心原理——语法、名称、类型、语义和函数。这几章与第1版相比较,为上机学习这些原理提供了更广泛、更深入的语言和范例。
如果您希望了解语法、类型系统、语义、函数和存储管理的具体实现原理,可以在第3、6、8、10和11章中找到这些材料。读者可以有选择地学习这几章,以丰富相关的核心原理。例如,通过学习第3章中编译器的词汇和语法段,可加深和巩固对第2童的学习。注意.可以跳过部分或全部的章节。
文摘 插图:


Definition:A context-free grammar has a set of productions P,a set of terminal symbols T and a set of nonterminal symbols N,one of which,S,is distinguished as the start symbo1.
Definition:AgrammarproductionhastheformA一∞whereAisanonterminal symbol and cois a stringofnonterminalandterminal symbols.
One form of context-free grammar,called Backus-Naur Form(BNF for short)hasbeen widely used to define the syntax of programming languages.
2.1.1 Backus-Naur Form(BNF)Grammars
In 1960,BNF was adapted from Chomsky,s theory by John Backus and Peter Naur to express a formal syntactic definition for the programming language Algol[Naur(ed.), 1963].Like many texts, we use the term BNF grammar as a synonym for context free grammar.For a more complete discussion of the differences between the two,see Observation(P.26).
Aproductionis aruleforrewritingthatcanbeappliedtoa stringofsymbolscalleda sententialform.Aproduction is interpreted as follows:the nonterminalA can be replaced by in a sententialform.The symbol A is often called the left-handside,whilethe string is called the right.hand side of the production.In BNF grammars,the sets of terminaland nonterminal symbols are disjoint. When a BNF grammar is used for defining programming language syntax,the nonterminals N identify the language’s grammatical categories like Identifier,Inte。ger,Expression,Statement,and Program.The start symbol S identifies the principal grammatical category being defined by the grammar(typically Program),and is usually defined in the first production.The terminal symbols T form the basic alphabet from which programs are constructed.
To illustrate these ideas,here is a pair of productions that defines the syntax of the grammatical category binaryDigit:
binaryDigit-0
binaryDigit-1
This pair defines a binaryDigit as either 0 or 1,but nothing else.The nonterminal sym-bols are all the symb
……
读书人网 >程序设计

热点推荐