

                     THE SYNTAX ANALYSER OUTPUT
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~

      The output from the syntax analyser is in three main parts:
i  ) The parsed version of the program, which is located at the front
     of an array (A) of integers;
ii ) The dictionary, which gives the external versions of all names used and
     is located at the top of array (A);
iii) An array (WORD), which is used to cross-reference between internal
     and external versions of variable names.





The Dictionary
~~~~~~~~~~~~~~

      Each word in the dictionary is stored in the form of an integer,
giving the length of the word, followed by a list of character constants
giving the actual letters etc.  of the name. 

      The dictionary complete is found at the top of the main array (A),
and is referenced using the variable DICTBASE, which gives the address
of its first entry in (A). 


Internal Variable Names
~~~~~~~~~~~~~~~~~~~~~~~

      The entries in the array (WORD) simply give the displacement
between the base of the dictionary and the entry in (A) giving the
length of the external name. 

      For more information see the section Names in the description of
the parsed program. 




The interface between the Syntax analyser and the rest of the compiler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


(i)       The main array A.
      This is located in the memory as an array starting at
      (WKFILEAD+256*WKFILEK) and has bounds (0:WKFILEK*768-300),
      where WKFILEAD is the address at which the compiler workfile 
      (T#WRK) is connected, and WKFILEK is the number of K in
      the workfile. The array consists of byte integers.

(ii)      Workspace.
      This consists of an array of byte integers (CC) starting at
      (WKFILEAD+32) with bounds (0:256*(WKFILEK-1))
      {see above for explanations of WKFILEAD & WKFILEK.

(iii)     The parm bits.
      The bits used are stored in the variables below:
      LIST:       Determines whether or not a listing is produced
                during parsing.
      PARMDIAG:   Denotes whether or not diagnostics are required
                (1 = yes, 0 = no).
      PARMLINE:   This simply shows whether the listing had line 
                numbers on it.
      PARMCHK:    This is set to 1 if checks are to be made for 
                unassigned variables. Otherwise the value should 
                be a zero.
      PARMARR:    This is set to 1 if checks on array bounds are to be 
                made, otherwise it should be zero.
      PARMPROF:   Denotes whether a profile is to be made.
      PARMDYNAMIC:Denotes whether storage can be dynamic (1 = yes, 2 = no).
      PARMCODE:   Whether or not any code is actually required.
                (1 = yes, 0 = no).
      PARMDBUG:   As PARMCODE, but debugging.
      PARMTRACE:  Whether or not tracing is required (1 = no, 0 = yes).
      FREE FORMAT:(1 = yes, 0 = no).


(iv)      Miscellaneous Variables.
      
      FILE ADDR: The connect address of the source code - zero if 
                 compiler source is from currently selected input channel.
      FILE END:  Connect address of the end of the compiler source code.
      FILE SIZE: Length of compiler source code.

      NNAMES:    Maximum number of variable names.

      TTOPUT:    The channel number of the error message output
                 (-1 if no error messages required).





The Parsed Program
--- ------ -------

   This occupies the first part of the array (A) of integers.

   Each line of the original program is parsed separately, using the
recursive descent parser.  The array entries of a line begin with the
length of the line in the array, which occupies the first 3 bytes.  The
two bytes after that give the line number,and the sixth byte gives the
type of statement the line originally had on it. 

Bytes		Use
0-2		Size of entry
3-4		Line number
5		Type of statement

The types used are listed below, and each is described separately.

Type Number:             Type:
       1                   General Assignment (with subtypes)
       2                   Comment
       3                   If/Unless
       4                   Finish
       5                   Cycle
       6                   Repeat
       7                   While/Until/For  loop
       8                   Declaration (with subtypes)
       9                   End
      10                   Record Format
      11                   Routine Specification
      12                   Constant Declaration
      13                   Include
      14                   Beginning of a block
      15                   On ... Event
      16                   Switch Label
      17                   "% list"
      18                   Else
      19                   Assembly Language
      20                   Trusted program
      21                   Mainep
      22                   Control
      23                   Unspecified Switch Label
      24                   Empty Line.

Separate descriptions are also given for Conditions, Expressions,
Constant lists, and Names. 

         
          Type 1            General Assignment
          ~~~~~~            ~~~~~~~~~~~~~~~~~~
Due to the wide variety of possible assignment statements, this type
deals with 9 subtypes (details follow). 

The first three bytes of this type consist of a pair of bytes which give
the total length of the subtype part of the line, (including these two
bytes), followed by the subtype number. 


Subtype 1 (Simple Assignment)
~~~~~~~~~
The first two bytes give the length of the following item, which is
??. 

Following this is an entry representing
        1)  The next entry represents an assignment operator
               ( 1: == ; 2: = ; 3: <- ; 4: -> ),
            and is followed by an expression.
        2)  This represents a colon, and implies that the name must be a 
            label.
        3)  Null. The statement must be a procedure call.

   If the following entry is a 1, then the original program statement
