2001-01-20 17:20 UTC-0800 Ron Pinkas <ron@profit-master.com>

* hb_slex.vc
     + Added -DSIMPLEX to CLIBFLAGS

   * source/compiler/genc.c
     * Minor correction.

   * utils/hbpp/hbpp.c
   * source/pp/pplib.c
   * include/hbcomp.h
   * source/compiler/harbour.c
     + Added hb_comp_iLinePRG and hb_comp_iLineINLINE

   * source/compiler/harbour.l
   * source/compiler/harbour.slx
   * source/compiler/hbgenerr.c
     + Added logic to disallow multiple HB_INLINE() per source line.

   * source/pp/ppcomp.c
   * source/pp/ppcore.c
   * source/pp/pragma.c
     * Corrected double spacing in PPO generation, and added #pragma BEGINDUMP to PPO.
This commit is contained in:
Ron Pinkas
2001-01-21 01:47:49 +00:00
parent 30d97cc683
commit d51b90e182
13 changed files with 111 additions and 13 deletions

View File

@@ -1,3 +1,26 @@
2001-01-20 17:20 UTC-0800 Ron Pinkas <ron@profit-master.com>
* hb_slex.vc
+ Added -DSIMPLEX to CLIBFLAGS
* source/compiler/genc.c
* Minor correction.
* utils/hbpp/hbpp.c
* source/pp/pplib.c
* include/hbcomp.h
* source/compiler/harbour.c
+ Added hb_comp_iLinePRG and hb_comp_iLineINLINE
* source/compiler/harbour.l
* source/compiler/harbour.slx
* source/compiler/hbgenerr.c
+ Added logic to disallow multiple HB_INLINE() per source line.
* source/pp/ppcomp.c
* source/pp/ppcore.c
* source/pp/pragma.c
* Corrected double spacing in PPO generation, and added #pragma BEGINDUMP to PPO.
2001-01-19 22:30 GMT -3 Luiz Rafael Culik <culik@sl.conex.net>
*utils/hbmake/hbmake.prg
*Added code to allow Old style -D switch
@@ -11,21 +34,21 @@
2001-01-18 22:41 GMT+1 JFL (Mafact) <jfl@mafact.com>
*harbour/hb_slex.vc
* added HBMAKE
* added HBMAKE
harbour/makefile.vc
* added HBMAKE
* added HBMAKE
2001-01-18 00:18 GMT+1 JFL (Mafact) <jfl@mafact.com>
*harbour/makefile.vc
* minor form adjustement
*harbour/include/hbclass.ch
* Clean the ::Class reference wich does'nt work
* Clean the ::Class reference wich does'nt work
*harbour/source/debug/dbgtmenu.prg
* Adding a blank line at the end of file to test Simplex and VC++
*harbour/source/rtl/tclass.prg
* Clean the ::Class reference wich does'nt work
* Clean the ::Class reference wich does'nt work
*harbour/source/rtl/tobject.prg
* Clean the ::Class reference wich does'nt work
* Clean the ::Class reference wich does'nt work
@@ -52,7 +75,7 @@
*include/hbapi.h
*modified union in 'asRefer' structure
*source/vm/codebloc.c
*source/vm/hvm.c
*source/vm/itemapi.c

View File

@@ -85,7 +85,7 @@ HBPDF_DIR = contrib\pdflib
AS = masm
CFLAGS = -I$(INCLUDE_DIR) -TP -W3 -nologo $(C_USR) $(CFLAGS)
CLIBFLAGS = -c $(CFLAGS) $(CLIBFLAGS)
CLIBFLAGS = -c $(CFLAGS) $(CLIBFLAGS) -DSIMPLEX
CLIBFLAGSDEBUG = -Zi $(CLIBFLAGS)
!ifdef PDF
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS) -dPDF

View File

@@ -466,7 +466,9 @@ extern BOOL hb_comp_bAutoOpen;
extern BOOL hb_comp_bError;
extern char hb_comp_cInlineID;
extern INLINES hb_comp_inlines;
extern INLINES hb_comp_inlines;
extern int hb_comp_iLineINLINE;
extern int hb_comp_iLinePRG;
/* /GC command line setting types */
#define HB_COMPGENC_COMPACT 0

View File

