PREP Version 3.0
================
Description.
============
Prep is a pre-processor for imp11 programs which provides a conditional
compilation facility. The first parameter is the source file name, the second
parameter is the output file. If the output file is not specified
#p is used. The remaining parameters (which must be single
characters) are taken to be booleans (all true) to control the generation of the
text. Booleans not in the parameter list are taken to be false. The conditional
generation is controlled by lines begining with # i.e.
#if
#else
#fi
#datestring this is changed to a conststring declaration
containing the date %conststring(9) datestring='.....'
#timestring similarily returns a time declaration
#report prints "text" on the console
#abort causes the run to terminate with return code 1
If #datestring,#timestring,#report and #abort occur within a condition they
will only be effective if the condition is true.
The #if construct can be nested but this only is evaluated in the 'true' case.
The boolean operators are &, ! and ~. the precedence is ~ first then & and !
(left to right) brackets may be used. Null operands evaluate to false.
for example PREP(infile,outfile,k,r) the booleans k and r are true
or on DEIMOS
PREP infile/outfile:f,r
Within the file expressions such as
#if (k!x) & r
may be used.
Lines starting #if, #then and #else are normally commented out by preceeding
them with '!'; while lines within an #if .. #fi pair, where the expression is
false are commented out by enclosing them within braces ( {....} ). However
if the argument list contains the parameter "clean", all these comments are
omitted from the output file.
Example.
========
In this example the parameter 'd' is used to generate DEIMOS code, while 'e'
is used to generate EMAS code. PREP commands first inform which version is
being prepared, and then check that one, and only one, of 'd' and 'e' are set.
Then DEIMOS or EMAS specific declerations are included. (This example is
illustrative only!).
#if d
#report Preparing DEIMOS version
#fi
#if e
#report Preparing EMAS version
#fi
#if ~(d!e)
#report D or E must be set
#abort
#fi
#if d&e
#report Only one of D or E may be set
#abort
#fi
#if d
!Declare DEIMOS specific things
..
#else
!Declare EMAS specific things
#fi
If the file containing these commands is DEMO, the EMAS command to prepare the
DEIMOS version is:
PREP DEMO,DEMO#IMP,D
while the DEIMOS command is
PREP DEMO/DEMOI:D
Getting PREP.
=============
To access PREP on EMAS you must:
INSERT ERCM11.PREPPD_PREPY
Rebuilding PREP.
================
All the necessary components of PREP are in the PD file ERCM11.PREPPD. The
components are:
PREPS - PREP source file (which itself needs to be PREP'd)
PREPY - EMAS object file
PREPDOC - This document
OPREPE - Obey file to PREP and compile PREP for EMAS
OPREPD - Obey file to PREP, compile and link PREP for DEIMOS