had an "%and" at this point (this should only be the case for 1 and 3
above), and another subtype follows (which could be another simple
assignment).
Otherwise the entry should be a 2.

Subtype 2      (Goto)
~~~~~~~ ~      
      This subtype consists of nothing but a name, with parameters if the
goto {->} refers to a switch.

Subtype 3      (Return)
~~~~~~~ ~ 

      This subtype gives no extra information, just the subtype number.

Subtype 4      (Result)
~~~~~~~ ~

      The first entry in the subtype represents an assignment operator
               ( 1: == ; 2: = ; 3: <- ; 4: -> ).
      This is followed by an expression.

Subtype 5      (Monitor)
~~~~~~~ ~

      The monitor statement requires no further details, but it can be followed
by an "%and", and another subtype (which could conceivably be another "%monitor"although it should not be).
      If the next entry is a 1, then this is the case, and another subtype 
follows. Otherwise, the entry should be a 2.

Subtype 6      (Stop)
~~~~~~~ ~
      No extra information is required.

Subtype 7      (Signal)
~~~~~~~ ~
      The first entry represents:
            1)  "%event"
            2)  Null,
and is followed by a (constant) expression giving the event number.
      If the next character is a 1, then another expression giving
a subsequent event follows. This is repeated until the next entry is a 2.

Subtype 8      (Exit)
~~~~~~~ ~
      No further information is given.

Subtype 9      (Continue)
~~~~~~~ ~
      No further information is given.

The first entry after the subtype represents 
      
1) The statement has a colon at the end of it and is therefore a label.
   (see subtype 1,2).
2) End of statement.
3) The subtype is followed by a "%if" statement (if next entry is a 1)
   or an "%unless" statement ( if next entry is a 2).
   In either case, a condition follows.
4) The subtype is followed by either 
   Next entry: 1) "%while"
               2) "%until"
               3) "%for"

In the case of a "%while" or "%until" loop, the next two entries give
the length of the following condition (including themselves).  "%For"
loops are slightly more complicated; the first two entries give the
length of the entire "%for" statement, (including themselves), which
consists of a name, followed by the three parameter expressions. 






          Type 2               Comment
          ~~~~ ~               ~~~~~~~

These are comments of the type:

"!  xxxxxxx<NL>"

only, as any others will previously have been edited out.  Array entry
consists of just the line length, line number and type. 

These are actually removed from the array before it is passed to the
code generation phase, so any occurrence should be treated as an error. 




         Type 3               If/Unless
         ~~~~ ~               ~~~~~~~~~

The first byte determines which of the two forms the statement
takes, with 1 representing "%if" and 2 representing "%unless".
      This is followed by a condition, with two bytes giving the
length of the condition (including themselves).

bytes		meaning
0		1 = %if
		2 = %unless
1-2		length of condition (including these bytes)
n		entry meaning:

      1) "%start"; this is followed by 4 integers giving the location of
         the first array entry of the corresponding "%finish" statement.
      2) "%thenstart"; as above.
      3) "%then"; this is followed by one of the subtypes given with type 1;
         if the first entry after the subtype is a 1, then an "%else" part 
         follows. Otherwise the entry after the subtype should be a 2.

         If there is an "%else" part, the first entry of it represents:
                1) "%start", followed by the location of the corresponding
                   "%finish".
                2) A complete If/Unless statement.
                3) One of the subtypes given under part 1, without the 
                   subtype length given.







         Type 4                   Finish
         ~~~~ ~                   ~~~~~~
