CS430 Fall 2004
Chapter Outline of Concepts of Programming
Languages by Robert Sebesta
·
o
Concepts of
programming languages (reasons for studying) 2-4
o
Programming
domains (5-8)
o
Language
evaluation criteria (8-20)
o
architecture
effects language design – von Neumann architecture in which programs and data
are stored in same memory - CPU which
executes the memory is separate and instructions and data need to be moved from
memory and results back to memory
o
Language categories
(paradigms) (23-32) – example languages for each
o
definitions
and differences between interpretation and compilation
o
Von Neumann bottleneck –
instructions can be executed faster than they can be moved to the CPU for
execution.
·
o
FORTRAN
§
arithmetic
if
§
do loop
§
format
statements
§
computed
goto
§
error
handling
§
goal of
language design
§
Be able to read , determine output (trace),
write FORTRAN code
o
Functional
programming (49-55)
§
intended
for symbolic computation
§
useful
in AI
§
LISP
atoms and lists
§
LISP
read eval print loop
§
Be able to read , determine output (trace),
write LISP code
o
Design
goals of BASIC
o
Pascal (79-81)
§
design
goal
§
parameter
passing modes
§
block
structure inherited from Algol
§
Be able to read , determine output (trace),
write Pascal code
o
Prolog (85-86)
§
design
goal
§
facts
and rules
§
Be able to read , determine output (trace),
write Prolog code
o
§
design
goals
§
Be able to read , determine output (trace),
write
o
Java (99-105)
·
o
Describing syntax
(114-116)
§
strings
of a language are sentences or statements
§
syntax
rules specify which strings are legal
o
BNF (117-130)
§
whole
programming languages can be described by context-free grammars
§
natural
notation for describing syntax
§
metalanguage
is a language that is used to describe another language
§
BNF is
a metalanguage for programming languages
§
be able
to generate valid strings, given a grammar
§
be able
to draw a parse tree showing the generation of valid strings, given a grammar
§
be able
to determine whether a string is valid, given a grammar
§
know
what makes a grammar ambiguous and be able to determine if a grammar is
ambiguous
§
given a
grammar, be able to describe accurately and completely in simple English what
the sentences of the grammar consist of
§
know
what EBNF added to BNF
o
Dr. Adams’ note:
Know 4 elements of a grammar
§
(1. terminals, 2.
nonterminals, 3. productions, 4. goals)
·
·
o
Name (190-194)
§
difference
between keywords and reserved words
§
know
which languages we have looked at have reserved words and which do not
§
know
what pre-defined terms are
o
Address (194)
o
Alias (194-195)
o
Type (195)
o
Value (195)
o
Binding (195-199,
202-205)
§
four
types of bindings
·
name,
value, type, location
§
when does
each type of binding occur?
·
run time,
load time, compile time, language design time, etc.
§
implicit
versus explicit
§
static
versus dynamic
§
lifetime
of a variable – allocation / deallocation
·
stack-dynamic
·
explicit
heap-dynamic
·
implicit
heap-dynamic
o
Type checking (205-211)
§
type
compatibility
§
strong
typing
o
Scope (211-222)
§
static
§
dynamic
§
block
scope
§
referencing
environment
§
o
Initialization
(223-224)
·
o
Primitive data
types (234-238)
o
String types
(239-243)
o
Ordinal types
(243-247)
o
User-defined
types
o
Arrays (247-264)
§
address
computation for single-dimensional arrays
§
address
computation for two-dimensional arrays stored in row-major order
§
address
computation for two-dimensional arrays stored in column-major order
o
Records (264-268)
§
difference
between arrays and records
§
how
record fields are referred to
o
Pointers
(271-284)
§
anonymous
variables
§
dynamic
variables
§
dereferencing
§
problems
·
dangling
pointers
·
garbage
·
o
Arithmetic
expressions (292-301)
§
what do
you need to know to evaluate arithmetic expressions
o
Overloaded
operators (301-303)
o
Type conversion
(303-306)
§
implicit
§
explicit
§
what
languages allow/prohibit them
o
Relational &
Boolean expressions (306-310)
§
use of
boolean variables in conditional expressions
§
short
circuit evaluation
o
Assignment
statements (310-314)
·
o
Selection
statements (320-329)
§
definition
§
forms
§
required
elements
o
Iterative
statements (329-337, 340-342)
§
definition
§
different
types
·
pre-test/post-test
·
counter
controlled / logic controlled
§
forms
§
getting
out
o
Unconditional
branching (342-343)
·
o
Subprograms
(354-359)
o
Procedures &
functions (359-360)
o
Design issues
(360-361)
o
Parameter passing
(361-383)
§
pass by
value
§
pass by
reference
§
pass by
results
§
pass by
value-result
§
pass by
name
§
type
checking of parameters
§
which
languages use which method
o
Overloaded
subprograms (383-384)
o
Generic
subprograms (384-389)
§
definition
o
Design issues
(389-390)
·
o
except for activation records
§
static
links
§
dynamic
links
§
return
address
§
stack
·
o
definition of an abstract data type
o
Data abstraction
(428-432)
o
Design issues
(432-433)
o
Language examples
(433, 436-445)
§
·
specifications
– public interface
·
bodies
– provide implementation – may be public or private
o
Dr. Adams’ note: encapsulation
§
the
implementation can be hidden for simplification purposes
·
·
·
o
Basic concepts of
exception handling (542-545)
o
Exception
handling design issues (545-548)
o
Exception
handling in
o
Dr. Adams’ note:
Java exception handling
§
know generally
that the try-catch-finally blocks handle exceptions in Java, and where control
goes after the exception is handled
·
o
Mathematical
functions (580-583)
o
LISP (584-587)
·
Be able to read , determine output (trace),
write LISP code
o
Dr. Adams’ note:
functional language applications
§
Know that best
use is for AI applications; models the real world differently than other
language paradigms (recursion and math are more natural in functional
languages)
·
·
Be able to read , determine output (trace),
write Prolog code
o
Logic programming
(624-625)
o
Prolog history
(625-626)
o
Prolog basics
(626-640)
o
Prolog
deficiencies (640-646)
o
Prolog
applications (646-648)