Commit Graph

41 Commits

Author SHA1 Message Date
Ron Pinkas
a34ad40efb Minor corrections as per -W3 Warnings 2001-04-08 23:31:42 +00:00
Ron Pinkas
0902fc885d 2001-03-13 03:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.txt
     * Updated status of newly added support.
2001-03-13 11:49:39 +00:00
Ron Pinkas
01eb30bfc5 2001-03-13 03:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
   * contrib/dot/rp_run.ch
      + Added support for initializers for PRVATE, PUBLIC, LOCAL, STATIC
      + Added support for Declared Parameters and PARAMETRS.
      + Added support for STATIC Procedures & Functions (will not be seen by modules called by DO <filename>.prg and vice-versa.
      + Added support for INIT and EXIT procedures.
2001-03-13 11:40:38 +00:00
Ron Pinkas
43769b0051 2001-03-07 16:15 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Corrcted typos oError -> oErr
2001-03-08 00:21:34 +00:00
Ron Pinkas
ee9f53f2c5 2001-03-04 16:40 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Completed management of Variable Scoping.
     * Modified rest of Error Handlers to check type of :Args (Harbour bug).

   * contrib/dot/test.prg
     + Added test of private value after function call
2001-03-05 00:53:42 +00:00
Ron Pinkas
83d21ef953 2001-03-02 22:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Fixed handling of [Smart] Stringify of a period terminated macro.
2001-03-03 06:58:01 +00:00
Ron Pinkas
6398e0ec7f 2001-02-28 22:15 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Improved managment of variable scoping.

   /* Appears to work correctly when compiled with Clipper, but is incorrect under Harbour, because
      __MXRelease() is not releasing memvars as it should. */
2001-03-01 06:21:58 +00:00
Ron Pinkas
8b47c80e4c Minor corrections 2001-02-26 12:01:15 +00:00
Ron Pinkas
f7474e1cf6 2001-02-26 03:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added support for UDFs, PRIVATEs, PUBLICs, LOCALs, and STATICs

   + contrib/dot/rp_run.ch
     * Command Header for PP Interpreter Mode.

   * contrib/dot/test.prg
     * Sample prg runable by PP.

   * contrib/dot/pp.txt
     * Updated documentation.
2001-02-26 11:42:39 +00:00
Ron Pinkas
fb32fd6f2f 2001-02-24 13:20 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Minor optimization.

   + contrib/dot/pp.txt
2001-02-25 21:25:10 +00:00
Ron Pinkas
3ceb194fed 2001-02-24 19:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added CompileNestedBlocks() #ifdef __CLIPPER__, because Clipper's Macro Compiler can *not* compile nested blocks.

     /* Clipper macro compiler can't compile literal blocks which contain nested blocks. This is needed by #commands like:
        INDEX ON ... TO ...
        Now PP will pre-compile such nested blocks. This makes PP fully functional when compiled with Clipper too :-) */

   * harbour/source/rdd/dbfcdx1.c
     ! Moved few declarations above the HB_TRACE() lien, to fix compilation errors.
2001-02-25 03:59:52 +00:00
Ron Pinkas
41405ddc55 2001-02-23 08:25 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added support for DO <>.prg

   * contrib/dot/rp_dot.ch
      + Added #command DO <>.prg (no support for WITH yet)
2001-02-23 16:32:35 +00:00
Ron Pinkas
a73bcd3e07 2001-02-22 22:25 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Started support for interpreting prg files.
   * contrib/dot/rp_dot.ch
     + Added #command for stealing END

   /* PP can alreay "Run" simple prgs :-). It actually support most Clipper commands.
      It does *not* support LOCAL/STATIC/PRIVATE/PUBLIC, but any refference to a variable will create it as PRIVATE.
      It does not (yet) support creation of FUNCTIONs/PROCEDUREs but will execute any built-in, or linked, prodecure/function.
      It does not (yet) support WHILE and FOR loops.

      It can execute code like this:

      //------------------------------//
      CLS

      Alert( "Testinf PP as Interpreter... " )

      USE test
      IF ! File( "test" + IndexExt() )
   	INDEX on FIELD->First TO First
      ELSE
   	SET INDEX TO First
      ENDIF

      GO TOP

      cName := FIELD->First + FIELD->Last

      IF cName == FIELD->First + FIELD->Last
  	? "Ok"
      ELSE
  	? "Err"
      ENDIF

      DO CASE
         CASE cName == First // Not exact!
           ? "Err"

         CASE cName = First // But still equal
           ? "Ok"

         OTHERWISE
           ? "Err"
      ENDCASE

      REPLACE First WITH "From PP"

      ? FIELD->First
      //------------------------------//

      To have PP execute a PRG use: PP filename -R
    */
2001-02-23 06:40:04 +00:00
Ron Pinkas
da7de8dffd 2001-02-22 17:10 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Fixed order of production in multi line result, where some of the resulting lines are re-processed
     + Added support for IF, ELSE, ELSEIF, ENDIF, DO CASE, CASE, OTHERWISE, ENDCASE
     ! Fixed cursor position in Dot prompt to simulate running program cursor position.

   * contrib/dot/rp_dot.ch
     ! Fixed literal coordinates to use MaxRow() and MaxCol()
     + Added #command CLS to only clean the work region.
     + Added #commands to "steal" handling of IF, ELSE, ELSEIF, ENDIF, DO CASE, CASE, OTHERWISE, ENDCASE
2001-02-23 01:17:19 +00:00
Ron Pinkas
8a0b62fe33 2001-02-21 01:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Changed all extensions to lower case (.prg, .pp$, .cch ).
     * Changed Chr(13) + Chr(10) to CRLF which is #defined as HB_OsNewLine() if __HARBOUR__ is defined.
     * Changed literal size of buffer 16384 to PP_BUFFER_SIZE which is #defined as 16384

     /* Could Linux users please report results... */
2001-02-21 09:50:16 +00:00
Ron Pinkas
56466ab338 2001-02-20 23:10 UTC-0800 Ron Pinkas <ron@profit-master.com>
* make_gnu.bat
     ! Fixed maker to make -r
     * Added %HARBOURDIR% and removed trailing slash from HB_BIN_INSTALL, HB_LIB_INSTALL and HB_INC_INSTALL

   * contrib/dot/pp.prg
     * Minor corrections to stringifys

   * utils/hbtest/hbtest.prg
     * Commented out RddSetDefault( "DBFCDX" )
2001-02-21 06:04:15 +00:00
Ron Pinkas
99c5bb3d1f 2001-01-22 00:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
   * source/pp/ppcore.c
     ! Fixed processing of & with stringify.
2001-01-22 08:53:35 +00:00
Ron Pinkas
700d53687c 2001-01-09 10:00 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Fixed bug with #include and INCLUDE Env Var processing.
     % Removed some unused vars.
2001-01-09 18:00:40 +00:00
Ron Pinkas
003c498444 2001-01-08 12:35 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Added support for leading and traing WS before/after #.
     * Extra logic for [...] within # directives in ProcessFile()
     * Fixed logic of // and && terminating at EOF.
2001-01-08 20:41:32 +00:00
Ron Pinkas
99edf1b0f4 2001-01-08 02:10 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Few corrections in NextExp() and MatchRule().
2001-01-08 10:14:26 +00:00
Ron Pinkas
afb1e3f15d 2001-01-07 13:40 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Optimized ciclic detection logic.
2001-01-07 21:39:54 +00:00
Ron Pinkas
3ff96f6977 2001-01-05 09:57 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Corrected possible case sensitive issue RP_Dot.ch -> rp_dot.ch (Thanx to Dave Pearson)
     * Corrected @ 24, ... -> @ MaxRow(), ...                         (Thanx to Dave Pearson)
2001-01-05 17:59:13 +00:00
Ron Pinkas
fa721257a4 2001-12-03 10:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
   * source/pp/ppcore.c
     ! Fixed Array Index support after '.' (Macro Terminator).
2001-01-03 17:33:49 +00:00
Ron Pinkas
e7a8e2bda9 Fixed Handling of [] strings in ProcessFile() 2000-12-09 19:33:06 +00:00
Ron Pinkas
cf8b3caf7c 2000-11-14 02:35 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Corrected few pre-processor bugs.
     ! Corrected DOT multi-line support.
   * contrib/dot/rp_dot.ch
     + Added Clipper and Harbour support for GET

   * source/pp/ppcore.c
     ! Removed redundant line in md_strAt() whiched caused bug with tanslating within [] bracket expressions.
2000-11-14 10:37:00 +00:00
Ron Pinkas
d47c50295a 2000-11-11 23:35 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Corrected few pre-processor bugs.
2000-11-12 07:37:35 +00:00
Ron Pinkas
33ce57e6f7 2000-11-02 20:35 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Corrected minor bug with [] string delimiters.

   * contrib/dot/rp_dot.ch
     + Added rule for EXIT
2000-11-03 04:41:44 +00:00
Ron Pinkas
5fc2d50895 2000-10-22 09:05 UTC+0800 Ron Pinkas <ron@profit-master.com>
* source/compiler/simplex.c
     ! Corrrected bug reported by Luiz regarding menuto.prg

   * source/compiler/harbour.slx
     ! Corrected 1 debug trace message.

   * contrib/dot/pp.prg
     ! Corrected "Unbalanced '{'" warning reported by John.
     ! Corrected 2 typos in variable names reported by John.
2000-10-22 16:10:16 +00:00
Ron Pinkas
48f924b356 2000-10-20 00:30 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Forced uppercase and trim of restricted words.
2000-10-20 07:34:11 +00:00
Ron Pinkas
24ee8f1d78 Minor correction 2000-10-20 06:39:30 +00:00
Ron Pinkas
538fee3ae7 2000-10-19 23:15 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Minor corrections.
2000-10-20 06:16:41 +00:00
Ron Pinkas
3c03060c69 2000-10-19 22:00 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Fixed checking of stoppers for #XCOMMAND/#XTRANSLATE
       /* No longer known issues - I think it's ready for serious testing ;-) */
2000-10-20 05:05:38 +00:00
Ron Pinkas
f83f7d5134 2000-10-19 19:40 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Added logic to support multi-word stoppers needed by multi-word restricted list, like
      [ <lClick: ON CLICK, ON LEFT CLICK> <uLClick> ]
      /* Only 1 known error remains in processing of fwh/samples/fwbrow.prg */

   * include/hbclass.ch
     * Temprarily removed \ preceding < of not existing match markers, in nested # directive in result.
       /* Need to be readded once PP is fixed. */
2000-10-20 02:41:53 +00:00
Ron Pinkas
a0d9788264 ! Corrected bug with #else 2000-10-19 17:59:49 +00:00
Ron Pinkas
b60bc91148 ! Corrected bug with nested #if...
! Corrected handling of EOF.
     /* 2 minor bugs in PP of fwh/samples/fwbrow still pending. */
2000-10-19 17:34:50 +00:00
Ron Pinkas
37b5b14894 Corrected few errors in matching logic, and 1 error in compilation logic.
Tested to correctly pre-process FiveWin code, sample used: FWBrow.prg
which uses many of the FiveWin classes.

Reports of errors/incorrect pre-processing will be appreciated.
2000-10-19 08:13:02 +00:00
Ron Pinkas
b0277b2fbc 2000-10-18 01:30 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
      ! More corrections and refinments in pre-processing
      * Improved handling of command line parameters (no longer requires -P, -CCH doesn't require -U)
      ! Corrected handling of file extension.

    * include/hbclass.ch
      * Corrected <MethodName> to \<MethodName> when result marker not a match marker.
      * Corrected <params,...> to <param> (result marker used match marker format).
2000-10-18 08:29:28 +00:00
Ron Pinkas
1e28561f7b 2000-10-17 11:35 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
      ! Fixed few more associations within NextExp()
      + Added logic to auto create vars refernced in command line.
	/* Now the DOT prompt is much more functional, in both Clipper and Harbour. */
2000-10-17 18:38:23 +00:00
Ron Pinkas
9f21a3548c 2000-10-17 00:55 UTC+0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot
      ! contrib/dot/pp.prg
	! Fixed bug with processing of #include within #ifdef
	! Fixed handling of unterminated strings crossing file read buffer boundaries.
	! Fixed association of := and -> within NextExp()
	  /* I'm now able to PP my largest prg without any difference from Clipper (other then minor spacing
             differences). */
2000-10-17 08:06:33 +00:00
Ron Pinkas
d02fae6949 Added copy right notice. 2000-10-16 11:15:22 +00:00
Ron Pinkas
385841433e 1st version of a self contained Clipper/Harbour Pre-Processor and a "DOT" prompt
environment, written in the Clipper language.

The pre-processor is speced to be 100% Clipper/Harbour compatible, though
further testing is needed. It supports all of the Clipper PP Directives, Match
Markers, and Result Markers. It utilizes a much more aggresive compilation of the
PP rules, and thus uses a much simpler "interpreter" and output algoritems.

This file also offers a "DOT" prompt environment which can execute most of
the Clipper/Harbour syntax and supports all of the pre-processor directives
thus supporting any user defined commands.

Current exceptions are statements like:

LOCAL, STATIC, PRIVATE PUBLIC, FUNCTION PROCEDURE etc.

as well as flow control constructs like IF,ELSE,END,WHILE,CASE,FOR,NEXT etc.

This is a very early stage of the "DOT" environment, but it does demonstrate
the architecture, and already provides the core functionality.

The "DOT" mode, automatically loades rp_dot.ch to implement additional commands
on top of the built in rules (burned-in Clipper std.ch compatible).

Usage:

PP [PrgName] [-P][-U][-CCH][-DE|M|P]

   PrgName - Source file (PRG) to compile
   -P      - Will produce a PP$ file, which is the exact equivalent of the PPO file.
   -U      - Will excluse the burned-in standard rules
   -D      - Will produe debug trace information when folowed by E, M, or P
             E - Will trace the Expression parser
             M - Will trace the rule Matching system.
             P - Will trace the outPut system.

   -CCH    - Will produce a .CCH file which is a compiled version of any rules
             compiled. This flag *should* be used with the -U flag.

If no parameters are provided, the program will enter the "DOT" mode.

I hope this file can provide thise intersted with a better understanding of the
Clipper Pre-Processor structure and logic.
2000-10-16 11:04:23 +00:00