19991121-22:38 GMT+1 Victor Szel <info@szelvesz.hu>

This commit is contained in:
Viktor Szakats
1999-11-21 21:50:31 +00:00
parent 72cd847d49
commit 8379afd78e
8 changed files with 568 additions and 553 deletions

View File

@@ -1,3 +1,16 @@
19991121-22:38 GMT+1 Victor Szel <info@szelvesz.hu>
* source/pp/*
source/compiler/harbour.c
include/hbpp.h
! static variables and functions marked static.
* Cleared up declarations, removed redundant declartions.
* Some formatting.
* source/pp/hbpp.c
! Some corrections made to better handle where the code launcher
returns to the caller. This is a theoretical case, but it's more
elegant to handle this case, and it would also help to avoid a jmp_buf
trick in the library callable version of the PP.
19991121-17:50 GMT+1 Bruno Cantero <bruno@issnet.net>
* include/rddapi.h
source/rdd/dbcmd.c

View File

@@ -74,36 +74,44 @@ typedef struct _COMMANDS
/* HBPP.C exported functions */
extern int ParseDirective( char * );
extern int ParseExpression( char *, char * );
extern int Hp_Parse( FILE *, FILE *, char * );
extern int ParseDirective( char * ); /* Parsing preprocessor directives ( #... ) */
extern int ParseExpression( char *, char * ); /* Parsing a line ( without preprocessor directive ) */
extern int pp_RdStr( FILE *, char *, int, int, char *, int *, int * );
extern int pp_WrStr( FILE *, char * );
extern int pp_strAt( char *, int, char *, int );
extern void pp_Stuff( char *, char *, int, int, int );
extern int strolen( char * );
extern int strocpy( char *, char * );
extern char * strodup( char * );
extern DEFINES * AddDefine( char * szDefine, char * szValue ); /* add a new Lex define from the command line */
extern DEFINES * AddDefine( char *, char * ); /* Add new #define to a linked list */
/* HBPPINT.C exported functions */
extern void Hbpp_init ( void );
extern int PreProcess( FILE *, FILE *, char * );
/* HBPP.C exported variables */
extern int lInclude;
extern int * aCondCompile, nCondCompile;
extern int * aCondCompile;
extern int nCondCompile;
extern int nline;
extern char * _szPErrors[];
extern char * _szPWarnings[];
/* TABLE.C exported variables */
extern DEFINES * topDefine;
extern COMMANDS * topCommand;
extern COMMANDS * topTranslate;
/* Needed support modules, but not contained in HBPP.C */
extern void * hb_xgrab( ULONG lSize ); /* allocates memory, exists on failure */
extern void * hb_xrealloc( void * pMem, ULONG lSize ); /* reallocates memory */
extern void hb_xfree( void * pMem ); /* frees memory */
/* Needed support variables, but not contained in HBPP.C */
extern DEFINES * topDefine;
extern COMMANDS * topCommand;
extern COMMANDS * topTranslate;
#include "compiler.h"
#endif /* HB_PP_H_ */

View File

@@ -60,9 +60,6 @@ typedef enum
extern int harbour_main( char *szName );
extern BOOL Include( char * szFileName, PATHNAMES * pSearchPath ); /* end #include support */
/* Following line added for preprocessor */
extern void Hbpp_init ( void );
/* output related functions */
extern void GenCCode( PHB_FNAME ); /* generates the C language output */
extern void GenJava( PHB_FNAME ); /* generates the Java language output */

File diff suppressed because it is too large Load Diff

View File

@@ -37,29 +37,25 @@
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#endif
#if ( defined(_MSC_VER) || defined(__IBMCPP__) || defined(__MINW32__) )
#include <memory.h>
#include <stdlib.h>
#include <memory.h>
#include <stdlib.h>
#elif ( defined(__GNUC__) || defined(__WATCOMC__) )
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#else
#include <alloc.h>
#include <mem.h>
#include <alloc.h>
#include <mem.h>
#endif
#include <stdio.h>
#include "hbpp.h"
#include "hberrors.h"
void Hbpp_init ( void );
int PreProcess( FILE *, FILE *, char * );
int Hp_Parse( FILE *, FILE *, char * );
int iBuffer, lenBuffer;
BOOL _bPPO = 0;
char sLine[ STR_SIZE ], sOutLine[ STR_SIZE ];

View File

@@ -37,9 +37,9 @@
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#endif
#include <stdio.h>

