============================================================================

                         EPP V1.4d.  E Preprocessor.
           Copyright ©1993-1994 Barry Wills.  All rights reserved.


============================================================================


DISTRIBUTION.
~~~~~~~~~~~~
   This product may be freely distributed under the following restrictions:

   1.  The complete contents of the original archive must remain intact.
   2.  The original material may in no way be modified.
   3.  This product may not be distributed for profit.  A nominal copying
       fee is authorized (for cost of materials and shipping and handling
       comparable to that charged by Fred Fish.)
   4.  Commercial distribution of this product without written permission
       from the author is forbidden.



USE OF THIS PRODUCT.
~~~~~~~~~~~~~~~~~~~
   This product may be used under the following restrictions:

   1.  Non-commercial use of this product is free of charge.
   2.  Commercial use of this product without written permission from the
       author is forbidden.
   3.  This product may not be used for malicious intent.



DISCLAIMER.
~~~~~~~~~~
   This product is provided without any warranty, express or implied.  The
   user of this product assumes full responsibility for any damage resulting
   from the use and/or misuse of this product.  Whaddya want for free? :-)



CONTENTS.
~~~~~~~~
   This archive should contain the following:

     EPP              - Executable v1.4c
     ShowMap          - Displays the module map which is produced and used
                        by EPP to report errors
     EPP.doc          - Copyright notice and product information (this file)
     EPP.history      - Revision history
     EHS.lzh          - EHS, E Header System (thanks Chad!)
     Source           - Directory containing EPP.e, ShowMap.e, reportError.e
                        pmodule, ReportErrorTest.e, and other example sources
     Fishcon.txt      - Short program description
     FreshFish.txt    - KingFisher file description
     Readme_First.doc - Getting started quickly
     Pmodules/*       - REAL-WORLD modules, RUH!
     Scripts/Mac2E!   - Example script to use with the -x switch.


============================================================================


WHAT'S NEW?
~~~~~~~~~~
   o  Speed enhancement optimizations.  EPP is now 100%+ faster!

   o  Directly calls EC!

   o  Accurate reporting of error location:  line number and module name!

   o  Reworked command-line:
      -w  for WbToFront() call (default is NO WbToFront());
      -v  option for verbose mode (default is now COMPLETELY silent);
      -b  and -l options are now obsolete;
      -s  saves final output source (default is to DELETE it);
      -m  save EPP module map file
      -n  no compilation (EC called by default);
      -e  pass args to EC;
      -x  execute intermediate command, after preprocessing and before
          compilation;

   o  Many new PModules!  (Hey, easily ported to E v3.0 modules!!!)

   o  Fixed a nasty bug that hung-n-crashed when the last line in a source
      file didn't end in LF.  As a side effect, this fixes EC's problem
      with ignoring missing ENDPROC.  (This happens when you type the last
      ENDPROC in your source, and your editor trusts that since you didn't
      type a return there, you don't want an LF.  Compiles okay, but crashes
      upon exiting your program...very tough boag to hunt since LFs are
      usually invisible :-)

   o  Fixed lotsa minor bugs.  EPP v1.3 (not released) took many liberties
      with source which could turn out bad under some curcumstances.
      These were eliminated and some more checks were put in.

   o  Enhanced parsing of PMODULE statement, now allows multi-name module
      lists (e.g., PMODULE 'x', 'y', 'z').

   o  Prevents duplicate MODULE declarations (circumvents E21b's double-
      library-module-inclusion bug-bites)!

   o  Handles E's future single-line comment symbol "->".  (Why?  'cause
      it was no extra work, really. :-)


REQUIREMENTS.
~~~~~~~~~~~~
   An Amiga with at least 1Meg of RAM.  I have tested EPP inside of about
   500K, and EPP processed itself with little room to spare.

   Of course, you will also need Wouter van Oortmerssen's Amiga E V2.1b or
   better.  At the time of this release, Amiga E V2.1b is the most recent.
   (NOTE: the Amiga E compiler requires at least 1Meg of RAM to be able to
   do anything meaningful.)

   The AmigaDOS Run command and the AmigaE compiler EC must be in your path.

   An assignment to T: with enough storage to accommodate temporary files
   (recommended in ram for speed).

 **EPP should not be KickStart dependent.  (If you find it is, please let
   me know!)



DESCRIPTION.
~~~~~~~~~~~
   EPP is an E project development tool which allows an E application to be
   developed in a modular fashion.  Use of this tool contributes towards
   some important software engineering concepts, namely reusability and
   modularity.  Anyone who has tried to write a respectable application in a
   language which doesn't support modules can attest to the unwieldiness of
   a huge main program file.  And anyone who has written multiple
   applications in a language which supports modules can attest to the
   luxury of being able to reuse source components without having to block-
   copy source code from several locations.

   EPP has been designed with simplicity in mind, so that only minimal
   changes should be required to source code in order to become compatible
   with future releases of E which allow modules.  At that time, EPP may
   respectfully retire. :-)

   NOTE:  Some features exist which will not be portable to E v3.0 at all,
   namely the "OPT TURBO" directive, and the capability to have a
   PROC main() in Pmodules.


           /*---------------------------------------------*/
           /*--  ENOUGH!!!  HOW DO I USE THIS THING???  --*/
           /*---------------------------------------------*/



