[pe.cust.sources] Little Smalltalk Source, *New* Part 3 of 20

earlw@pesnta.UUCP (Earl Wallace) (06/13/85)

#! /bin/sh 
#
# This is an another posting of the Little Smalltalk source, the last posting
# of this source went out in 5 parts and they were too big (>200k) for most
# sites so I redid the whole mess to keep the files around the 50k range.
#
# The complete set is now 20 parts.
#
# P.S. - If you don't receive all 20 parts within 5 days, drop me a line.
#	 Also, I have the Rand sources of May 1984, if someone has a more
#	 updated copy, I'll be happy to post them (or YOU can post them :-))
# 
# -earlw@pesnta
#
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	docs/books
#	docs/install
#	docs/macros
#	docs/man
#	docs/syntax
# This archive created: Thu Jun 13 11:31:37 1985
# By:	Earl Wallace (Perkin-Elmer Data Systems Group / Customer Service)
export PATH; PATH=/bin:$PATH
if test -f 'docs/books'
then
	echo shar: will not over-write existing file "'docs/books'"
else
cat << \SHAR_EOF > 'docs/books'
%T Smalltalk-80, The Language and It's Implementation
%A Adele Goldberg
%A David Robson
%I Addison-Wesley
%D 1983
%K blue

%T Smalltalk-80 The Interactive Programming Environment
%A Adele Goldberg
%I Addison-Wesley
%D 1984
%K orange

%T Smalltalk-80 Bits of History, Words of Advice
%A Glenn Krasner
%I Addison-Wesley
%D 1983
%K green
SHAR_EOF
if test 335 -ne "`wc -c < 'docs/books'`"
then
	echo shar: error transmitting "'docs/books'" '(should have been 335 characters)'
fi
fi # end of overwriting check
if test -f 'docs/install'
then
	echo shar: will not over-write existing file "'docs/install'"