View File

@@ -37,20 +37,20 @@
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#endif
#include <stdlib.h>
#if ( defined(_MSC_VER) || defined(__IBMCPP__) || defined(__MINGW32__) )
#include <memory.h>
#include <memory.h>
#elif defined(__GNUC__)
#include <unistd.h>
#include <unistd.h>
#elif ! defined(__MPW__)
#include <malloc.h>
#include <malloc.h>
#else
#include <mem.h>
#include <mem.h>
#endif
#include <string.h>
#include <stdio.h>
@@ -59,12 +59,9 @@
#include "hberrors.h"
#include "hbver.h"
extern int pp_strAt( char *, int, char *, int );
extern void pp_Stuff( char *, char *, int, int, int );
int Hp_Parse( FILE *, FILE *, char * );
void OutTable( DEFINES *, COMMANDS * );
void AddSearchPath( char *, PATHNAMES * * ); /* add pathname to a search list */
static int Hp_Parse( FILE * handl_i, FILE * handl_o, char * szSource );
static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList );
static void OutTable( DEFINES * endDefine, COMMANDS * endCommand );
char sLine[ STR_SIZE ], sOutLine[ STR_SIZE ];
@@ -280,7 +277,7 @@ int Hp_Parse( FILE * handl_i, FILE * handl_o, char * szSource )
return 0;
}
void OutTable( DEFINES * endDefine, COMMANDS * endCommand )
static void OutTable( DEFINES * endDefine, COMMANDS * endCommand )
{
FILE *handl_o;
int ipos, len_mpatt, len_value;
@@ -332,7 +329,7 @@ void OutTable( DEFINES * endDefine, COMMANDS * endCommand )
stdef2 = stdef2->last;
num++;
}
fprintf( handl_o, "\n DEFINES *topDefine = " );
fprintf( handl_o, "\n DEFINES * topDefine = " );
if( num == 1 )
fprintf( handl_o, "NULL;" );
else
@@ -375,7 +372,7 @@ void OutTable( DEFINES * endDefine, COMMANDS * endCommand )
stcmd2 = stcmd2->last;
num++;
}
fprintf( handl_o, "\n COMMANDS *topCommand = " );
fprintf( handl_o, "\n COMMANDS * topCommand = " );
if( num == 1 )
fprintf( handl_o, "NULL;" );
else
@@ -427,7 +424,7 @@ void OutTable( DEFINES * endDefine, COMMANDS * endCommand )
stcmd2 = stcmd2->last;
num++;
}
fprintf( handl_o, "\n COMMANDS *topTranslate = " );
fprintf( handl_o, "\n COMMANDS * topTranslate = " );
if( num == 1 )
fprintf( handl_o, "NULL;" );
else
@@ -439,7 +436,7 @@ void OutTable( DEFINES * endDefine, COMMANDS * endCommand )
/*
* Function that adds specified path to the list of pathnames to search
*/
void AddSearchPath( char * szPath, PATHNAMES * * pSearchList )
static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList )
{
PATHNAMES * pPath = *pSearchList;

View File

@@ -37,9 +37,9 @@
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL
#endif
#endif
#include <stdio.h>
@@ -97,7 +97,7 @@
static DEFINES sD___50 = {"_SET_AUTORDER",NULL,-1,"46", &sD___49 };
static DEFINES sD___51 = {"_SET_AUTOSHARE",NULL,-1,"47", &sD___50 };
DEFINES *topDefine = &sD___51;
DEFINES * topDefine = &sD___51;
static COMMANDS sC___1 = {0,"NOTE","\1A30",NULL,NULL };
static COMMANDS sC___2 = {0,"DO","WHILE \1A00","while \1A00",&sC___1 };
@@ -389,5 +389,6 @@
static COMMANDS sC___238 = {0,"SET","ORDER TO TAG \1A40 [IN \1B40]","ordSetFocus( \1A30 [, \1B30] )",&sC___237 };
static COMMANDS sC___239 = {0,"SET","ORDER TO","ordSetFocus(0)",&sC___238 };
static COMMANDS sC___240 = {0,"ANNOUNCE","\1A10","procedure \1A00 ; return",&sC___239 };
COMMANDS *topCommand = &sC___240;
COMMANDS *topTranslate = NULL;
COMMANDS * topCommand = &sC___240;
COMMANDS * topTranslate = NULL;