Little needs to be said about this type except that if the first entry
is a 1, then the "%finish" is part of an If/Unless statement, and an
"%else"_ part follows (see type 3).  Otherwise the first entry should be
a 2. 

N.B.  if there is no corresponding "%start", or if the last block
started was a Cycle/Repeat block, then an error message is printed and
the code generation phase is prevented. 


         Type 5                  Cycle
         ~~~~ ~                  ~~~~~
The type number is followed by 4 bytes giving the location of the
corresponding repeat command.  If the next entry is a 1, then the cycle
is of the form:

               %cycle x = start,increment,finish

If it is a 2, it is an indefinite %cycle.


         Type 6                 Repeat
         ~~~~ ~                 ~~~~~~

      If the first entry is a 1, then the repeat has a "%until" condition
on it. Otherwise the entry should be a 2.
N.B. If there are no previous "%cycle"s, or the last block started was a
"%start...%finish", then an error message is printed and the code 
generation phase is prevented.





         Type 7                While/Until/For Cycle
         ~~~~ ~                ~~~~~~~~~~~~~~~~~~~~~

      The first entry denotes which of the above types the entry is, 
i.e. 
     1) "%while" statement
     2) "%until"     "
     3) "%for"       "

      "%While" and "%until" statements consist of two entries giving the 
length (including themselves) of the condition, followed by the 
condition itself.
      "%For" statements consist of two entries giving the length (including 
themselves) of the loop parameters, followed by the parameters, which consist
of a name and three expressions.
      The last four entries give the location of the first entry of the 
corresponding repeat statement.


          Type 8                 Declaration
          ~~~~ ~                 ~~~~~~~~~~~
Declarations at each level of the program are organised into linked
lists to assist with handling them.  The first four bytes for each line
therefore consist of the location of the start of the line containing
the next declaration at that level.

      There are two exceptions to this rule:
            (i)  If the declaration is the last at that level, the first four
                 bytes are set to zero;
            (ii) If the declaration occurs in the middle of a %CYCLE/%REPEAT or
                 %START/%FINISH loop, they are set to "128,0,0,0" (only the 128
                 is actually checked for).

The two bytes following the pointer give the length of the variable type
description (which comes next), including themselves. 

The variable type description consists of either:
         1) "%integer".
         2) "%real".
         3) "%long".   This is followed by either 
                       1) "%real"
                       2) "%integer"
                       3) "%longreal".
         4) "%byte".   This is followed by either
                       1) "%integer"
                       2) Null
         5) "%string". This is followed by either
                       1,1) a constant expression
                       1,2) an asterisk (*)
                       2)   Null
         6)"%half".    This is followed by either
                       1) "%integer"
                       2) Null
         7)"%short".   This is followed by either
                       1) "%integer"
                       2) Null
         8)"%record"   This is followed by either
                       1) a name, referring to a previously declared format.
                       2) a record format declaration.
 
Record Format
~~~~~~ ~~~~~~
      In the case of a record format declaration, {8,2}, if the next entry is
a 1 (*), it means that what follows is one of the eight variable types
given above. (It could be a recursively defined record although this is
unlikely). The variable type is followed by either:
              1)     /  1) "%arrayname" \
                    <   2) "%name"       >   followed by a list of names
                     \  3) Null         /    (at least one) separated by
                                             1's and culminating in a 2.
              2)    "%array" followed by an array declaration (see later).

      If this is followed by a 1, then another variable/array declaration
follows. This continues until a 2 is reached.
      If the next entry is a 1, then what follows is an alternative format for
the record. The alternative is described in the same way as the first format.
More than one alternative may exist, in which case they are given in the
form of a list separated by 1's and culminating in a 2.

(*)
      If the entry at this stage is a 2, then what follows is a complete record 
format declaration (as above) but which was bracketed in the original program,
and formed part of a larger record format.

      Following the type description is an integer representing:

      1) | 1) "%arrayname"                                     |
         < 2) "%name"                                          >
         | 3) Null, i.e. a standard variable declaration       |

      followed by a list of one or more names, separated by 1's and
      ending with a 2.

      2) "%array" then     1) "%format"
                           2) Null .

      This is followed by an array declaration.