else
cat << \SHAR_EOF > 'docs/install'
.ce
\fBLittle Smalltalk Installation Notes\fP
.sp
.NH
Installation Notes
.PP
There are four basic steps involved in installing the Little Smalltalk
system.  The four steps are; unbundling the sources, editing the sources to
tailor them to the target installation, compiling the sources, and moving
the final binary to the local executables directory.  Each of these four 
steps are described in following paragraphs and in succeeding sections.
.ds RF \(DY
.PP
As distributed, the Little Smalltalk source consists of a small number of
files in ``bundle'' format.  A shell script, \fBunbundle\fP, is provided
that creates the various subdirectories used by the system and unbundles
the distribution files into their component parts.  To execute this shell
script, type, in a directory containing all the files in the distribution,
the following command:
.DS I
sh unbundle
.DE
.LP
A large amount of output should follow, indicating files have been
unbundled into subdirectories /sources, /parser, /prelude, /tests, /docs 
and /bin.
.PP
There are a small number of editing changes required to tailor the system to 
various different environments.  Section 2 describes these changes in detail for
various types of machines and operating systems.
.PP
Once the necessary tailoring has been performed, the system can then be
compiled by typing the command:
.DS I
make install
.DE 
.LP
in the base directory (the original directory from which the source was
unbundled).  This command will then invoke further make commands which
produce the parser, the executable system, and the standard prelude.
In addition various self checks for correctness are provided.  Should it be
necessary, various subcomponents of the system can be individually produced
by typing the ``make install'' commands in the appropriate subdirectory.
These commands produce a considerable amount of output.
.PP
Once the system has been compiled and successfully passed all self tests,
the executable file in /bin/st should be linked or moved to the appropriate
location for local executables on the target system.
Finally, the object files for all compilations can be removed by typing
``make clean''.
.NH 1
Specific Machine Installation Instructions
.PP
A single source form and command syntax cannot be used for all combinations of
machine / operating systems, because of differences in library routine syntax
or function availability.  An attempt has been made to surround the occurrences
of such features with conditional compilation directives, so that by defining
or not defining a symbol the correct result can be produced on different
systems.  These commands have all been collected in the include file
parser/env.h, so for the most part this should be the principle file needing
to be edited.  In addition, ``meta-defines'' are provided for many systems to
which the Little Smalltalk system has already been ported.  By defining one
of these ``meta-defines'', correct values are given for the remainder of the
symbols.
.PP
Similarly, the ``standard'' set of flags necessary to use the compiler and/or
loader differ from system to system.  These are given by the two defined
strings, CFLAGS and LFLAGS, in sources/Makefile and parser/Makefile.
.PP
As distributed, the Little Smalltalk system expects the various
subdirectories to remain in the relationship in which they are unbundled.
If desired, however, they can be moved (say to place the sources in one
place, the libraries in another, and the binary in a third).  Each makefile
may contain one of either the strings BINDIR or PARSEDIR at the beginning.
If the binary or parser sources directory is moved, relative the the
directory containing the makefile,
these strings should be changed.  Otherwise, if the
relative positions of the directories remain as they were unbundled, the
default values for these strings can be used.
.PP
There are a few places where path specifications must be given in either
the Makefiles or in C sources.  These are described in the following sections.
.PP
Finally, bytecodes are kept in the form of ``unsigned characters''; that is,
characters containing numbers from 0-255.  These may or may not be
supported on various machines.  The file parser/env.h contains a typedef
for the type `uchar' and two macros for converting from unsigned characters
to integers and back again.  These should be defined in such a manner that
the appearance of unsigned characters is achieved, whether or not they are
actually supported.  A simple test program, called uchar.c, is provided in
/parser.  This program can be used to test the correctness of the macros
defined in env.h.
Generally, either the model of the VAX-780 or the PDP11/70 should be sufficient.
.NH 2
Bringing Little Smalltalk Up on a New System
.PP
If the system you are attempting to port to is not one of the systems described
in the following sections, a certain amount of experimentation will probably be
necessary to successfully install the system.  This section will describe some
of the major changes required; what other changes may be necessary is 
generally unpredictable.
.PP
The strings CFLAGS and LFLAGS in sources/Makefile and parser/Makefile should
be set to the appropriate values for ``normal'' compiles and loads of
C programs.
.PP
The file prelude/Makefile contains a hard path in the string PREPATH.
This should be set to the path to the prelude directory.
.PP
The file parser/env.h contains various hard paths, which are described in
that file.  Also in that file, the following symbols should be defined or
left undefined, depending upon the availability of various features.
.IP ENVSAVE 1i
This symbol should be defined if it is necessary to save the value of the
global varible \fIenviron\fP during a fastload.
This is necessary on the 11/70, IBM PC, possibly other machines.
.IP FACTMAX 1i
This symbol should be defined to be the largest integer for which the factorial
can be computed by repeated multiplication without overflow.
This value is generally 12 for 32 bit machines and 8 for 16 bit machines.
.IP FASTDEFAULT 1i
This symbol should be defined if the default behavior of the system should
be to perform a fast load on the standard prelude (see section 3).
.IP FLUSHREQ 1i
If defined a fflush() is given after every call to printf.
.IP GAMMA 1i
This symbol should be defined if the gamma() function is part of the standard
math library, left undefined otherwise.
.IP INLINE 1i
This symbol should be defined if in-line code is desired for object increments
and decrements.  In line code is generally slightly faster, although the code
size is slightly larger.  If this symbol is not defined subroutine calls
will be generated for object increments and decrements.
.IP NOSYSTEM 1i
This symbol should be defined on non-unix systems for which the
``system()'' call is not supported.  As this seriously limits functionality
(i.e. class descriptions cannot be modified during execution) is should not
be used unless necessary.
.IP OPEN3ARG 1i
This symbol should be defined if Berkeley 4.2 style open 
statements (3 arguments)
are used.  If the older, 2 argument, format is used this symbol should be left
undefined.
.IP SETJUMP
This symbol should be defined if the setjump/longjump facility is
available.  This is used ONLY in the file sources/process.c to implement
recovery when the user has typed an interrupt character.
.IP SHORTDATA 1i
If this symbol is defined various heuristics are used to reduce the data 
segment size, at the expense of functionality or execution speed.  Should
only be defined if absolutely necessary.
.IP SIGS
This symbol should be defined if the signals facility is available.  This
is used ONLY in the file sources/process.c to implement recovery when the
user has typed an interrupt character.
.PP
Also in parser/env.h, defines are provided to implement the datatype
``unsigned character''.  These were described in the last section.  Generally,
either following the model of the VAX-780 or the PDP11/70 should be sufficient
for most machines.
.NH 2
Berkeley lookalikes
.PP
It has been reported that following the directions for Berkeley 4.2
(below) is also sufficient for the following systems:
.DS I
Ahmdal / System V
Pyramid 90x / System V
Sequent Balance 8000
.DE
.NH 2
Berkeley near-lookalikes
.PP
It has also been reported that following the directions for Berkeley 4.2 is
sufficient for installation on the following systems, with the 
one change that the symbol ENVSAVE should be defined in parser/env.h.
Note that on these systems, and other systems sharing the same
characteristics, the only indication that ENVSAVE should be defined will be
an obscure error message (usually ``-f: is not an identifier'') produced by the
shell if an attempt is made to load a class description following a
fast-load.
.DS I
Plexus P/35
Tektronix 6130 (presumably other Tek 61xx and 62xx machines).
.DE
.NH 2
AT&T 3B2, System V
.PP
The 3B2 does not have floating point hardware, and thus requires floating
point simulation software being linked in.  This is accomplished by adding
``\-f'' to CFLAGS \fIand\fP LFALGS in the makefiles in /sources and
/parser.  Other than for this change, the instructions for Berkeley 4.2 can
be used for the installation.
.NH 2
Dec Professional 350
.PP
In parser/Makefile the strings CFLAGS and LFLAGS should be left blank.
In sources/Makefile, however, the string CFLAGS should be defined to be ``\-m'',
to indicate the use of the code-mapping feature.  The normal construction rule
for the executable file st should be commented out, and the more complicated
loader instruction inserted in its place.  The appropriate rule is given in
a comment in the Makefile.
.PP
The string PREPATH in prelude/Makefile should be defined to be the path to
the prelude directory (this can be discovered by typing ``pwd'' in the
prelude directory).
.PP
In parser/env.h the ``meta-define'' DECPRO should be given, and any other
meta-defines removed.
Also in env.h the paths in the strings TEMPFILE, PARSER and PRELUDE should
be defined.  Note that /usr/tmp is not standard on Venix systems, and /tmp
should be used instead.
.PP
Because of the severe memory limitations on this machine, only Smalltalk
programs that produce a relatively small number of objects can be executed.
In fact, some of the later self tests fail with ``can't happen 1'' (out of
memory space).
Also, as more primitives are added to the system the size of primitive.o
keeps creeping towards the magic 8K limit on object file sizes for the code
mapping feature.  Eventually it may be necessary to split primitive.c into
two files in order to avoid this problem.
.NH 2
HP 9000 / HP-UX
.PP
Follow the instructions for the VAX 780 / Berkeley 4.2 (below) with the
exception that the meta-define should be given as HP9000 instead of BERK42.
Note that in the filenames in env.h that /usr has been changed to /users,
except for /usr/tmp, which hasn't (a foolish consistency is the hobgoblin
of little minds).
The fastsave routines have not been adapted to the HP extended memory
system, and thus fastsave should not be used.
.NH 2
IBM PC-XT
.PP
It has been reported that the instructions given for the PDP 11/70 (below)
are also sufficient for the IBM PC-XT running PC/IX.
.NH 2
PDP 11/70 (also 11/44)
.PP
In sources/Makefile and parser/Makefile the string CFLAGS should be left blank,
however LFLAGS should be set to ``\-i'' to indicate the use of
separate instruction and data spaces.  
.PP
The string PREPATH in prelude/Makefile should be defined to be the path to
the prelude directory (this can be discovered by typing ``pwd'' in the
prelude directory).
.PP
In parser/env.h the ``meta-define'' PDP1170 should be given, and any other
meta-defines removed.
Also in env.h the paths in the strings TEMPFILE, PARSER and PRELUDE should
be defined.
.NH 2
Perkin Elmer
.PP
The Perkin Elmer supports unsigned characters the same as the VAX, however
it does not have the gamma function in the standard library.  Follow the
instructions for the VAX/4.2, using the meta-define PERKELM.
.NH 2
RIDGE / ROS 3.0
.PP
Follow the instructions for the VAX 780 /Berkeley 4.2 (below), 
with the exception that the
meta-define should be given as RIDGE instead of BERK42.
The fast save feature does not work on the Ridge.
.NH 2
VAX 780 / Berkeley 4.2
.PP
In parser/Makefile and sources/Makefile the strings CFLAGS and LFLAGS should
both be left blank.
.PP
The string PREPATH in prelude/Makefile should be defined to be the path to
the prelude directory (this can be discovered by typing ``pwd'' in the
prelude directory).
.PP
In parser/env.h the ``meta-define'' BERK42 should be given, and any other
meta-defines removed.
Also in env.h the paths in the strings TEMPFILE, PARSER and PRELUDE should
be defined.
.PP
(VAX only) If the \-g flag is used the define FLUSHREQ need not be given 
(although it
will work if it is present), otherwise FLUSHREQ should be defined in order
for input and output to interleave correctly.
.PP
As distributed, the system does not perform a fastload (see next section)
automatically.  If fastload works this can be made default by defining the
symbol FASTDEFAULT.
.PP
These instructions appear to work also for the SUN workstation; of course,
if you have a SUN workstation you can run the Xerox system.
.NH
Fast Loading
.PP
The Little Smalltalk system has the ability to save and restore a user
environment by basically moving a copy of all of the users data space into
a file.  Although this produces rather large files, the savings in time
permitted by not having to recreate a specific environment can be
substantial.  Because this is such an unusual thing to do, it is probably
wise, if installing the system on a new machine/operating system, to first
comment out the define for FASTDEFAULT in parser/env.h, 
which will install a system which will not default to doing a fast load.
.PP
Once such a system has been created and passed all self tests, you can
experiment with fast loading by executing the st command with the argument
\-f.  For test cases you can use the programs in /tests.  If it appears to
be successful, then (by defining the variable FASTDEFAULT) you should
regenerate the system so that the default behavior is to do a fast loading.
(When regenerating the system, sources/main.c should be the only file
needing to be recompiled).
.PP
Fastloading does not currently work on the HP-9000.
It may not work on other machines as well.
.NH
Protections
.PP
The directories /sources and /parser need not be readable by casual users.
The directory /prelude contains files, however, which must be loaded by
the Little Smalltalk system prior to every execution.  The protection of this
directory, and on the files in it, should therefore be such that all users
have READ access.
Although the /tests directory is only used during system installation,
users may want to refer to it for examples of class descriptions and to see
how various problems (8 queens, dinning philosophers) have been solved in
Smalltalk.
Allowing all users access to the /docs directory will permit a kind of
on-line access, however users should not be allowed to modify any files in
any directory.
.NH
Non UNIX systems
.PP
Non UNIX systems which do not support multiple user processes, and thus the
system() call, cannot at current run Little Smalltalk.  There are plans,
however, to at some time in the future support such systems.  This section
will describe, in broad terms, the changes required.  The detailed changed
are, of course, at the moment not known.
.PP
First, the defined value NOSYSTEM must be given in parser/env.h.  This
will cause all occurrences of the ``system()'' call to be commented out,
and in most cases be replaced by error messages.
.PP
Next, the parser must be modified to place its output in a file (presumably
the file given as argument with .st replaced by .p) instead of the standard
output.  This is a trivial, although probably system specific, change.
.PP
In use, the user would then be required to ``compile'' all class
descriptions by running the parser (which therefore would have to be user
accessible program) before running the Little Smalltalk system.  Little
Smalltalk could not be used to edit class descriptions on the fly \- the
user would have to leave the system, perform the edit, and return to the
system.  This would seriously limit functionality and utility, but that is
cost of not running UNIX!
.NH
Troubleshooting
.PP
Here are a few of the problems you might run into, and possible solutions:
.PP
The first thing to suspect if you observe strange behavior is the
fastloading feature.  Try running the system with the \-m flag, which will
turn off fastloading.  For example, on the 11/70 fastloading will inhibit
the )i command from working correctly, but no error messages will be
generated.  The appearance of a message such as ``\fIxxx\fP: is not 
an identifier'', or of can't happen message number 23
is also a clue that fastloading does not work and should be disabled.
Similarly, the appearance of the message ``no such context as:
\fIxxx\fP/stdsave'' during startup is an indication that the file
containing the saved binary form of the standard prelude either does not
exist or is unreadable, or that the path given in parser/env.h is wrong.
.PP
The appearence of the message ``xxx: not an identifier'' following a fast
load or a )l command may be a sign that the environment pointer is being
trashed.   Try defining the symbol ENVSAVE and recreating the system.
.PP
Solutions to problems with fastloading are to try to 
to recreate the stdsave file in /prelude, or as a last resort to remove the
definition for FASTDEFAULT from /parser/env.h, ``make clean''
and recompile everything.
This latter step will configure a system that will not attempt fastloading
unless explicitly called for.
.PP
If the function _gamma is undefined following load for st.  Solution: remove
the definition for the symbol GAMMA, ``make clean'' and recompile.
.PP
\&``Cant't happen number 1''.  If you are running on a machine with small
memory, your program creates too many objects and runs out of memory.  If
you are running on a vax or other large machine - your application is
creating cycles or many many objects, probably a programming error.
.PP
No output appears when you start the program, and if you type control-D all
the output appears.  Solution: define the symbol FLUSHREQ and recompile.
.PP
Can't happen number 22 - either TEMPFILE is unreadable, or
/prelude/standard does not exist.
.PP
Systems that have trouble with long lines may have difficulty with the file
syms.c in /sources (there is one line in that file over 300 characters long).
If necessary, this file can (and will be) automatically reconstructed from
other files in the directory.
.PP
Receiving error number 129 whenever any non-primitive class method is
called may be a symptom of a clash of variable names.  On older systems the
variables runningProcess and runningInterpreter would clash on systems that
did not support long variable names.  The variable runningInterpreter (in
process.c) has since been changed to presentInterpreter, so this problem
should not occur in software taken from more recent distribution tapes.
.PP
129 errors can also be caused by bad preludes.  Try removing all the .p
files from /prelude and remaking standard.
(Frequently, if you receive an error when first building the prelude, some
of the .p files will be incorrect).
.PP
Note that /sources and /prelude have make instructions ``make clean'' which
remove object files and are useful in insuring the files are in a clean
state before starting a reconstruction of the system.
.NH
Further Distribution
.PP
The Little Smalltalk system is public domain, and may be distributed
further as long as proper attribution is given in all published references.
.PP
In the interests of keeping the distribution up to date and as error free
as possible, we wish to keep track of known sites using the
system.  People interested in being placed on the mailing list for future
bug announcements and new version announcements should contact Professor
Budd, at the address listed below.  Changes, modifications, or improvements
to the code or the standard library can be submitted also, and will be
considered for inclusion in future distributions.
.NH
What to do with BUGS
.PP
Observed irregularities in Little Smalltalk behavior during execution
(hereafter known as ``Bugs'') should be reported to:
.DS I
Professor Tim Budd
Little Smalltalk Distribution
Department of Computer Science
The University of Arizona
Tucson, Arizona  85721

CSNET address:  budd@arizona
UUCP  address:  noao!arizona!budd
.DE
.LP
The report of the bug should indicate whether it is reproducible, and if so
how it is manifested.  If it is available, a description of the fix for the
bug should be given, and it will be incorporated into future distributions.
Periodically, a listing of known bug fixes will be mailed to known sites.
.PP
The Little Smalltalk system is distributed without responsibility for the
performance of the system and without any guarantee of maintenance.
SHAR_EOF
if test 21091 -ne "`wc -c < 'docs/install'`"
then
	echo shar: error transmitting "'docs/install'" '(should have been 21091 characters)'
fi
fi # end of overwriting check
if test -f 'docs/macros'
then
	echo shar: will not over-write existing file "'docs/macros'"
else
cat << \SHAR_EOF > 'docs/macros'
.\" macros for producing descriptions of classes
.ds CM
.de Nm
.ds LH
.bp
.Im 0 \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
.ds LH class \\fB\\$\\n(.$\\fP (continued)
.in 0
..
.de Im
.in \\$1
.if 2=\\n(.$ .ft B
\\$2
.if 2<\\n(.$ .Im \\$1+2m \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.de Rs  \" respondsTo:
.ne 4v
.IP \\fI\\$2\\fP\\h'2m-\\w'\\fI\\$2\\fI'u'\\$1 15m
..
.de Ex   \" Examples
.br
.ne 10v
.SH 
Examples
.LP
.if 0=\\n(.$ .ta 4i
.el .ta \\$1
 	Printed result
.sp
.nf
..
.de Sx
.SH
\\$1
.IP
..

SHAR_EOF
if test 495 -ne "`wc -c < 'docs/macros'`"
then
	echo shar: error transmitting "'docs/macros'" '(should have been 495 characters)'
fi
fi # end of overwriting check
if test -f 'docs/man'
then
	echo shar: will not over-write existing file "'docs/man'"
else
cat << \SHAR_EOF > 'docs/man'
.TH st 1 "local"
.SH NAME
st \- a Little Smalltalk
.SH SYNOPSIS
st [options] [files]
.SH DESCRIPTION
.PP
\fBst\fP is an interpreter for a Smalltalk-like language.  For a complete
description of the language accepted by the interpreter see the user manual.
Options accepted by the command are as follows:
.IP \-a
If the \-a option is given statistics on the number of memory allocations
will be displayed following execution.
.IP \-d\fIdigit\fP
If the \fIdigit\fP is zero only those results explicitly requested by the
user will be printed.  If 1, the values of expressions typed at the
keyboard will be displayed (this is the default).  
If 2, the values of expressions and the values
assigned in assignment statements will be displayed.
.IP \-f
The \-f option indicates fast loading should be used, which loads a binary
save image (see ``)s'' below) for the standard library.
This is usually the default.
.IP \-l
The next argument is taken to be the name of a file containing a binary
image saved using the )s directive (see below).  This binary image is 
loaded prior to exeuction.
.IP \-m
Do not perform fast loading.  (Used when fastloading is the default).
.IP \-n
The \-n option, if given, suppresses the loading 
of the standard library.  
As this gives you a system with almost no functionality, it is seldom
useful except during debugging.
.IP \-r
The next argument is taken to be the name of a file of
Smalltalk commands.  The file is included prior to execution, just
as if a ``)r'' directive were given at the beginning of execution (see below).
.IP \-s
In normal operation, at the end of execution the number of reference
count increments and decrements is printed just prior to exit.
In the absence of cycles these two
figures should be equal.  Since cycles can cause large chunks of memory to
become unreachable, and seriously degrade performance, this information is
often useful in debugging.
The \-s option, if given, suppresses the printing of this information.
.PP
The files, if given, must contain class descriptions.  Consult the
reference manual for the syntax for class descriptions.  The classes
defined are included along with the standard library of classes before
execution begins.
.PP
Once execution begins, the cursor will tab over 8 spaces to indicate that
a command can be entered.
A command consists of a valid Smalltalk expression, without a terminating
period.
As each expression is entered it is executed by the Little Smalltalk
interpreter, and the results displayed.
.PP
The following system directives can be entered in place of commands:
.IP ")e filename"
Edit the named file, which must contain only class descriptions.
The Little Smalltalk system will suspend, leaving the user in an editor
for making changes to the named file.  Upon exiting the editor, the named
file will automatically be included, as with the )i directive (below).
The editor chosen by this command is taken from the variable EDITOR in the
user's environment.
.IP ")i filename"
Include the named file.  The File must contain one or more class
descriptions.  The class descriptions are parsed, and if syntactically
legal new instances of class \fBClass\fP are added to the Smalltalk system.
.IP ")l filename"
Load a saved binary environment.  The file must have been previously
created using the )s directive (below).  The values of all variables are
overridden.
.IP ")r filename"
Read the named file.  The effect is just as if the lines in the file
had been typed at the keyboard.  The file cannot contain class
descriptions.
.IP ")s filename"
Save the current environment in the named file.  The values of all
variables will be saved, and can later be restored using the )l directive
(above).
.IP ")!string"
.br
Execute the string following the exclamation point as
a Unix command.
.SH "Author"
Tim Budd, Department of Computer Science, The University of Arizona.
.SH "See Also"
Timothy A. Budd,
\fIA Little Smalltalk Users Manual\fP.
.SH Bugs
Not all the Smalltalk-80 Language described in the Blue Book is supported;
see the user manual for details.
(Smalltalk-80 is a trademark of Xerox Corporation).
SHAR_EOF
if test 4118 -ne "`wc -c < 'docs/man'`"
then
	echo shar: error transmitting "'docs/man'" '(should have been 4118 characters)'
fi
fi # end of overwriting check
if test -f 'docs/syntax'
then
	echo shar: will not over-write existing file "'docs/syntax'"
else
cat << \SHAR_EOF > 'docs/syntax'
.so macros
.ds CH
.Sx "Class Description"
.PS
ellipsewid = 1.3i
arrow
A: ellipse "class heading"
arc -> cw
arc
ellipse "instance variables"
arc ->
arc cw
B: ellipse "protocol"
arrow
arrow from A.e to B.w
.PE
.Sx "Class Heading"
.PS
arrow
circle "\fBClass\fP"
arrow
ellipse "variable"
arrow right 3i
move left 3i
move right 0.1i
arc -> cw
arc
ellipse "colon variable"
arc ->
arc cw
.PE
.IP
\fBvariable\fP defines the class name, must begin with an upper case letter.
.br
\fBcolon variable\fP defines the superclass name, superclass is \fBObject\fP
if not given.
.Sx "Instance Variables"
.PS
arrow
circle "|"
arrow
A: ellipse "variable"
arc -> cw
arc cw
arrow left 1.3i
arc cw
arc cw
move to A.e
arrow
circle "|"
arrow
.PE
.IP
Instance variables must begin with a lower case letter.
.Sx "Protocol"
.PS
arrow
circle "["
arrow
A: ellipse "method"
arc -> cw
line down 0.2i
arc cw
arrow left 0.4i
circle "|"
arrow left 0.4i
arc cw
line up 0.2i
arc cw
move to A.e
arrow
circle "]"
arrow
.PE
.IP
Vertical bar separating methods \fBmust\fP be placed in column 1.
.Sx "Method"
.PS
arrow
A: ellipse "method pattern"
arc -> cw
arc
ellipse "temporary variables"
arc ->
arc cw
C: ellipse "statements"
arrow
arrow from A.e to C.w
.PE
.bp
.Sx "Method Pattern"
.PS
A: arrow
ellipse "unary selector"
arrow right 3i
move to A
arc -> cw
line down 0.1i
B: arc
ellipse "binary selector"
arrow
ellipse "argument variable"
arc ->
line up 0.1i
arc -> cw
move to start of B
line down 0.6i
arc
ellipse "keyword selector"
arrow 
C: ellipse "argument variable"
arc
line up 0.6i
move to C.e
right
arc -> cw
arc cw
arrow left 3.1i
arc -> cw
arc cw
.PE
.IP
Argument variables must begin with a lower case letter, 
and must be distinct from instance variables.
.Sx "Temporary Variables"
.PS
arrow
circle "|"
arrow
A: ellipse "variable"
arc -> cw
arc cw
arrow left 1.3i
arc cw
arc cw
move to A.e
arrow
circle "|"
arrow
.PE
.IP
temporary variables must begin with lower case letters, 
and must be distinct from both instance and argument variables.
.Sx "Statements"
.PS
arrow
A: line right 1.5i
move to start of A
arc -> cw
arc
circle "\s+6\(ua\s-6"
arc ->
arc cw
B: ellipse "expression"
arrow right 2.5i
move to B.e
move right 0.5i
arc -> cw
arc
circle "."
arc ->
arc cw
move to B.e
arc -> cw
line down 0.4i
arc -> cw
circle "."
arrow left 2.5i
arc cw
arrow up 0.4i
arc cw
.PE
.Sx "Expression"
.PS
A: arrow right 3.3i
move to start of A
arc -> cw
arc
ellipse "variable"
arrow
B: circle "<\(mi"
arc ->
arc cw
C: ellipse "cascaded expression"
arrow 
move to B.e
arc -> cw
arc cw
arrow left 2.3i
arc -> cw
arc cw
.PE
.bp
.Sx "Cascaded Expression"
.PS
arrow
ellipse "simple expression"
arrow right 3.5i
move left 0.5i
right
arc -> cw
arc cw
circle ";"
arrow
ellipse "continuation"
arc -> cw
arc cw
.PE
.Sx "Simple Expression"
.PS
arrow
A: ellipse "binary"
arrow
move to A.e
arc -> cw
line down 0.2i
arc cw
ellipse "keyword"
arc -> cw
line up 0.2i
arc cw
.PE
.Sx "Binary"
.PS
arrow
A: ellipse "unary"
arrow
move to A.e
arc -> cw
B: line down 0.2i
arc cw
ellipse "binary selector"
arc -> cw
line up 0.2i
arc cw
.PE
.Sx "Unary"
.PS
arrow
A: ellipse "primary"
B: line right 2i
arc -> cw
arc cw
ellipse "unary selector"
arc -> cw
arc cw
move to B.e
arrow right
.PE
.Sx "Primitive"
.PS
arrow right 0.2i
circle "<primitive" wid 0.7i
arrow right 0.2i
ellipse "unsigned integer"
A: line right 1.7i
arc -> cw
arc cw
ellipse "primary"
arc -> cw
arc cw
move to A.e
arrow right
circle ">"
arrow right
.PE
.IP
Unsigned integer must be a number in the range 0-255.
.bp
.Sx "Primary"
.PS
A: arrow right 2i
ellipse "variable"
arrow right 2i
move to start of A
move right 0.5i
arc -> cw
B: line down 0.1i
arc
arrow right 1i
ellipse "literal"
arrow right 1i
arc ->
line up 0.1i
arc cw
move to end of B
C: arrow down 0.6i
arc
arrow right 1i
ellipse "block"
arrow right 1i
arc ->
line up 0.6i
move to end of C
Z: arrow down 0.6i
arc
arrow right 1i
ellipse "primitive"
arrow right 1i
arc ->
line up 0.6i
move to end of Z
arrow down 0.6i
arc
circle "("
arrow
ellipse "cascaded expression"
arrow
circle ")"
arc ->
line up 0.6i
.PE
.IP
If variable begins with an upper case letter it is a class name, otherwise
variable must be instance, argument or temporary variable or pseudo variable
name.
.Sx "Continuation"
.PS
A: arrow
arrow right 1.5i
ellipse "unary selector"
Z: line right 1.5i
arrow right 0.5i
move to end of Z
arc -> cw
arrow down 2i
arc -> cw
arrow left 4.5i
arc -> cw
arrow up 2i
arc -> cw
move to end of A
arc -> cw
C: arrow down 0.4i
arc
ellipse "binary selector"
arrow
ellipse "unary"
arc ->
line up 0.4i
arc cw
move to end of C
arrow down 0.6i
arc
ellipse "keyword"
arrow
D: ellipse "binary"
arc ->
line up 0.6i
move to D.e
right
arc -> cw
arc cw
arrow left 3.1i
arc cw
arc -> cw
.PE
.bp
.Sx "Block"
.PS
arrow
A: circle "["
arrow right 2.2i
ellipse "statements"
arrow
circle "]"
arrow
move to A.e
arc -> cw
arc
ellipse "block arguments" width 1.2i
arc ->
arc cw
.PE
.IP
The last statement cannot be followed by a period.
.Sx "Block Arguments"
.PS
arrow
A: ellipse "colon variable"
arrow
circle "|"
arrow
move to A.e
arc -> cw
arc cw
arrow left 1.3i
arc cw
arc cw
.PE
.Sx "Literal"
.PS
arrow right 1i
A: arrow
ellipse "number"
arrow right 1.5i
move to start of A
arc -> cw
B: line down 0.1i
arc
ellipse "symbol"
arc ->
line up 0.1i
arc cw
move to end of B
C: arrow down 0.6i
arc
ellipse "string"
arc ->
line up 0.6i
move to end of C
D: arrow down 0.6i
arc
ellipse "character constant"
arc ->
line up 0.6i
move to end of D
H: arrow down 0.6i
arc
ellipse "bytearray"
arc ->
line up 0.6i
move to end of H
E: arrow down 0.6i
arc
ellipse "array constant"
arc ->
line up 0.6i
.PE
.bp
.Sx "Number"
.PS
A: arrow right 3.6i
move to start of A
arc -> cw
arc
ellipse "base" width 0.8i
arc ->
arc cw
arc -> cw
arc
ellipse "sign" width 0.8i
arc ->
arc cw
ellipse "unsigned number"
arrow
.PE
.Sx "Base"
.PS
arrow
ellipse "unsigned integer"
arrow
circle "r"
arrow
.PE
.Sx "Sign"
.PS
A: arrow
arrow right 3i
move to end of A
B: arc cw
arc
circle "+"
arc
arc cw
move to end of B
arrow down 0.6i
arc
circle "\(mi"
arc
arrow up 0.6i
.PE
.Sx "Unsigned Number"
.PS
arrow
A: ellipse "unsigned fraction"
arc -> cw
arc
circle "e"
arrow right 0.25i
ellipse "sign" width 0.8i
arrow right 0.25i
ellipse "unsigned integer"
arc ->
arc cw
move to A.e
arrow right 4.2i
.PE
.Sx "Unsigned Fraction"
.PS
arrow
A: ellipse "unsigned integer"
arc -> cw
arc
circle "."
arrow
ellipse "unsigned integer"
arc ->
arc cw
move to A.e
arrow right 4i
.PE
.Sx "Unsigned Integer"
.PS
arrow
A: circle "digit"
arrow
move to A.e
arc -> cw
arc cw
arrow left 0.5i
arc -> cw
arc cw
.PE
.bp
.Sx "Symbol"
.PS
arrow
circle "#"
arrow
A: circle "char"
arrow
move to A.e
arc cw
arc cw
arrow left 0.5i
arc cw
arc cw
.PE
.IP
char is any non-space character that is not one of period, parenthesis
or square braces.
.Sx "String"
.PS
arrow
circle "'"
arrow
A: circle "char"
arrow
circle "'"
arrow
move to A.e
arc cw
arc cw
arrow left 0.5i
arc cw
arc cw
.PE
.IP
To include a quote mark in a string, use two adjacent quote marks.
.Sx "Character Constant"
.PS
arrow
circle "$"
arrow
circle "char"
arrow
.PE
.Sx "Bytearray"
.PS
arrow
circle "#"
arrow
circle "["
arrow
A: ellipse "unsigned integer"
arrow
circle "]"
arrow
move to A.e
arc -> cw
arc cw
line left 1.3i
arc -> cw
arc cw
.PE
.IP
Integer must be in the range 0 through 255.
.Sx "Array Constant"
.PS
arrow
circle "#"
arrow
ellipse "array"
arrow
.PE
.bp
.Sx "Array"
.PS
arrow
circle "("
arrow
A: arc -> cw
arc
ellipse "number"
arc ->
arc cw
B: arrow
circle ")"
arrow
move to start of A
arrow right 2.5i
move to end of A
C: arrow down 0.6i
arc
ellipse "symbol"
arc ->
arrow up 0.6i
move to end of C
D: arrow down 0.6i
arc
ellipse "string"
arc ->
arrow up 0.6i
move to end of D
E: arrow down 0.6i
arc
ellipse "character constant"
arc ->
arrow up 0.6i
move to end of E
arrow down 0.6i
arc
ellipse "array"
arc ->
arrow up 0.6i
move to start of B
right
arc -> cw
arrow down 3i
arc -> cw
arrow left 2.4i
arc -> cw
arrow up 3i
arc -> cw
.PE
.IP
The leading sharp sign can be omitted in symbols and arrays inside of 
an array list.
Binary selectors, keywords, and other strings are treated as Symbols inside
of arrays.
SHAR_EOF
if test 8153 -ne "`wc -c < 'docs/syntax'`"
then
	echo shar: error transmitting "'docs/syntax'" '(should have been 8153 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0