home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 549a.lha / M2P_v1.0 / M2P.ReadMe < prev    next >
Text File  |  1991-09-08  |  4KB  |  119 lines

  1. -----------------------------------------
  2. M2P Version 1.00
  3. -----------------------------------------
  4. Modula-2 Preprocessor
  5.  
  6. Finished Tool List
  7.  
  8. Category    Text Processing
  9.         Programming utility
  10.  
  11. Keywords    portability, preprocessing
  12.  
  13. Location    ab20.larc.nasa.gov, 
  14.         /incoming/amiga/languages/modula2/M2P.lzh
  15.  
  16. Author        Dennis Brueni, brueni@csgrad.cs.vt.edu
  17.  
  18. Dependencies    Currently only available for AmigaDOS
  19.         Compilers under either TDI or M2Sprint Modula-2
  20.         Requires usual Amiga include modules for the WorkBench
  21.         Startup code, fetching Command line parameters, 
  22.         Accessing AmigaDOS...
  23.         Works under WB 1.3, not yet tested under 2.0, but
  24.         I don't anticipate any problems.
  25.  
  26. QC Status    5 weeks in development, maybe has a few minor obscure 
  27.                 bugs.  I have been using it to maintain its own source
  28.                 and several other modules for the past three weeks, and
  29.                 it has worked well.  Runs reasonably fast, a lot of time
  30.                 was spent on optimization.  Requires about 40K statically
  31.         at run-time, but will allocate memory dynamically in 4K
  32.                 segments for the symbol table and to record macros.
  33.         The size of the executable file is under 30K. 
  34.  
  35. Full Description   Refer to the documentation included in the archive.
  36.            (both LaTeX and postscript sources available)
  37.  
  38.         To be brief, M2P accepts the following major
  39.         preprocessor command forms:
  40.  
  41.         @IF <boolean expression> THEN <statement>
  42.         @ELSIF <statement>
  43.         @ELSE <statement>    /* structured just like M2's IF */
  44.         @END
  45.  
  46.         @DEFINE <name>
  47.         @UNDEF <name>
  48.  
  49.         @MACRO <name><params> <statement> @ENDM
  50.  
  51.         @INCLUDE <filename>
  52.  
  53.         @<name><params>
  54.  
  55.         @LINE, @SPACE, @STRIP, @NOSTRIP, @@
  56.  
  57.         <statement> always refers to any M2P source code.
  58.         The above statements can be combined and nested in a
  59.         very regular, rather unrestricted fashion.  That is,
  60.         you may nest IF statements, or define macros within
  61.                 macros, ...  It is also free format. 
  62.  
  63.         A (perhaps) typical example of M2P's use would the 
  64.         following debugging code.
  65.  
  66.         @MACRO Aloha(procname,greeting,indent) 
  67.             @IF DEBUG THEN    /* assumes that 'i' is available */
  68.                 @IF indent THEN
  69.                 FOR i:=1 TO @indent DO
  70.                                InOut.Write(' ');
  71.                             END;
  72.                         @END
  73.             InOut.WriteString(@greeting);
  74.             InOut.WriteString(@procname); 
  75.             @END
  76.                 @ENDM
  77.  
  78.         @MACRO Enter(procname,indent)  
  79.             Aloha(@procname,'Entering:  '
  80.               @IF indent THEN ,@indent @END
  81.                          ) 
  82.         @ENDM
  83.  
  84.         @MACRO Leave(procname,indent)  
  85.             Aloha(@procname,'Leave:  '
  86.               @IF indent THEN ,@indent @END
  87.                          ) 
  88.         @ENDM
  89.  
  90.         PROCEDURE totrace;
  91.         BEGIN
  92.            @Enter('totrace')
  93.            .
  94.            .
  95.            @Leave('totrace')
  96.         END totrace;
  97.  
  98. Other Notes    I have made every attempt to make the code for M2P
  99.         portable.  Porting it to another platform should not
  100.                 take more than two or three days.  
  101.         
  102.         The source code to M2P also includes some perhaps
  103.         useful modules for managing symbol tables, linked
  104.         lists of symbols, Input and Output, Strings (a M2
  105.         implementation of the 4th draft standard Modula-2
  106.         strings library), lexical analysis, Resource tracking
  107.                 Storage, Parsing command line parameters, Workbench
  108.         tool types, and Managing Environment variables.  
  109.         This source code also exemplifies how
  110.         to put M2P to use.
  111.  
  112.         The distribution M2P.lzh includes the following:
  113.             M2P - AmigaDOS executable compiled w/ M2Sprint
  114.             M2P.tex - LaTeX documentation for M2P
  115.             M2P.ps - postscript documentation
  116.             (source) - source directory
  117.             (mods) - preprocessed source (for porting)
  118.  
  119.