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 )
This commit is contained in:
@@ -8,7 +8,13 @@
|
||||
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
* source/vm/memvars.c
|
||||
2002-01-19 06:11 UTC+0100 Ron Pinkas <ron@ronpinkas.com>
|
||||
2002-01-20 08:50 UTC+0800 Ron Pinkas <ron@ronpinkas.com>
|
||||
hb_vmArrayPop(), hb_vmPopLocal(), hb_vmPopStatic(), hb_memvarSetValue()
|
||||
* source/rdd/dbfntx/dbfntx1.c
|
||||
* Added support of DBOI_POSITION and DBOI_KEYCOUNT to ntxOrderInfo()
|
||||
and empty prototypes of hb_ntxTagKeyNo(), hb_ntxTagKeyCount()
|
||||
|
||||
2002-01-19 06:11 UTC+0800 Ron Pinkas <ron@ronpinkas.com>
|
||||
+ Added ChangeLog to the /contrib/apollo dir
|
||||
+ contrib/apollo/test/apollo.ch
|
||||
+ defines for function sx_SysProp
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,25 +1,54 @@
|
||||
Command line switches and syntax.
|
||||
|
||||
|
||||
PP filename[.ext] [-CCH] [-D<id>] [-D:E] [-D:M] [-D:P] [-H] [--help][-I<path>]
|
||||
[-P] [-R] [-STRICT] [-U[<ch-file>]]
|
||||
|
||||
-CCH = Generate a .cch file (compiled command header).
|
||||
-D<id> = #define <id>.
|
||||
-D:E = Show tracing information into the Expression Scanner.
|
||||
-D:M = Show tracing information into the Match Engine.
|
||||
-D:P = Show tracing information into the Output Generator.
|
||||
-H = Syntax and command line switches description.
|
||||
--help = Syntax and command line switches description.
|
||||
-I<path> = #include file search path(s) (';' seperated).
|
||||
-P = Generate .pp$ pre-processed output file.
|
||||
-R = Run filename as a script.
|
||||
-STRICT = Strict Clipper compatability (clone Clipper PreProcessor bugs).
|
||||
-U = Use command definitions set in <ch-file> (or none).
|
||||
|
||||
PP has 3 personalities which are tied tightly together.
|
||||
|
||||
1. What is supposed to be 100% Clipper compatible Pre-Processor. Executing
|
||||
PP followed by a source file name and the -P switch, will create
|
||||
<filename.pp$> which is the equivalent of the Clipper <filename.ppo> file.
|
||||
In this mode there are few optional switches.
|
||||
1. What is supposed to be 100% Clipper compatible Pre-Processor
|
||||
(with some extensions).
|
||||
|
||||
PP filename[.ext] [-U][-DM][-DE][-DP][-CCH]
|
||||
Executing PP followed by a source file name and the -P switch, will
|
||||
create <filename.pp$> which is the equivalent of the Clipper
|
||||
<filename.ppo> file.
|
||||
|
||||
-U = Don't load standard rules.
|
||||
-DM = Show tracing information into the Match Engine.
|
||||
-DE = Show tracing information into the Expression Scanner.
|
||||
-DP = Show tracing information into the Output Generator.
|
||||
-CCH = Generate a .cch file (compiled command header).
|
||||
This syntax is:
|
||||
|
||||
2. DOT prompt, which suppose to allow most of Harbour syntax. Please
|
||||
PP filename[.ext] -P
|
||||
|
||||
In this mode these are the optional command line switches.
|
||||
|
||||
-CCH = Generate a .cch file (compiled command header).
|
||||
-D<id> = #define <id>.
|
||||
-D:E = Show tracing information into the Expression Scanner.
|
||||
-D:M = Show tracing information into the Match Engine.
|
||||
-D:P = Show tracing information into the Output Generator.
|
||||
-I<path> = #include file search path(s) (';' seperated).
|
||||
-STRICT = Strict Clipper compatability (clone Clipper PreProcessor bugs).
|
||||
-U = Use command definitions set in <ch-file> (or none).
|
||||
|
||||
2. DOT prompt, which suppose to allow most of Clipper syntax. Please
|
||||
report any syntax you expect to work, but is not supported.
|
||||
|
||||
It does support IF [ELSE] [ELSEIF] ENDIF in DOT environment.
|
||||
|
||||
Executing PP with no source filename will start the DOT prompt mode. In
|
||||
this mode you can execute a single line at a time, by typing the line
|
||||
Executing PP with no source filename will start the DOT prompt mode.
|
||||
|
||||
In this mode you can execute a single line at a time, by typing the line
|
||||
and pressing the [Enter] key.
|
||||
|
||||
Additionally you may type:
|
||||
@@ -49,15 +78,28 @@ PP has 3 personalities which are tied tightly together.
|
||||
|
||||
This will create rp_dot.pp$ compilation trace file.
|
||||
|
||||
3. Finally, PP is a limited Harbour Interpreter. Subject to those same few
|
||||
limitations it can execute most of Harbour syntax. Executing PP followed
|
||||
by a source file name and the -R switch, will "RUN" that source (it will
|
||||
also create the rp_run.pp$ compilation trace file).
|
||||
3. Finally, PP is a limited Clipper/Harbour/xBase Interpreter. Subject
|
||||
to those same few limitations it can execute most of Harbour syntax.
|
||||
Executing PP followed by a source file name and the -R switch, will
|
||||
"RUN" that source (it will also create the rp_run.pp$ compilation
|
||||
trace file).
|
||||
|
||||
This syntax is:
|
||||
|
||||
PP filename[.ext] -R
|
||||
|
||||
In this mode these are the optional command line switches.
|
||||
|
||||
-CCH = Generate a .cch file (compiled command header).
|
||||
-D<id> = #define <id>.
|
||||
-D:E = Show tracing information into the Expression Scanner.
|
||||
-D:M = Show tracing information into the Match Engine.
|
||||
-D:P = Show tracing information into the Output Generator.
|
||||
-I<path> = #include file search path(s) (';' seperated).
|
||||
-P = Generate .pp$ pre-processed output file.
|
||||
-STRICT = Strict Clipper compatability (clone Clipper PreProcessor bugs).
|
||||
-U = Use command definitions set in <ch-file> (or none).
|
||||
|
||||
a. It does support LOCAL/STATIC/PRIVATE/PUBLIC, but:
|
||||
|
||||
- STATICs are actually implemented as publics.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Pre-Processor/Dot prompt environment
|
||||
* xBaseScript Project source code:
|
||||
* Pre-Processor / Dot prompt environment / Script Interpreter
|
||||
*
|
||||
* Copyright 2000 Ron Pinkas <ronpinkas@profit-master.com>
|
||||
* www - http://www.harbour-project.org
|
||||
* Copyright 2000-2001 Ron Pinkas <ronpinkas@profit-master.com>
|
||||
* www - http://www.xBaseScript.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -93,11 +93,15 @@ METHOD Compile()
|
||||
RETURN nProcId > 0
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#ifdef USE_C_BOOST
|
||||
|
||||
#pragma BEGINDUMP
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbfast.h"
|
||||
#include "hbstack.h"
|
||||
#include "hbapierr.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -122,14 +126,11 @@ static HB_FUNC( NEXTTOKEN )
|
||||
{
|
||||
PHB_ITEM pLine = hb_param( 1, HB_IT_STRING );
|
||||
PHB_ITEM pDontRecord = hb_param( 2, HB_IT_LOGICAL );
|
||||
|
||||
char *sLine, *pTmp;
|
||||
BOOL lDontRecord;
|
||||
|
||||
char sReturn[2048];
|
||||
size_t Counter, nLen;
|
||||
|
||||
char s2[3];
|
||||
BOOL lDontRecord;
|
||||
size_t Counter, nLen;
|
||||
|
||||
if( pLine == NULL || pLine->item.asString.length == 0 )
|
||||
{
|
||||
@@ -438,9 +439,7 @@ static HB_FUNC( NEXTTOKEN )
|
||||
}
|
||||
else
|
||||
{
|
||||
pTmp = hb_strdup( sLine );
|
||||
hb_itemPutC( pLine, pTmp );
|
||||
hb_xfree( pTmp );
|
||||
hb_itemPutCPtr( pLine, hb_strdup( sLine ), strlen( sLine ) );
|
||||
}
|
||||
//printf( "\nToken: '%s' value: '%s'\n", sReturn, pLine->item.asString.value );
|
||||
}
|
||||
@@ -449,6 +448,8 @@ static HB_FUNC( NEXTTOKEN )
|
||||
//printf( "\nToken: '%s' ***value: '%s'\n", sReturn, pLine->item.asString.value );
|
||||
}
|
||||
|
||||
//printf( "\nToken: '%s'\n", sReturn );
|
||||
|
||||
hb_retclen( sReturn, nLen );
|
||||
}
|
||||
|
||||
@@ -457,12 +458,10 @@ static HB_FUNC( NEXTIDENTIFIER )
|
||||
{
|
||||
PHB_ITEM pLine = hb_param( 1, HB_IT_STRING );
|
||||
PHB_ITEM pSkipped = hb_param( 2, HB_IT_ANY );
|
||||
|
||||
char *sLine;
|
||||
|
||||
char cChar, cLastChar = ' ';
|
||||
size_t nAt, nLen;
|
||||
int nStart = -1;
|
||||
char cChar, cLastChar = ' ';
|
||||
|
||||
if( pLine == NULL || pLine->item.asString.length == 0 )
|
||||
{
|
||||
@@ -556,13 +555,8 @@ static HB_FUNC( NEXTIDENTIFIER )
|
||||
}
|
||||
else
|
||||
{
|
||||
char *sSkipped = (char *) hb_xgrab( nStart + 1 );
|
||||
|
||||
strncpy( sSkipped, sLine, nStart );
|
||||
sSkipped[nStart]= '\0';
|
||||
hb_itemPutCL( pSkipped, sSkipped, nStart );
|
||||
//printf( "\nSkipped: '%s'\n", sSkipped );
|
||||
hb_xfree( sSkipped );
|
||||
hb_itemPutCL( pSkipped, sLine, nStart );
|
||||
//printf( "\nSkipped: '%s'\n", pSkipped->item.asString.value );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,17 +571,13 @@ static HB_FUNC( NEXTIDENTIFIER )
|
||||
|
||||
if( ISBYREF( 1 ) )
|
||||
{
|
||||
char *pTmp;
|
||||
|
||||
pTmp = hb_strdup( sLine + nAt );
|
||||
hb_itemPutC( pLine, pTmp );
|
||||
hb_xfree( pTmp );
|
||||
hb_itemPutCPtr( pLine, hb_strdup( sLine + nAt ), strlen( sLine + nAt ) );
|
||||
}
|
||||
|
||||
//printf( "\nIdentifier: '%s'\n", sIdentifier );
|
||||
|
||||
hb_retc( sIdentifier );
|
||||
hb_xfree( sIdentifier );
|
||||
hb_retcAdopt( sIdentifier );
|
||||
//hb_xfree( sIdentifier );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -595,8 +585,133 @@ static HB_FUNC( NEXTIDENTIFIER )
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
HB_FUNC( EXTRACTLEADINGWS )
|
||||
{
|
||||
PHB_ITEM pLine = hb_param( 1, HB_IT_STRING );
|
||||
size_t iLen, i = 0;
|
||||
char *pTmp;
|
||||
|
||||
if( pLine == NULL )
|
||||
{
|
||||
hb_retclen( "", 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
iLen = pLine->item.asString.length;
|
||||
|
||||
while( pLine->item.asString.value[i] == ' ' )
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
||||
if( i > 0 )
|
||||
{
|
||||
if( HB_IS_BYREF( hb_stackItemFromBase( 1 ) ) )
|
||||
{
|
||||
hb_itemPutCPtr( pLine, hb_strdup( pLine->item.asString.value + i ), iLen - i );
|
||||
}
|
||||
}
|
||||
|
||||
pTmp = ( char * ) hb_xgrab( i + 1 );
|
||||
memset( pTmp, ' ', i );
|
||||
|
||||
if( HB_IS_BYREF( hb_stackItemFromBase( 2 ) ) )
|
||||
{
|
||||
PHB_ITEM pWS = hb_itemUnRef( hb_stackItemFromBase( 2 ) );
|
||||
hb_itemPutCL( pWS, pTmp, i );
|
||||
}
|
||||
|
||||
hb_retclenAdopt( pTmp, i );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
HB_FUNC( DROPTRAILINGWS )
|
||||
{
|
||||
PHB_ITEM pLine = hb_param( 1, HB_IT_STRING );
|
||||
char *pString;
|
||||
size_t iLen, i;
|
||||
|
||||
if( pLine == NULL )
|
||||
{
|
||||
hb_retclen( "", 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
pString = hb_itemGetC( pLine );
|
||||
iLen = hb_itemGetCLen( pLine );
|
||||
|
||||
i = iLen - 1;
|
||||
|
||||
while( pString[i] == ' ' )
|
||||
{
|
||||
i--;
|
||||
}
|
||||
|
||||
if( ++i < iLen )
|
||||
{
|
||||
pString[i] = '\0';
|
||||
}
|
||||
|
||||
if( HB_IS_BYREF( hb_stackItemFromBase( 1 ) ) )
|
||||
{
|
||||
hb_itemPutCL( pLine, pString, i );
|
||||
}
|
||||
|
||||
if( HB_IS_BYREF( hb_stackItemFromBase( 2 ) ) )
|
||||
{
|
||||
PHB_ITEM pWS = hb_itemUnRef( hb_stackItemFromBase( 2 ) );
|
||||
char *pTmp = ( char * ) hb_xgrab( iLen - i + 1 );
|
||||
|
||||
memset( pTmp, ' ', iLen - i );
|
||||
hb_itemPutCPtr( pWS, pTmp, iLen - i );
|
||||
}
|
||||
|
||||
hb_retclenAdopt( pString, i );
|
||||
//hb_xfree( pString );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
HB_FUNC( DROPEXTRATRAILINGWS )
|
||||
{
|
||||
PHB_ITEM pLine = hb_param( 1, HB_IT_STRING );
|
||||
char *pString;
|
||||
size_t iLen, i;
|
||||
|
||||
if( pLine == NULL )
|
||||
{
|
||||
hb_retclen( "", 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
pString = hb_itemGetC( pLine );
|
||||
iLen = hb_itemGetCLen( pLine );
|
||||
|
||||
i = iLen - 1;
|
||||
|
||||
while( i > 1 && pString[i] == ' ' && pString[i - 1] == ' ' )
|
||||
{
|
||||
i--;
|
||||
}
|
||||
|
||||
if( ++i < iLen )
|
||||
{
|
||||
pString[i] = '\0';
|
||||
}
|
||||
|
||||
if( HB_IS_BYREF( hb_stackItemFromBase( 1 ) ) )
|
||||
{
|
||||
hb_itemPutCL( pLine, pString, i );
|
||||
}
|
||||
|
||||
hb_retclenAdopt( pString, i );
|
||||
//hb_xfree( pString );
|
||||
}
|
||||
|
||||
#pragma ENDDUMP
|
||||
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
#ifdef WIN
|
||||
|
||||
@@ -1527,4 +1642,4 @@ STATIC FUNCTION InitFWResults()
|
||||
|
||||
RETURN .T.
|
||||
|
||||
//--------------------------------------------------------------//
|
||||
//--------------------------------------------------------------//
|
||||
|
||||
Reference in New Issue
Block a user