USAGE.
~~~~~
   Invocation:  EPP [options] in[.e] [out[.e]] [-xCOMMAND]
       in  = path/filename of the main program, '.e' extension is optional.
       out = optional path/filename to use for the temp source file, which
             will (hopefully) be suitable for compilation with EC, the E
             compiler.  Default filename is main_temp.e.
   Options:
       -v            = verbose;
       -c            = insert EPP comments in final output source;
       -t            = Turbo mode;
       -w            = Workbench to front (for scripts);
       -s            = save temp source file;
       -m            = save EPP module map file;
       -n            = no compilation;
       -e[lanrwsbmX] = EC options, see E Compiler.doc;
       -xCOMMAND     = intermediate command (must be last);

   EPP allows primitive inclusion of user pseudo-modules.  EPP pseudo-
   modules are E source code.  EPP is similar to a C preprocessor in that it
   merges source code as specified by module inclusion directives entered
   into the source code.  Module inclusion directives use the following
   notation:

     PMODULE 'dev:path/filename_1' [,'dev:path/filename_2] [...]

   The keyword PMODULE is required.  The optional 'dev:' is any valid
   logical DOS device.  'Path' is the optional subdirectory in which the
   module can be found.  'Filename' is the name of the module file without
   the '.e' extension.  The '.e' extension is added automatically by EPP.
   The PMODULE statement may span multiple lines in the same fashion as the
   E MODULE statement.  (NOTE:  EPP does not use a default logical device or
   directory to locate modules.  The device and path must always be specified
   if the modules are not in the current directory.)

   EPP will merge all global declarations in the order of dependency as
   determined by the PMODULE statements:  first come, first serve.  EPP will
   then merge all procedures and functions in the same order.

   The final output file contains all modules' comments.  Additional module
   information is inserted at strategic locations by EPP if the -c switch is
   specified on the command line.

   See the two examples directories supplied with this package.  EPP_Example1
   attempts to simulate the structure of a real project.  EPP_Example2
   contains examples of how to use some of the modules provided in the
   PModules directory.



PROGRAM STRUCTURE.
~~~~~~~~~~~~~~~~~
   PMODULE statements can be put anywhere (see the "NOTE ON TURBO MODE"
   below for a caveat.)  The only thing you have to mind is that the modules
   containing types, constants, and variables needed by subsequent modules
   must be included first, otherwise EC will inform you of the error.  The
   general format of a main program is:

   You have a lot of flexibility in placement of modules.  EPP locates any
   module declarations at the front of the final output file, and the
   procedures are inserted at the place of module declaration.  Pseudo-
   modules MAY BE NESTED AS DEEPLY AS RESOURCES WILL PERMIT, i.e., as long
   as you have enough stack and memory you can have PMODULEs within PMODULEs
   within PMODULEs...



OTHER CONSIDERATIONS.
~~~~~~~~~~~~~~~~~~~~
   TURBO MODE:  Turbo mode does *not* recognize PMODULE statements that
   occur after the first PROC statement in a module.  Turbo mode does *not*
   check for duplicate PROC main()s in modules.  The reason for this is
   speed.  Turbo mode does *NO PARSING* of the procs section of modules.

   OPT TURBO:  this directive starts TURBO mode within a single module for
   the duration of that module.  It can be placed anywhere in a module
   outside of a PROC..ENDPROC.  The Turbo routine will be invoked upon the
   next occurrence of the PROC keyword.  OPT TURBO must, of course, be
   uncommented.  It may be placed as far down in the module as desired.  Only
   one OPT TURBO directive should be used within a module file since
   subsequent occurrences will not be parsed once the Turbo routine is
   invoked, and EC will not recognize "OPT TURBO".

                          *    *    *    *    *

   EPP is *NOT* like the COBOL COPY statement.  Any global definitions and
   declarations in a module are moved to the global section of the main
   program.

                          *    *    *    *    *

   EPP tries to be smart about what it is reading.  It is not, however, a
   full-blown syntax checker.  EPP relies on good syntax in your modules, so
   you should test modules for syntax before using them with EPP.  This will
   reduce the risk of brain damage. :)

                          *    *    *    *    *

   EPP allows you to keep a PROC main() in all modules to facilitate ease
   of testing.  Any PROC main() encountered in modules other than the main
   module are omitted, and, if EPP comments are turned on, an E comment is
   inserted in the final output file to indicate this.  This can be quite
   handy while testing a module since E requires a PROC main() in order to
   compile the module.  EPP saves you the hassle of commenting and
   uncommenting code in your source module during development.  (HINT:  place
   all test PROCs after PROC main() and EPP will ignore them.  Likewise, if
   you want PROCs recognized by EPP, don't put them after a PROC main() in
   your modules.)  THIS FEATURE IS NOT AVAILABLE IF YOU CHOOSE TO USE THE
   TURBO OPTION IN A MODULE.  (HINT:  use the OPT TURBO directive in modules
   that don't need this feature to speed up processing.  Duplicate PROC
   main()s will still be omitted in modules not using OPT TURBO.)

                          *    *    *    *    *

   Since EPP is simply a sophisticated text file merger, it is up to you to
   ensure that all your modules' identifiers are unique.  If they are not,
   the E compiler will inform you of the duplicate identifiers.

                          *    *    *    *    *

   Using the -x switch takes some consideration.  EPP makes no assumptions
   about what intermediate command might be issued.  EPP expects that after
   your intermediate command operates the temp file (default temp_main.e),
   the modified source will be found under the same file name as the temp
   file.  Therefore, if your command creates a processed file that is
   differently named, you must rename or copy it back to the temp file.
   See the included shell script Mac2E! for an example of this process.



