The Waterloo Pascal Compiler
Software Description
The Waterloo Pascal compiler is a debugging-oriented, "load-and-go"
compiler designed for use in multi-user timesharing environments. It
features a complete implementation of ANSI/IEEE 777X3.97-1983 standard
Pascal, as well as several extensions to the language.
Design Goals
Since Waterloo Pascal is primarily a "debugging" compiler, it is
most applicable in environments where undebugged programs are to be
turned into working programs. Such a compiler has a particular set of
design objectives:
- a fast compilation rate;
- a comprehensive set of readily-understandable compile-time
diagnostics in full English text (as opposed to error codes or numbers);
- a run-time environment that ensures that all run-time violations
are detected and meaningfully diagnosed; and
- facilities which enable the user to debug programs quickly and
efficiently.
Waterloo Pascal is equally useful as a teaching tool in classroom
situations, or as a "checkout" compiler in industry.
Features
- The language accepted by Waterloo Pascal is the full ANSI standard
Pascal (which is equivalent to ISO Level 0 Pascal), plus the extensions
noted below.
- An integral part of Waterloo Pascal is an interactive debugger
which may be used to monitor the execution of a program, or to perform a
post-mortem examination of the program state after an execution-time
error.
- The run-time diagnostics detect such errors as: attempts to use
uninitialized variables; incorrect use of subrange values; array
subscripting errors; attempts to use nil pointer values or
previously "disposed" memory; variant record semantics; and control
statement semantics.
- In the event of a run-time error, Waterloo Pascal issues an error
message stating at which line in the source program the error occurred,
the name of any variables involved in the error, plus a
procedure/function activation traceback, with a display of the scalar
and string variables at each level.
- The compiler contains safeguards against "run-away" programs. Each
installation may tailor this support to its own needs.
- The compiler produces two output files: a listing file and a
diagnostics file. The listing file contains a list of the source
program statements, plus the program output (the Pascal standard output
file). If there were any compile-time errors, the error messages are
inserted into the source listing at the appropriate place. The
diagnostics file contains a summary of all diagnostic messages, plus a
log of all interactive debugger output (if applicable).
Extensions to Pascal
- The Waterloo Pascal string extension consists of several new
procedures and functions, combined with modifications to the
type-compatibility rules in Pascal. The extension allows
variable-length string data to be manipulated conveniently.
- The multiple concurrent process extension permits the simulation of
multiprocessing directly in Pascal. The extension employs a
message-passing abstraction (using Start, Send, Receive and Reply)
similar to the one used in several real-time operating systems.
- The standard procedures reset and rewrite are
extended to permit the specification of a system-dependent filename.
- There are numerous minor extensions to the Pascal language,
including: extensions to the character set to accommodate systems on
which the character set may not contain all required characters;
additional general-purpose standard functions and procedures such as arcsin,
arccos, arctan2, tan, RtoS ("Real to String") and StoR
("String to Real"); and the non-interactive debugging procedures TraceOn
and TraceOff.
Documentation
The Waterloo Pascal Primer and Reference (Boswell, Grove and
Mackie; ISBN 0-919884-45-8; WATCOM Publications Ltd., 1984) is the
primary reference for the Waterloo Pascal compiler. In addition to
being a reference manual, this book may also be used as a
self-instruction manual or a course textbook. Each of the chapters in
the Primer introduces a new topic in Pascal, and contains many examples
and exercises.
Copies of this book may be purchased from WATCOM Publications Ltd.
at the address shown below.
Availability
The Waterloo Pascal compiler is available in the following
environments:
- IBM 370 architecture machines, under the VM/SP CMS and MVS
(including TSO) operating systems