@@ -232,7 +232,7 @@ void hb_compGenCCode( PHB_FNAME pFileName ) /* generates the C language ou
/* Generate codeblocks data
*/
if( hb_comp_cInlineID )
if( hb_comp_cInlineID > '0' )
{
fprintf( yyc, "#include \"hbapi.h\"\n" );
}

View File

@@ -132,6 +132,8 @@ BOOL hb_comp_bAutoOpen = TRUE;
BOOL hb_comp_bError = FALSE;
char hb_comp_cInlineID = '0';
int hb_comp_iLineINLINE = 0;
int hb_comp_iLinePRG;
INLINES hb_comp_inlines;
/* EXTERNAL statement can be placed into any place in a function - this flag is

View File

@@ -761,6 +761,16 @@ Separator {SpaceTab}
%}
"hb_inline" {
/* NOTE: hb_compiLineINLINE is being RESET in ppcomp.c - hb_pp_Internal() */
if( hb_comp_iLineINLINE )
{
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_TOOMANY_INLINE, "on the same line", NULL );
return IDENTIFIER;
}
else
{
#define INLINE_NORMAL 0
#define INLINE_SINGLE_QUOT 1
#define INLINE_DOUBLE_QUOT 2
@@ -771,6 +781,7 @@ Separator {SpaceTab}
extern BOOL hb_pp_bInline;
PINLINE pInline;
hb_comp_iLineINLINE = hb_comp_iLine;
hb_pp_bInline = TRUE;
sInlineSym[10] = hb_comp_cInlineID++;
@@ -898,11 +909,14 @@ Separator {SpaceTab}
hb_xfree( ( void * ) pInline ); /* NOTE: szName will be released by hb_compSymbolKill() */
}
hb_comp_iLinePRG = hb_comp_iLine - 1;
hb_comp_iLine = hb_comp_iLineINLINE;
yylval.string = hb_compIdentifierNew( sInlineSym, TRUE );
return IDENTIFIER;
}
}
}
}
%{
/* ************************************************************************ */
%}

View File

@@ -1001,6 +1001,16 @@ int hb_comp_SLX_CustomAction( int x, int aiHold[], int *ptr_iHold, BOOL *ptr_bIg
return IDENTIFIER;
case HB_INLINE :
/* NOTE: hb_compiLineINLINE is being RESET in ppcomp.c - hb_pp_Internal() */
if( hb_comp_iLineINLINE )
{
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_TOOMANY_INLINE, "on the same line", NULL );
iIdentifier++;
return IDENTIFIER + DONT_REDUCE;
}
else
{
#define INLINE_NORMAL 0
#define INLINE_SINGLE_QUOT 1
@@ -1012,6 +1022,7 @@ int hb_comp_SLX_CustomAction( int x, int aiHold[], int *ptr_iHold, BOOL *ptr_bIg
extern BOOL hb_pp_bInline;
PINLINE pInline;
hb_comp_iLineINLINE = hb_comp_iLine;
hb_pp_bInline = TRUE;
sInlineSym[10] = hb_comp_cInlineID++;
@@ -1139,6 +1150,9 @@ int hb_comp_SLX_CustomAction( int x, int aiHold[], int *ptr_iHold, BOOL *ptr_bIg
hb_xfree( ( void * ) pInline ); /* NOTE: szName will be released by hb_compSymbolKill() */
}
hb_comp_iLinePRG = hb_comp_iLine;
hb_comp_iLine = hb_comp_iLineINLINE;
yylval.string = hb_compIdentifierNew( sInlineSym, TRUE );
iIdentifier++;
DEBUG_INFO( printf( "INLINE, Primary Identifier %s Increased to: %i\n", "INLINE", iIdentifier ) );

View File

@@ -89,7 +89,7 @@ char * hb_comp_szErrors[] =
"Code block contains both macro and declared symbol references",
"GET contains complex macro",
"Unterminated inline block in function: \'%s\'",
"Too many inline blocks",
"Too many inline blocks %s",
"Inline C requires C output generation, use -gc[n]"
};

View File

@@ -53,7 +53,7 @@ BOOL hb_pp_bInline = FALSE;
static char s_szLine[ HB_PP_STR_SIZE ];
static char s_szOutLine[ HB_PP_STR_SIZE ];
static int hb_pp_LastOutLine = 1;
int hb_pp_LastOutLine = 1;
/*
BOOL bDebug = FALSE;
@@ -147,10 +147,12 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
{
if( hb_pp_nCondCompile == 0 || hb_pp_aCondCompile[ hb_pp_nCondCompile - 1 ] )
{
/* Ron Pinkas removed 2001-01-20
if( ( hb_pp_LastOutLine < hb_comp_iLine - 1 ) && hb_comp_files.iFiles == 1 && handl_o )
for( ; hb_pp_LastOutLine < hb_comp_iLine-1; hb_pp_LastOutLine++ )
hb_pp_WrStr( handl_o, "\n" );
hb_pp_LastOutLine = hb_comp_iLine;
*/
hb_pp_ParseExpression( ptr, s_szOutLine );
}
else
@@ -207,10 +209,14 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
{
/* Ron Pinkas added 2000-06-13 */
/* Ignore empty lines in #included files. */
/* Ron Pinkas removed 2001-01-20 */
#if 0
if( ( hb_pp_LastOutLine != hb_comp_iLine ) && hb_comp_files.iFiles == 1 && handl_o )
/* Ron Pinkas end 2000-06-13 */
for( ; hb_pp_LastOutLine < hb_comp_iLine; hb_pp_LastOutLine++ )
hb_pp_WrStr( handl_o, "\n" );
#endif
/* END Ron Pinkas removed 2001-01-20 */
}
lens = hb_pp_strocpy( ptrOut, s_szLine ) + ( ptrOut - sOut );
@@ -218,8 +224,19 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
*( sOut + lens++ ) = '\n';
*( sOut + lens ) = '\0';
if( hb_comp_iLineINLINE && hb_pp_bInline == 0 )
{
hb_comp_iLine = hb_comp_iLinePRG + ( hb_comp_iLine - hb_comp_iLineINLINE );
#ifndef SIMPLEX
hb_comp_iLine++;
#endif
hb_comp_iLineINLINE = 0;
}
if( handl_o )
{
hb_pp_WrStr( handl_o, sOut );
}
#if 0
printf( "%d : %s\n", hb_comp_iLine, sOut );