Array Declarations.
~~~~~ ~~~~~~~~~~~~~
Array declarations begin with a 1 (there is only one possible format),
which is followed by a list of names separated by 1's and ending in a 2. 
The next entry is also a 1 (again, only one possibility).  Two
expressions follow, the first one representing the lower bound of the
array, the second one representing the upper bound. 

If the array is multi-dimensional, then next entry is a 1, and is
followed by another pair of expressions etc.  Otherwise the entry is a
2. 

If the next entry is a 1, then another complete array declaration
follows.  This continues until the next entry is a 2, which represents
the end of the declaration. 

         Type 9                  End
         ~~~~ ~                  ~~~
There are four types of this statement, and the first entry represents:
                 1)  "%ofprogram"
                     This simply checks for any unfinished cycle/repeat or
                     start/finish loops, and prints error messages for any that 
                     exist.
                 2)  "%offile"
                 3)  "%oflist"
                     This has the side effect of stopping the listing produced
                     by the syntax analyser; it does not affect the array.
                 4)  The only remaining alternative is that the "%end" must be
                     the end of a block. Unfinished loops are checked for as in
                     '1' above.

         Type 10                 Record Format
         ~~~~ ~~                 ~~~~~~ ~~~~~~
There are only two alternatives for this type:
      1) "%recordformatspec" followed by a name.
      2) "%recordformat" followed by a name, then a record format declaration
         (as in type 8).

         Type 11                 Routine Headers
         ~~~~ ~~                 ~~~~~~~ ~~~~~~~
This type handles the headings for the routines, maps and functions
specifications. 
  
The first two entries give the length in the array of the type of
routine, {i.e.  "%dynamicroutine"; "%externalbyteintegerfunction";
etc.}, including themselves.  The third entry represents either
       1) "%system"
       2) "%external"
       3) "%dynamic"
       4) Null.

      Following this is either "%routine" (entry is 1), or a variable
type (as given in type 8) and either
       1) "%fn"
       2) "%map"
       3) "%function"     (entry is 2).

      The next entry tells whether the routine is a specification heading only,
for a routine defined in full later. If the entry is a 1, then "%spec" is 
present in the heading. Otherwise the entry should be a 2. The next four entriescontain the location in the array of the start of the first declaration in the
routine (if the heading is not just a "%spec" )
or are left blank, presumably for use by the code generation phase (if it is a
"%spec").
      These are followed by the name of the routine.


      If the next entry is a 1, then the routine has been given an alias. This
is represented in the array by one entry giving the length (<=256) of the alias,
followed by a series of character constants. Otherwise the entry should be a 2.

      If the next entry is a 1, (*) then the heading includes a parameter list.
If so, the next two entries give the length of the first declaration, which 
consists of one of the variable types given in Type 8, followed by 
         1)  "%arrayname"
         2)  "%name"
         3)  Null 
       then a list of names separated by 1's and terminating in a 2.
A 1 in the next entry means that another declaration follows. This continues 
until an entry containing a 2 is reached.

(*)   If the next entry is a 2 there are no parameters.





         Type 12             Own/Const
         ~~~~ ~~             ~~~~~~~~~

      The first entry is used to distinguish between:
                1) "%own"
                2) "%external"

                3) "%extrinsic"
                4) "%constant"
const".   
     This is followed by one of the variable types given in Type 8.
 --->  If the next entry is a 1, then the two subsequent entries represent:
               /  1) "% arrayname"   \        
              <   2) "%name"          >  then    / 1) "%spec" \
               \  3) Null            /           \ 2) Null    /
 
    These are followed by two entries giving the length of the next part
(incliding themselves), which consists of the variable name, followed by a 
possible alias {optional}, then a constant expressionn.
 
{ alias}, 
constant expression follows. This continues until a 2 is reached.

---> If the next entry is a 2, it represents "%array" and is followed by:
        / 1) "%format" \    then    /1) "%spec"  \
        \ 2) Null      /            \ 2) Null    /

    The next entries give a name ( with possible alias, as described above),
followed by two expressions ( the upper and lower bounds of the array).
If the array is multi-dimensional, the next entry is a 1, and is followed by 
another pair of boundary expressions.  This continues until a 2 is reached.
    If the next entry is a 1, then a list of constants (see later) follows. 
