P.D. Terry ( p.terry@ru.ac.za )
Published by International Thomson Computer Press © 1997
The descriptions below reflect the development of the systems using command line compilers and utilities. Note the frequent use of the word "directory" where modern users tend to use "folder"!
The software that accompanies this distribution was originally developed in Modula-2. It was subsequently converted to Turbo Pascal, and to C++. Although C++ code is used for most of the illustrations in the text, highly self-consistent source code in all three languages is to be found in the distribution as well.The C++ source code was mainly developed under MS-DOS using Borland C++ 3.1. It has also been successfully compiled under Linux, using G++, the GNU C compiler. Although many of the case studies have also been tested with Turbo C++ 3.1, there appears to be a bug in that compiler that prevents the template set class from compiling correctly. With suitable modifications to the "make" scripts the code should be acceptable to Borland C++ 5 and to other 32 or 64 bit compilers.
The Turbo Pascal source code was developed to run on any version of Turbo Pascal from 5.5 onwards (although Delphi users should read the notes on Delphi below). However, it makes little use of OOP extensions.
The Modula-2 source code should be immediately usable on MS-DOS based systems using the shareware compiler marketed by Fitted Software Tools (FST), the Stony Brook Modula-2 compiler marketed by Gogesch Micro Systems, Inc., or the TopSpeed Modula-2 compilers developed by Jensen and Partners International (JPI) and now marketed by Clarion Software. It will also compile unchanged under Gardens Point Modula-2 on a wide range of systems.
The essential software on the diskette is supplied in the form of eight compressed (zipped) files and a version of UNZIP.EXE.
CSOURCES.ZIP - sources written in C++ PSOURCES.ZIP - sources written in Turbo Pascal MSOURCES.ZIP - sources written in Modula-2 COMMON.ZIP - language independent files FILEIO.ZIP - support library for Modula-2 sources COCORC.ZIP - Coco/R for C/C++ COCORP.ZIP - Coco/R for Turbo Pascal COCORM.ZIP - Coco/R for Modula-2 UNZIP.EXE - Program to decompress ZIP files
Download these files and store them in a convenient directory (folder), say F:\DOWNLOADS.
To unpack the software, simply follow the steps below. Example MS-DOS commands are shown (these may need alteration, depending on the configuration of your computer). Windows users may follow an equivalent sequence of operations from within the File Manager.
Proceed to unpack (a) the language specific case studies (b) the language independent files (c) the language specific compiler generator and, if you are a Modula-2 user, (d) the FileIO library.
MKDIR C:\SRCES(C:\SRCES is used as an example only - please yourself in this regard.
CD C:\SRCES
F:\DOWNLOADS\UNZIP F:\DOWNLOADS\CSOURCES.ZIP
F:\DOWNLOADS\UNZIP F:\DOWNLOADS\COMMON.ZIPThese steps will create a small directory hierarchy under the C:\SRCES directory, in which various subdirectories will appear, usually one for each chapter. For example, you will find the source code for the programs in chapter 10 in the directory C:\SRCES\CHAP10\CPP (for the C++ versions) or the directory C:\SRCES\CHAP10\MODULA (for the Modula-2 versions).
IMPORTANT
MKDIR C:\COCO
CD C:\COCO
F:\DOWNLOADS\UNZIP F:\DOWNLOADS\COCORC.ZIPThis will create a small directory hierarchy under the C:\COCO directory, containing the various components of the Coco/R system for C++.
IMPORTANT
C: CD C:\SRCES\CHAP15\CPP- Issue the command
SETUPwith no parameters. This will indicate what parameters might be added to the command to provide a variant appropriate for the case studies of that chapter. - For example, follow this by obeying a SETUP command like
SETUP C:\WORK 5where C:\WORK is a directory that will be created if necessary, and into which the appropriate components for SETUP option 5 will be copied.
CD C:\WORK
IMPORTANT
In the distribution you will find a self-extracting file FILEIO.ZIP that contains the sources of FileIO for a variety of MS-DOS compilers.
MKDIR C:\FILEIO
CD C:\FILEIO
F:\DOWNLOADS\UNZIP F:\DOWNLOADS\FILEIO.ZIPThis will create a small directory hierarchy under the C:\FILEIO directory, in which various subdirectories will appear, one for each compiler.
In the C:\FILEIO directory you will find a definition module FILEIO.DEF, and in the subdirectories of C:\FILEIO you will find various compiler specific modules, including FILEIO.MOD. You will need to proceed as follows, on the assumption that you have a "working" directory C:\WORK in which you normally develop programs. (You may, of course, find it preferable to install FileIO in the library directory or directories for your Modula-2 compiler.)
CD C:\WORK COPY C:\FILEIO\FILEIO.DEF COPY C:\FILEIO\xxxwhere xxx =
JPI (TopSpeed compilers) FST (Fitted Systems Tools compilers) LOG (Logitech compilers) STO (StonyBrook compilers) GPMPC (Gardens Point PC compiler)
Pat Terry
Computer Science Department
Rhodes University
MAKHANDA / GRAHAMSTOWN 6140
South Africae-mail: p.terry@ru.ac.za