View File

@@ -2852,13 +2852,29 @@ int hb_pp_RdStr( FILE * handl_i, char * buffer, int maxlen, BOOL lDropSpaces, ch
int hb_pp_WrStr( FILE * handl_o, char * buffer )
{
extern int hb_pp_LastOutLine;
int lens = strlen(buffer);
HB_TRACE(HB_TR_DEBUG, ("hb_pp_WrStr(%p, %s)", handl_o, buffer));
/* Ron Pinkas added 2001-01-20 */
if( hb_comp_files.iFiles == 1 )
{
for( ; hb_pp_LastOutLine < hb_comp_iLine - 1; hb_pp_LastOutLine++ )
{
fwrite("\n",1,1,handl_o);
}
hb_pp_LastOutLine = hb_comp_iLine;
}
/* END Ron Pinkas added 2001-01-20 */
fwrite(buffer,lens,1,handl_o);
if( *(buffer+lens-1) != '\n' )
{
fwrite("\n",1,1,handl_o);
}
return 0;
}

View File

@@ -56,6 +56,8 @@ PATHNAMES * hb_comp_pIncludePath = NULL;
PHB_FNAME hb_comp_pFileName = NULL;
FILES hb_comp_files;
int hb_comp_iLine; /* currently parsed file line number */
int hb_comp_iLinePRG;
int hb_comp_iLineINLINE = 0;
/* These are need for the PP #pragma support */
BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */

View File

@@ -176,6 +176,11 @@ void hb_pp_ParsePragma( char * szLine )
extern BOOL hb_pp_bInline;
PINLINE pInline;
if( hb_comp_bPPO )
{
hb_pp_WrStr( hb_comp_yyppo, "#pragma BEGINDUMP" );
}
hb_pp_bInline = TRUE;
pInline = hb_compInlineAdd( NULL );

View File

@@ -80,6 +80,9 @@ BOOL hb_comp_bDebugInfo = FALSE; /* holds if generate debugger re
int hb_comp_iExitLevel = HB_EXITLEVEL_DEFAULT; /* holds if there was any warning during the compilation process */
FILE *hb_comp_yyppo = NULL;
int hb_comp_iLinePRG;
int hb_comp_iLineINLINE = 0;
int main( int argc, char * argv[] )
{
FILE * handl_o;