Otherwise the entry should be a 2.
       

           Type 13                      Include
           ~~~~ ~~                      ~~~~~~~
      The only extra item in the array is a string constant giving the
name of the file to be included.
      N.B.  Include will fail if at any point other than the end of a 
statement;  Include files can only be nesred to a depth of 10.


           Type 14                        Begin
           ~~~~ ~~                        ~~~~~
   This simp;y 
c
>c
This simply consists of 4 integers giving the location in the array 
of the first declaration in the block.



         Type 15                          On (Event)
         ~~~~ ~~                          ~~ ~~~~~~~

   The first entry in this type consists of either 
        1) The original program code had "%event" after the "%on" 
        2) Did not have it after the "%omn
        2) Didn't have it after the "%on"
      
  This is followed by a list of constant expressions, separated by
1's and terminating in a 2.  The type finishes with a pointer to
the end of the event block; (i.e. the first entry of the line on 
which the corresponding finish line).


       Type 16                            Switch  Label
       ~~~~ ~~                            ~~~~~~  ~~~~~

      This type is the declaration of a switch label.  It consists simply
of a list of names, separated by 1's and terminating in a 2, followed by two 
expressions giving the bounds of the switch array.


       Type 17                             List
       ~~~~ ~~                             ~~~~

  This is the single word "%list". The statement has no effect on the array, 
but turns the listing of the syntax analyser on.

      Type 18                              Else
      ~~~~ ~~                              ~~~~

   This statement type represents the else part of an If/ Unless statement, 
if the "%else" is given a line to itself.
   The first two entries after the type number are both set to '1' to bring 
the format in line with that of types 3 & 4 (q.v.) for "%elsestart".
   The next four entries give the location in the array of the first
entry in the statement giving the corresponding "%finish".
   N.B.  The syntax analyser checks to see if there are any unfinished
cycle/repeat loops at this level, and if any are formed, stops the code 
generation phase and prints an error message.


      Type 19                               Machine Code Instructions.
      ~~~~ ~~                               ~~~~~~~ ~~~~ ~~~~~~~~~~~~

   This type denotes that the instruction is in machine code.
