Software
Directories for Programming Languages 2/e
Allen
Tucker and Robert Noonan
McGraw-Hill
2007
Please
contact the authors (allen@bowdoin.edu or
noonan@cs.wm.edu) if you have questions
about any of this software.
Chapter Directory/program Notes
2-8 Clite Run
Clite.jar with one of the .cpp files in the
and AbstractSyntax.java programs
directory as a run-time argument.
Appx
A DynamicTyping.java The
output should match with the corresponding
Lexer.java .output
file in the programs directory.
E.g., if you
Parser.java execute
the following command:
Semantics.java
State.java $
java –jar Clite.jar programs/factorial.cpp
StaticTypeCheck.java
Token.java your
output should match the file factorial.output.
TokenType.java
TypeMap.java Note:
complete versions of the
.java sources listed
TypeTransformer.java here
are accessible only to instructors.
Incomplete
versions
are accessible at the student web site; these
will
be helpful to students working on the Clite
Clite.jar implementation
exercises in chapters 2-8.
programs
cast.cpp These
are the Clite programs that the interpreter
cast.output can
compile and run. Each program file
has the
castimplicit.cpp .cpp
suffix and its interpreter output has the .output
castimplicit.output suffix.
...
newton.cpp
newton.output
9-11 Clite
extended Run
Cliteextended.jar with one of the .cpp files in
and AbstractSyntax.java the
programs directory as a run-time argument.
Appx
A.5 Lexer.java The
output should match with the .output file in the
Parser.java programs
directory. E.g., if you execute
the following
Semantics.java command:
State.java
StaticTypeCheck.java $
java –jar Cliteextended.jar programs/functions.cpp
Token.java
TokenType.java your
output should match the file functions.output.
TypeMap.java
Note
to students: the .java sources listed here are
Cliteextended.jar accessible
only by the instructor.
programs These
are the programs that the Cliteextended
cast.cpp interpreter
can run. Some of these are the
same as
cast.output for
Clite, while others contain a ̉mainÓ function and one
castimplicit.cpp or
more additional functions.
castimplicit.output
...
recFib.cpp
recFib.output
12
- Imperative Programming
ada
Fig
12.9 gsort-spec.ada
Fig
12.10 gsort.ada
Fig
12.11 average.ada
Fig
12.12 matrix.ada
c
Fig
12.2 mygrep.c
Fig
12.3 average.c
diff.c Compile
and link diff.c and node.c, and run with
node.c two
arguments, a variable and an abstract
Fig
12.6 node.h expression
to differentiate.
Fig
12.7 node1.c
Fig
12.8 node2.c
nodefctns.h
perl
Fig
12.13 mygrep.pl
Fig
12.14 altgrep.pl
remove.pl
Fig
12.16 mailgrades.pl
Fig
12.17 support.pl
13
- Object-Oriented Programming
Fig
13.1 stack.c
Fig
13.2 stacktype.h
Fig
13.3 stacktype.c
Fig
13.4 gstack-spec.ada
Fig
13.5 gstack.ada
java
Fig
13.7 MyStack.java
Fig
13.21 Expression.java Run
Test.java to exercise this class.
Test.java
Fig
13.22 Backtrack.java
Fig
13.23 Backtracker.java
Fig
13.24 Queen.java
smalltalk
Fig
13.16 polynomial
Fig
13.17 complex
Fig
13.18 account
python
Fig
13.25 Polynomial.py
Fig
13.26 Fraction.py
14
- Functional Programming
scheme
p
373 abs.scm
p
373 factorial.scm
p
373 min.scm
p
374 member.scm
p
375 subst.scm
p
378-381 clite.scm
p
383 diff.scm
p
384-388 queens.scm
haskell
p
389 fact.hs
p
393 primes.hs
p
399-400 phonebook.hs
p
405 diff.hs
p
407 queens.hs
15
- Logic Programming
p
418 speaks.pl
Fig
15.3 family.pl
p
423-424 lists.pl append,
prefix, suffix, and member functions
p
425 factorial.pl
p
427 bubblesort.pl
Fig
15.10 diff.pl
p
432 building.pl
p
434 nlp1.pl
p
435 nlp2.pl
p
437-439 clite.pl
p
441-442 queens.pl
16
- Event-Driven Programming
p
462-467 Skeleton.java
Fig
16.18 SkelApplet.java
p
470-475 CellIcon.java Run
TicTacToe.java as a Java application.
CellEmptyIcon.java
CellOicon.java
CellXIcon.java
Controller.java
Game.java
TicTacToe.java
17
- Concurrent Programming
Fig
17.7 Ball.java Run
BouncingBalls.java as a Java application.
Fig
17.8-17.12 BouncingBalls.java
Fig
17.13-17.16 BoundedBuffer.java
Fig
17.17-17.18 Sieve.java
Fig
17.21-17.24 VotingServer Run
Server.java to start the server on some host.
ClientProtocol.java
ClientThread.java
Server.java
TallyBuffer.java
Fig
17.25 VotingClient Run
Client.java once for every new voter.
A
Client.java run-time
argument provides the host id where
the
server is running.
18
- Program Correctness
Fig
18.8 myFactorial.java Compile
with jmlc and run with jmlrac.
Fig
18.11 myStack.java Compile
myStackTest.java with jmlc and run with
Fig
18.12 myStackTest.java jmlrac.