* 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.
* 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
* 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. */
* 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.
* 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
*/
* 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
* 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... */
* 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" )
* 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.
* 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)
* 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.
* 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. */
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.
* 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).
* 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. */
* 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). */
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.