The possible machine code instructions are divided into three types,
erroneous instructions being represented by a fourth type.
   The first entry in the array at this point denotes:

      1)  "PUT_". An integer constant follows the "1".

      2)  The majority of the machine code instructions are
        parsed here. They are split into three subtypes, denoted by
        the next entry:
        
            1)  The line was of the form 'MNEMONIC_ARGUMENT'.
              The mnemonic is given by the next entry, compared with the
              following list:
               14:  NUL      16:  VAL      18:  CYD      20:  INCA
               22:  MODD     24:  PRCL     26:  J        28:  JLK
               30:  CALL     32:  ADB      34:  SBB      36:  DEBJ
               38:  CPB      40:  SIG      42:  MYB      44:  VMY
               46:  CPIB     48:  LCT      50:  MPSR     52:  CPSR
               54:  STCT     56:  EXIT     58:  ESEX     60:  OUT
               62:  ACT      64:  SL       66:  SLSS     68:  SLSD
               70:  SLSQ     72:  ST       74:  STUH     76:  STXN
               78:  IDLE     80:  SLD      82:  SLB      84:  TDEC
               86:  INCT     88:  STD      90:  STB      92:  STLN
               94:  STSF     96:  L        98:  LSS      100: LSD
               102: LSQ      104: RRTC     106: LUH      108: RALN
               110: ASF      112: LDRL     114: LDA      116: LDTB
               118: LDB      120: LD       122: LB       124: LLN
               126: LXN      136: EXPA     138: AND      140: OR
               142: NEQ      152: COMA     154: DDV      156: DRDV
               158: DMDV     168: FLT      170: IDV      172: IRDV
               174: IMDV     184: FIX      186: RDV      188: RRDV
               190: RDVD     192: UAD      194: USB      196: URSB
               198: UCP      200: USH      202: ROT      204: SHS
               206: SHZ      208: DAD      210: DSB      212: DRSB
               214: DCP      216: DSH      218: DMY      220: DMYD
               222: CBIN     224: IAD      226: ISB      228: IRSB
               230: ICP      232: ISH      234: IMY      236: IMYD
               238: CDEC     240: RAD      242: RSB      244: RRSB
               246: RCP      248: RSC      250: RMY      252: RMYD

              The next entry represents: 
                  1)  "<", a name, ">".  The name follows.
                  2)  An indirectable   {see below}
                  3)  "(", an indirectable {see below}, then either
                        1)  "+%D"
                        2)  null.
                      and ")".
                  4)  "(%DR+" followed by an indirectable {see below}, and ")".
                  5)  "(%DR" followed by either
                        1)  "+%B)"
                        2)  ")"
                  6)  "%B"

            2)   The line was of the form "MNEMONIC_%L=ARGUMENT"
              The next entry gives the mnemonic used, the entry being 
              compared to the following list:
               128: TCH      130: ANDS     132: ORS      134: NEQS
               144: PK       146: INS      148: SUPK     150: EXP
               160: SWEQ     162: SWNE     164: CPS      166: TTR
               176: MVL      178: MV       180: CHOV     182: COM

              The next entry represents either:
               1)  "%DR"
               2)  an integer, which is given in the next TWO array entries;
              in either case this is followed by:
               1)  ",", an integer, ",", an integer.   The two integers
                  are given in the next four array entries.
               2)  null.

            3)   The line was of the form "MNEMONIC_INTEGER ARGUMENT".
              The mnemonic is given by the next entry, compared with the 
              following list:
               2:   JCC      4:   JAT      6:   JAF

              and the integer is given in the next two entries.
              The next entry represents:
                  1)  "<", a name, ">".  The name follows.
                  2)  an indirectable  {see below}
                  3)  "(%DR" followed by    
                        1)  "+%B)"
                        2)  ")".
                  4)  "(%DR+". This is followed by an integer {in the
                    next two entries}, and ")".

      3)  "CNOP_" ARG1 "," ARG2.
        The next entry in the array gives the value of ARG1, and the entry
        after that ARG2

      4)  This is the type which denotes a machine code instruction with an 
        error.
          The syntax analyser simply rejects succeeding characters until 
          either "NL" or ";" is reached.



      Indirectables
      ~~~~~~~~~~~~~

      The first entry represents
      1)  The next entry represents
            1)  "="
            2)  null
          followed by 
            1)  "+"
            2)  "-"
            3)  null
          then a constant.

      2)  A name, followed by either
            1)  "+"  and an integer {in the next two array entries}
            2)  "-"  and an integer {             "               }
            3)  null.

      3)  "(" followed by 
            1)  "%LNB"
            2)  "%XNB"
            3)  "%PC"
            4)  "%CTB"
        then either
            1)  "+"  and an integer {in the next two array entries}
            2)  "-"  and an integer {             "               }
            3)  null
        and a closing bracket {")"}.

      4)  "%TOS".


      Type 20                               Trusted Programs
      ~~~  ~~                               ~~~~~~~ ~~~~~~~~
This type represents the statement "%trusted program" .  No additional
information is given. 

      Type 21                               Mainep
      ~~~~ ~~                               ~~~~~~
The only entries after teh type number consist of the name given in the
"%MAINEP" statement. 

      Type 22                               Control
      ~~~~ ~~                               ~~~~~~~
This type represents a statement of the form '"%CONTROL" constant'.  The
only extra entries in the array give the value of the constant. 

      Type 23                               Switch Label (*)
      ~~~~ ~~                               ~~~~~~ ~~~~~ ~~~
The array simply contains the name of the switch.

         Type 24                           Empty Line
         ~~~~ ~~                           ~~~~~ ~~~~
No further information given (or needed) after the type number.




     
     Conditions
     ~~~~~~~~~~
   The syntax analyser parses conditions in two parts: 
the first part being a simple condition and the second part
being a succession of either:
        ( "% and"<condition>)  or  ("%or" <condition>).

1st part  ( simple condition)
~~~ ~~~~
     If the first entry of a condition is a 1, then what follows is an 
expression (see later), then a comparator from the following list:
           1) =                6) <
           2) >=               7) unused
           3) >                8) ->
           4) # or\=or<>       9) ==
           5) <=              10) ##or \==. (reverse of '9').
  This is followed in turn by another expression.
    If the next entry is a 1, then the condition is double sided (e.g. 1<x<9),
and so another comparator and then another expression follows. Otherwise the 
entry should be a 2.
     
     If the first entry of a condition is a 2, then the program code consisted
