Instructor’s Solutions Manual
TU
to
Concepts of Programming Languages
TO
Twelfth Edition
R.W. Sebesta
R
G
U
R
U
jhgfds
, kjhgfds
Preface
Changes for the Twelfth Edition
TU
he goals, overall structure, and approach of this twelfth edition of
T Concepts of Programming Languages remain the same as those of the
eleven earlier editions. The principal goals are to introduce the
fundamental constructs of contemporary programming languages and to
provide the reader with the tools necessary for the critical evaluation of
TO
existing and future programming languages. A secondary goal is to prepare the
reader for the study of compiler design, by providing an in-depth discussion of
programming language structures, presenting a formal method of describing
syntax, and introducing approaches to lexical and syntactic analysis.
The twelfth edition evolved from the eleventh through several different kinds
R
of changes. To maintain the currency of the material, nearly all of the discussion
of some programming languages, specifically Lua and Objective-C, has been
removed. Material on the newer language, Swift, was added to several chapters.
G
In addition, a new section on optional types was added to Chapter 6. Material
was added to Section 8.3.4 to describe iterators in Python. In numerous places in
the manuscript small changes were made to correct and/or clarify the discussion.
U
The Vision
R
This book describes the fundamental concepts of programming languages by
U
discussing the design issues of the various language constructs, examining the
design choices for these constructs in some of the most common languages, and
critically comparing design alternatives.
Any serious study of programming languages requires an examination of
some related topics, among which are formal methods of describing the syntax
and semantics of programming languages, which are covered in Chapter 3. Also,
implementation techniques for various language constructs must be considered:
Lexical and syntax analysis are discussed in Chapter 4, and implementation of
2
, kjhgfds
subprogram linkage is covered in Chapter 10. Implementation of some other
language constructs is discussed in various other parts of the book.
The following paragraphs outline the contents of the twelfth edition.
Chapter Outlines
Chapter 1 begins with a rationale for studying programming languages. It then
discusses the criteria used for evaluating programming languages and language
TU
constructs. The primary influences on language design, common design trade-
offs, and the basic approaches to implementation are also examined.
Chapter 2 outlines the evolution of the languages that are discussed in this
book. Although no attempt is made to describe any language completely, the
origins, purposes, and contributions of each are discussed. This historical
TO
overview is valuable, because it provides the background necessary to
understanding the practical and theoretical basis for contemporary language
design. It also motivates further study of language design and evaluation. Because
none of the remainder of the book depends on Chapter 2, it can be read on its
own, independent of the other chapters.
R
Chapter 3 describes the primary formal method for describing the syntax of
programming language—BNF. This is followed by a description of attribute
G
grammars, which describe both the syntax and static semantics of languages. The
difficult task of semantic description is then explored, including brief
introductions to the three most common methods: operational, denotational, and
U
axiomatic semantics.
Chapter 4 introduces lexical and syntax analysis. This chapter is targeted to
those Computer Science departments that no longer require a compiler design
R
course in their curricula. Similar to Chapter 2, this chapter stands alone and can
be studied independently of the rest of the book, except for Chapter 3, on which it
depends.
U
Chapters 5 through 14 describe in detail the design issues for the primary
constructs of programming languages. In each case, the design choices for several
example languages are presented and evaluated. Specifically, Chapter 5 covers
the many characteristics of variables, Chapter 6 covers data types, and Chapter 7
explains expressions and assignment statements. Chapter 8 describes control
statements, and Chapters 9 and 10 discuss subprograms and their implementation.
Chapter 11 examines data abstraction facilities. Chapter 12 provides an in-depth
3
, kjhgfds
discussion of language features that support object-oriented programming
(inheritance and dynamic method binding), Chapter 13 discusses concurrent
program units, and Chapter 14 is about exception handling, along with a brief
discussion of event handling.
Chapters 15 and 16 describe two of the most important alternative
programming paradigms: functional programming and logic programming.
However, some of the data structures and control constructs of functional
programming languages are discussed in Chapters 6 and 8. Chapter 15 presents an
introduction to Scheme, including descriptions of some of its primitive functions,
TU
special forms, and functional forms, as well as some examples of simple functions
written in Scheme. Brief introductions to ML, Haskell, and F# are given to
illustrate some different directions in functional language design. Chapter 16
introduces logic programming and the logic programming language, Prolog.
TO
To the Instructor
Chapters 1 and 3 are typically covered in detail, and though students find it
interesting and beneficial reading, Chapter 2 receives little lecture time due to the
R
lack of hard technical content. Because no material in subsequent chapters
depends on Chapter 2, it can be skipped entirely. If a course in compiler design is
G
required, Chapter 4 is not covered.
Chapters 5 through 9 should be relatively easy for students with extensive
programming experience in C++, Java, or C#. Chapters 10 through 14 are more
U
challenging and require more detailed lectures.
Chapters 15 and 16 are entirely new to most students at the junior level.
Ideally, language processors for Scheme and Prolog should be available for
R
students required to learn the material in these chapters. Sufficient material is
included to allow students to dabble with some simple programs.
U
Undergraduate courses will probably not be able to cover all of the material
in the last two chapters. Graduate courses, however, should be able to completely
discuss the material in those chapters by skipping over some parts of the early
chapters on imperative languages.
4