Commit Graph

81 Commits

Author SHA1 Message Date
Ron Pinkas
3cff3ee850 Synched with latest PP from xHarbour. 2002-03-15 16:51:47 +00:00
Ron Pinkas
3292075b00 2002-01-19 06:11 UTC-0800 Ron Pinkas <ron@ronpinkas.com>
* contrib/dot/pp_harb.ch
     + #ifdef __XHARBOUR__ to protect xHarbour fastitem reliance.
2002-01-23 23:07:31 +00:00
Ron Pinkas
0d64ecd809 2002-01-20 08:50 UTC+0800 Ron Pinkas <ron@ronpinkas.com>
* contrib/dot/pp.prg
  * contrib/dot/pp.txt
  * contrib/dot/pp_harb.ch
    * Synched with source of RC-2 of xBaseScript ( http://SourceForge.net/Projects/xBase-Script )
2002-01-20 16:56:37 +00:00
Antonio Linares
60dcc0ef41 STOPDUMP renamed as ENDDUMP 2001-12-21 11:46:52 +00:00
Brian Hays
9ce084bc35 2001-08-25 03:05 UTC-0800 Brian Hays <bhays@abacuslaw.com> 2001-08-25 22:06:39 +00:00
Ron Pinkas
eac7f1fcbf 2001-08-09 20:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Corrected logic for closing ppo output file.
2001-08-10 03:16:06 +00:00
Ron Pinkas
f089898c00 2001-08-02 10:00 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.txt
     * Corrected typos.

   * include/hbpcode.h
     * Corrected comments for HB_P_MACROLIST and HB_P_MACROLISTEND
2001-08-02 16:56:42 +00:00
Ron Pinkas
1d690a55d6 2001-07-23 04:20 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Various refinments in matching and outputing due to new observations about Clipper.
2001-07-23 11:18:49 +00:00
Ron Pinkas
6f912ba2bd 2001-07-19 20:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
* include/hbapi.h
     + Added #define HB_MAX_MACRO_ARGS 16

   * source/vm/hvm.c
   * source/vm/macro.c
     + Added support for nested HB_P_MACROPUSHARG

   * contrib/dot/pp.prg
     - Removed bSplit in PP_PreProLine(). Instead added logic to split the line unless line is a directive.
2001-07-20 03:32:06 +00:00
Ron Pinkas
8abc351c51 2001-07-17 18:25 UTC-0800 Ron Pinkas <ron@profit-master.com>
* utils/hbpp/hbpp.c
     * Commented an exit() call in hb_compGenError() to continue processing after an error just like Harbour does.

   * include/hbapi.h
     + Added 2nd parameter BOOL bArg to hb_macroGetValue()

   * include/hbexpra.c
     + Added global BOOL hb_exp_bArgList = FALSE;

   * include/hbexprb.c
     + Added logic to generate HB_P_MACROPUSHARG rather than HB_MACROPUSH when pushed macro is a function call argument.

   * include/hbpcode.h
   * source/compiler/genc.c
   * source/compiler/hbfix.c
   * source/compiler/hbpcode.c
     + Added new HB_P_MACROPUSHARG

   * source/macro/macro.y
     + Added logic to generate an error if macro expression is list, unless servicing an HB_MACROPUSHARG.

   * source/vm/hvm.c
     + Added support for new HB_P_MACROPUSHARG calling hb_macroGetValue() with TRUE for bArg.

   * source/vm/macro.c
     + Added 2nd parameter BOOL bArg to hb_macroGetValue() to signify servicing of HB_P_MACROPUSHARG.

   * contrib/dot/pp.prg
     + Added bSplit 4th paramater to PP_PreProLine() defaulting to .T.. - Calls from PP_PreProFile() set it to .F..
2001-07-18 01:29:53 +00:00
Ron Pinkas
1f3307d61c 2001-07-09 22:00 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Changed PP_Main() to STATIC Main() to have a Main procedure for build that require a MAIN yet avoid conflict if linked with a prg including a MAIN.
   * contrib/dot/pp_harb.ch
     * Wrapped a Windows specific code within #ifdef WIN.
   /* Thanks to input from Tomaž Zupan. */

   * source/pp/ppcore.c
     ! Added a BOOL 2nd parameter to isExpres() to flag a LIST MP. This fixes problem with matching a list exp with an empty component.
2001-07-10 05:02:50 +00:00
Ron Pinkas
1a10090591 2001-06-22 07:55 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added logic for new Idenitifier Match Marker <!AnyId!> which will only match Identifiers.
2001-06-22 14:58:14 +00:00
Ron Pinkas
e49056d419 2001-06-21 22:20 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Added support fort '|' as a continuation token (as in Clipper).

   * include/hbclass.ch
     - Commented out 3 rules used for VO OO compatibility that are TOO generic, and match unexpected input.

   * source/pp/ppcore.c
     - Recommented out test for continuation token at the end of an Expression in isExpres() (after correcting cause for prior reinstatment).
2001-06-22 05:22:42 +00:00
Ron Pinkas
0c9194fe64 2001-06-21 14:05 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Revised explicit support for Extended expression match marker, in NextExp() to use normal logic for () expresiions.
2001-06-21 21:06:48 +00:00
Ron Pinkas
51ddbe5081 2001-06-21 10:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Changed MatchRule() to set sNextAnchor (for NextExp()) by skipping to next NON optional Anchor.
2001-06-21 17:50:50 +00:00
Ron Pinkas
9ffdc74852 2001-06-21 10:40 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Changed MatchRule() to set sNextAnchor (for NextExp()) ONLY for NON optional Anchor.
2001-06-21 17:35:51 +00:00
Ron Pinkas
e45efc7a41 2001-06-21 09:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added explicit support for Extended expression match marker, in NextExp()
2001-06-21 16:48:10 +00:00
Ron Pinkas
9b1ac52d14 restored deleted files. 2001-06-11 00:31:27 +00:00
Antonio Linares
2bf5dc706b *** empty log message *** 2001-06-05 18:05:48 +00:00
Antonio Linares
78d1eff767 *** empty log message *** 2001-06-05 18:00:28 +00:00
Ron Pinkas
2c507cf450 2001-06-03 23:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added #ifdef WIN to support using Windows MessageBox() instead of Alert(), use BLD pp -dWIN to activate.
   * contrib/dot/pp_harb.ch
     + Minor revision in TInnterpreter() class.
     + Added wrapper for MessageBox()
   * contrib/dot/rp_run.ch
     + Added #ifdef #command to translate
2001-06-04 06:55:16 +00:00
Ron Pinkas
6aaecd70e6 2001-06-01 10:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + PP_RunArray( asLines, aParams )
     + PP_Exec( aProcedures, aInitExit, nProcId, aParams )
     * Modified all PP_RunXXXX() to use PP_Exec()
     * RP_Comp_Err() now repports source line and line number with the sysntax error.

   * contrib/dot/pp_harb.ch
     + Added Tinterpreter() class
         METHOD New()
         METHOD AddLine( cLine )
         METHOD SetScript( cText )
         METHOD Compile()
         METHOD Run()
         METHOD RunFile( cFile, aParams, cPPOExt, bBlanks ) INLINE PP_Run( cFile, aParams, cPPOExt, bBlanks )
         METHOD ClearRules()
         METHOD InitStdRules()
         METHOD LoadClass()
         METHOD LoadFiveWin()

   * contrib/dot/prgscrpt.prg
     * Modified to demonstrate TInterpreter() syntax.

   * include/hbapi.h
   * source/vm/arrays.c
     * Fixed bug, in hb_stackArrayFromParams() and modified to accept a frame base parameter.

   * source/vm/arrayshb.c
     + Added HB_APARAMS() PRG wrapper to hb_stackArrayFromParams() returning array with passed parameter of the function calling HB_APARAMS()

   * source/rtl/do.c
     * Added required frams base parameter in calls to hb_stackArrayFromParams(). This fix population of oErr:Args if error occurs.
2001-06-01 17:42:09 +00:00
Ron Pinkas
73db18f32d 2001-05-30 09:05 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + PP_ResetRules()
     + PP_InitStd()
     + PP_LoadRun()
     + PP_LoadClass()
     + PP_LoadFW()
2001-05-30 16:07:37 +00:00
Ron Pinkas
f70ae7a150 + PP_InitStd() 2001-05-30 15:52:06 +00:00
Ron Pinkas
7ecb733987 2001-05-30 08:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Fixed PP_PreProLine() to not generate '#line n "<module>"' if module name is empty()
2001-05-30 15:44:31 +00:00
Ron Pinkas
e92d3a8188 2001-05-30 01:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     + Added PP_PreProText( cText [, acLines ] ) returns the pre-process text and optional file asLines with pre=processed lines.
     + Added PP_RunText( cText, [bPreProcess], [aParmas] ) returns the return value of executed code. bPreProcess defaults to .T.
     * Enhanced PP_Run( cFile [, aParams] ) to accept optioanl Array with Paramaters.
     ! Minor correction in NextExp().

   * contrib/dot/prgscrpt.prg
     * Rewrote sample to demonstarte new simpler wrapper functions:
2001-05-30 08:41:51 +00:00
Ron Pinkas
5cff3e5d7e // Note, aCompiledProcs MUST be an array.
PP_RunInit( aCompiledProcs )

   // Note the return value from PP_ExecProcedure() and no Procedure declaration in this 1st sample...
   Alert( PP_ExecProcedure( ;
        PP_CompileLine( ;
          PP_PreProLine( "Private cVar := 'Hi there'; ? cVar; Return 'Returned from embedded script!'" ), ;
                         0, aCompiledProcs, NIL, @nProcId )[1] ) )
2001-05-29 02:13:22 +00:00
Ron Pinkas
5125ec5218 Corrected 2 more typos 2001-05-28 22:04:21 +00:00
Ron Pinkas
11881115ac Corrected typos 2001-05-28 22:02:22 +00:00
Ron Pinkas
6ae9ae8dc2 2001-05-28 14:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Renamed PP_ProcessLine() to PP_PreProLine() and PP_ProcessFile() to PP_PreProFile() to allow 10 chars uniqueness.
     * Changed STATIC ExecuteMethod() to PP_ExecMethod() and STATIC ExecuteProcedure() to PP_ExecProcedure()
       to allow call from external modules, while preserving name space, and 10 chars uniqeness.
     * Removed STATIC from RP_*_Err() to allow calls from external modules.
     * Changed PP_CompileLine() to accept array of compiled procedures, instead of using a static.
       This allows thread safety, and support calls from external modules.
     * Changed RP_Run_Err() to accept 2nd parameter the Compiled Procedures Array, and 3rd parameter Module Name.
       This allows thread safety, and support calls from external modules.
     + Added PP_RunInit() to support initialization for Interpreter mode from external modules.
     + Added #ifdef __HARBOUR_ #include "pp_harb.ch" to allow Clipper to compile pp.prg.

   * contrib/dot/rp_run.ch
     * Changed ExecuteMethod() calls to PP_ExecMethod()

   + contrib/dot/pp_harb.ch
     + Added external file holding Harbour specific code that Clipper could not compile.

   + contrib/dot/prgscrpt.prg
     + Added sample to demonstrate PP interpreter embeded in a small prg to run prg driven scripts.
2001-05-28 21:48:50 +00:00
Ron Pinkas
453242b03f 2001-05-28 03:20 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Renamed Main() to PP_Main(), ProcessFile() to PP_ProcessFile() and ProcessLine() to PP_ProcessLine()
     * Qualified all "private" functions/procedures with STATIC.
2001-05-28 10:21:47 +00:00
Ron Pinkas
93b4ab7cd2 2001-05-28 02:45 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Fixed support for multi-words in restricted list matching in NextExp()
2001-05-28 09:42:53 +00:00
Ron Pinkas
14154f017e 2001-05-27 21:20 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     * Few minor corrections to NextExp()
     ! Fixed generation of compiled rules results to always have marker place holders, even if no results exist.
     + Added TraceLog() message about repeatble results for non optional markers.
     * Updated burned-in rules for FiveWin.ch with newly generated rules.
     + Added few #ifdef FW to better support compilation with \fwh\samples\buildh.bat
     + Added #include "fwextern.ch" (#ifdef FW) to force link most FW modules.

   /* PP, if built like this:

         BUILDH pp -dFW

      (note -dFW) will produce PP.exe which will run most \fwh\samples\*.prg

      Test like this:

         PP Tutor01 -R

      etc... :-)

   */
2001-05-28 04:33:08 +00:00
Ron Pinkas
da0e4678cd 2001-05-26 21:10 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
     ! Fixed support for '$' in NextToken() and NextExp()
     + Added nAtSkipStr() to exclude content of strings when searching for ';'
     ! Fixed Multi Line logic to use nAtSkipStr() instead of At()
     + Added infile C versions for NextToken() and NextIdentifier()
     + Added precompiled rules for FiveWin.ch (Harbour)
     + Added precompiled rules for RP_Run.ch.

   * source/compiler/genc.c
     + Added few #include files to generation of inline C.
2001-05-27 04:14:30 +00:00
Ron Pinkas
f0c9749ff2 Clipper always associate '.' with trailing digits, if any, even without digit prefix.
Corrected NextToken() and CompileRule() match compiler accordingly.
2001-05-25 05:44:45 +00:00
Ron Pinkas
057812a1c8 Corrected tokenizing of numbers with decimal point in NextToken() and CompileRule() 2001-05-25 04:02:33 +00:00
Ron Pinkas
fe40609370 Refined CompileRule() to use same logic as NextToken() when compiling the match patterns. 2001-05-25 01:33:03 +00:00
Ron Pinkas
59346e6bf8 2001-05-23 21:15 UTC-0800 Ron Pinkas <ron@profit-master.com>
* include/hbclass.ch
     ! Corrected few minor typos.

   * source/compiler/harbour.slx
   * source/macro/macro.slx
     - Commented few unused lines.

   * contrib/dot/pp.prg
     % Rewrote NextToken() and NextExp().
     + Added NextIdentifier()
     ! Found that Clipper PP is not processing tokens read by NextToken() and NextExp() so removed recursive support,
       and changed logic in ProcessLine() to linear process:
         #defines against all valid Identifiers - Expansion forces a resacn from top.
         #[x]translates against all tokens - Expansion forces a resacn from top of #defines.
         #[x]command agains the first token - Expansion forces a resacn from top of #defines.
     ! Corrected and refined many aspects of Interpreter mode.
     + Added ExecuteMethod() and support for OO syntax.
     + Added support for -I<includepaths...> command line switch.

   * contrib/dot/rp_run.ch
     + Added support for OO syntax.

   * contrib/dot/pp.txt
     * Updated documentation.
2001-05-24 04:52:09 +00:00
Ron Pinkas
e9fda3ebb9 2001-05-04 17:10 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
   * contrib/dot/rp_run.ch
     ! Few corrections to Pre Processor, and Interpreter.

   * include/hbclass.ch
     + Added support for METHOD implementations without requiring the CLASS Clause.
     + Added support for METHOD implementations without requiring the "()" if no parameters needed.
2001-05-05 00:12:14 +00:00
Ron Pinkas
07ac000f2f 2001-05-01 02:35 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/rp_run.ch
   * contrib/dot/pp.prg
     % Optimozed and improved handling of IF [ELSEIF] [ELSE] ENDIF in Interpreter mode.
     % Optimozed and improved handling of DO CASE [CASE] [OTHERWISE] END[CASE] in Interpreter mode.
     + Added support for FOR [LOOP] [EXIT] NEXT to Interpreter mode.
     + Added support for [DO] WHILE [LOOP] [EXIT] END[DO] to Interpreter mode.
     + Added support for file statics to Interpreter mode.
     + Added supprt for Command-Line Parameters to Interpreter mode.
       /* PP "FileName Param1 ParamN" -r */

   * tests/stripem.prg
     ! Resolved missing Default() and ToChar()
2001-05-01 10:02:07 +00:00
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