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.
This commit is contained in:
@@ -1,3 +1,25 @@
|
||||
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 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()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1409
harbour/contrib/dot/pp_harb.ch
Normal file
1409
harbour/contrib/dot/pp_harb.ch
Normal file
File diff suppressed because it is too large
Load Diff
35
harbour/contrib/dot/prgscrpt.prg
Normal file
35
harbour/contrib/dot/prgscrpt.prg
Normal file
@@ -0,0 +1,35 @@
|
||||
Procedure Main()
|
||||
|
||||
LOCAL aCompiledProcs := {}, nProcId := 0, sPPed
|
||||
|
||||
ErrorBlock( {|oErr| RP_Run_Err( oErr, aCompiledProcs ) } )
|
||||
|
||||
PP_RunInit()
|
||||
|
||||
sPPed := PP_PreProLine( "Proc Test" )
|
||||
PP_CompileLine( sPPed, 1, aCompiledProcs, NIL, @nProcId )
|
||||
|
||||
sPPed := PP_PreProLine( "Alert( 'Hello from embeded PP' )" )
|
||||
PP_CompileLine( sPPed, 2, aCompiledProcs, NIL, @nProcId )
|
||||
|
||||
sPPed := PP_PreProLine( "RETURN" )
|
||||
PP_CompileLine( sPPed, 3, aCompiledProcs, NIL, @nProcId )
|
||||
|
||||
PP_ExecuteProcedure( aCompiledProcs[1] )
|
||||
|
||||
// OR :
|
||||
|
||||
PP_RunInit()
|
||||
aCompiledProcs := {}; nProcId := 0
|
||||
|
||||
sPPed := PP_PreProLine( "Proc EmbededMain" )
|
||||
sPPed += ";" + PP_PreProLine( "Alert( EmbededTest() )" )
|
||||
sPPed += ";" + PP_PreProLine( "return " )
|
||||
sPPed += ";" + PP_PreProLine( "Proc EmbededTest" )
|
||||
sPPEd += ";" + PP_PreProLine( "return 'Hello Again'" )
|
||||
|
||||
PP_CompileLine( sPPed, 0, aCompiledProcs, NIL, @nProcId )
|
||||
TraceLog( nProcId )
|
||||
PP_ExecuteProcedure( aCompiledProcs[1] )
|
||||
|
||||
return
|
||||
@@ -11,7 +11,7 @@
|
||||
#COMMAND _HB_MEMBER <*x*> =>
|
||||
|
||||
#XTRANSLATE QSelf() => PP_Qself()
|
||||
#XTRANSLATE AddMethod( <MethodName>, @<FunName>(), <n> ) => AddInLine( <MethodName>, {|Self,p1,p2,p3,p4,p5,p6,p7,p8,p9| PP_QSelf(Self), ExecuteMethod( <"FunName">, p1,p2,p3,p4,p5,p6,p7,p8,p9 ) }, <n> )
|
||||
#XTRANSLATE AddMethod( <MethodName>, @<FunName>(), <n> ) => AddInLine( <MethodName>, {|Self,p1,p2,p3,p4,p5,p6,p7,p8,p9| PP_QSelf(Self), PP_ExecMethod( <"FunName">, p1,p2,p3,p4,p5,p6,p7,p8,p9 ) }, <n> )
|
||||
#TRANSLATE :: => Self:
|
||||
|
||||
#COMMAND MEMVAR <*x*> =>
|
||||
|
||||
Reference in New Issue
Block a user