of a complete condition ( both parts) in brackets, e.g. "("3+q>5 %and I <>0").."
In this case the first part of the condition is considered to be bracketted
section, and the second part is anything after the brackets,
          e.g.     (3+q>4 %and x=1) %orq<1
                   \_____________/ \______/
                     1st part       2nd part

   If the first entry of a condition is a 3, it simply represents "%not"
and a complete first part follows.
  N.B.  The syntax analyser will accept "%not x>1" for example

2nd part
~~~ ~~~~
    A 1 in the next entry represents "%and", and is followed by another simple
condition . If the next entry is also a 1, then this represents another "%and"

and is followed by another simple condition.
This continues until the next entry is a 2.
 A 2, in the next entry means similar to above, the only difference being 
the substitution of "%or" for "%and" .
 A 3, in the next entry means that there is no second part.


     Expressions
     ~~~~~~~~~~~

   The first entry in an expression should always be a 1,  as there
is only one general form they can take.

   The next twp entries give the length of the first operand (including themselves)
The first operand consists of a single entry denoting a +/- sign :
              / 1) "+" \
             /  2) "-"  \
             \  3) "\"  /
              \ 4) Null/
 
---> If the next entry is a 1, then the operand is a variable, and what 
follows is a name.  If the entry after the name is a 1, then the name refers
to either an array or a function, and has parameters. Otherwise the entry 
should be a 2.
    Parameters are given by a list of complete expressions separated by 1's
and terminating in a 2.
    If the entry after the parameters is a 1, then the name represents a
record, and the name of the subfield follows (which may have parameters or 
subfields of its own - if so, these are described in similar fashion to the
main ones). Otherwise the entry should be a 2.

---> If the next entry is a 2, then the operand is a constant.

---> If the next entry is a 3, then there follows a complete (sub)expression
in brackets.

     If the entry after the first operand is a 1, then there follows
an operator from the following list:

           1) "+"         6) "*"         11)">>"
           2) "-"         7) "!!"        12) "<<"
           3) "&"         8) "!"         13) "."
           4) "****"      9) "//"        14) "\\"
           5) "**"       10) "/"         15) "\"
    
      This is followed by another operand (although lacking the +/- and
the length (see above))

      If the next entry is a 1, then another operator/operand pair follows.
This continues until the next entry is a 2.




Constant Expressions
~~~~~~~~ ~~~~~~~~~~~

      These follow exactly the same format as expressions, except that they 
cannot include functions, array or record entries, and so the two entries
following a name are automatically set to a 2 to indicate a lack of parameters 
and subfields.




Constant Lists                          (see type 12)
~~~~~~~~ ~~~~~

      These consist of a list of constant expressions, each lacking the 
length pointer around the first operand, with their associated multiplicities.
      The constant expressions are denoted as above. If the entry after an 
expression is a 1, then a multiplicity factor is included. Otherwise the entry 
should be a 2, denoting a multiplicity factor of 1.
      If the first entry of a multiplicity factor is a 1, then it is followed
by a constant expression for the multiplicity; If it is a 2, it represents a
star (*), i.e. all the rest of the array.





Constants
~~~~~~~~~

      Case first entry of

            18)   Real {hex} constant in next four entries.
            53)   String constant. the next four entries give the 
                  location of the previous string constant (0 if 
                  this is the first); these are followed by the length of the
                  string, and then the character constants of the string
                  (up to 255).
            65)   Integer constant in next 2 entries.
            81)      "       "     "    "  4    "
            82)   Real       "     "    "  4    "
            98)     "        "     "    "  8    "
           114)     "        "     "    " 16    "


      Constants which take up more than one entry are given to base 256.





Names
~~~~~

      These are represented in the array by two entries giving a unique 
integer from 1 to 255^2. Each number represents a different name, although 
some numbers may be unused, and the maximum may be less than 255^2.
      The number refers to an entry in the array (WORD), which in turn refers 
to the displacement in the dictionary of the start of the actual 
variable name.



I.E.
      Value of entries in array (A) = Parameter for array (WORD)

      Entry in array (WORD)         = Distance from DICTBASE to start of
                                      word in array (A) {dictionary part}.







                               THE END
      