============================================================================


LIMITATIONS.
~~~~~~~~~~~
    - If you like to put comments outside of PROCs you will notice that some
      of them don't end up where you'd like, especially those that follow
      the global declarative section.  See Example1 project, module 'mod2.e'
      for a demonstration of this phenomenon.  EPP thinks that everything
      before the first PROC belongs to the global declaratives.  (HINT:  keep
      your modules small and put your comments *inside* the PROC, immediately
      following the headers.)



============================================================================


MISCELLANEOUS.
~~~~~~~~~~~~~
This product was developed in Amiga E language and tested on a Commodore
Amiga 500 with the following configuration:

   KickStart V1.3, WorkBench V1.3, ©Commodore-Amiga, Inc.
   KickStart V2.04, WorkBench V2.1, ©Commodore-Amiga, Inc.
   Amiga E V2.1, ©Wouter van Oortmerssen

   DataFlyer 500 SCSI controller
   Quantum 52M HD
   Dual 880K floppy drive
   1M 16-bit Chip RAM
   CSA Derringer 030 accellerator:
      68030 CPU @25MHz
      68881 FPU @27MHz
      4M 32-bit Fast RAM

   Caffiene
   Sugar
   Amino Acid Tablets
   Hard Rock and Metal


============================================================================


CREDITS.
~~~~~~~
  - Special thanks to Chad Freeman for permission to include EHS, his E Header
    System!  (The incomplete docs are *his* fault, though! :-) :-)

  - Special thanks to the dauntless EPP beta testers:  Matthew Hornyak, Mark
    Langston, Alex McCracken, Jessie Thornton, and Lionel Vintenat!  (In
    alpha-ascending order of surname.)

  - Special thanks to Alex McCracken for really putting EPP through the
    wringer.  Great work, Alex!

  - Special thanks to Lionel Vintenat for many, many wonderful suggestions!

  - Special Wouter van Oortmerssen for Amiga E!  (And for revealing to me
    the insidious, ubiquitous, sideways smiley face :)



============================================================================


CONTACTING THE AUTHOR.
~~~~~~~~~~~~~~~~~~~~~
I can be reached by the following means:

  Internet:  el269@cleveland.freenet.edu

  USnail:    Barry Wills
             5528D Pryor Dr.
             Scott AFB, IL 62225 (USA)
             (618)-744-1096

I originally wrote EPP for my own use.  It's very fulfilling to author
something that others enjoy as much as I do, hence this update (which I
never expected to produce :)  Thanks to all those who mailed me comments,
suggestions, and compliments!  Please send mail, money, software, warm
weather to the address(es) above.  I am very interested in feedback; I
will answer all mail.  Good luck and enjoy!

  -- Barry



============================================================================

