20000520-21:30 GMT-8 Ron Pinkas <Ron@Profit-Master.com>

* include/hbvmpub.h
     + Added: #define HB_FS_FIRST    ( ( HB_SYMBOLSCOPE ) 0x40 )

   * source/compiler/genc.c
     + Added logic to add | HB_FS_FIRST to first defined symbol in a prg.

   * source/vm/hvm.c
     * Modified hb_vmProcessSymbols() to llok for HB_FS_FIRST for startup procedure instead of any first symbol.

   * source/compiler/harbour.y
     * Minor consilidation in AsType
       *** I am aware of 6 reduce conflicts resulting from previous removal of FROM_CLASS, and am looking into it. ***

   * tests/testwarn.prg
     ! Corrected the #translate to reflect latest syntax
This commit is contained in:
Ron Pinkas
2000-05-21 04:55:06 +00:00
parent 2a97599b58
commit 8e184f78a4
6 changed files with 42 additions and 17 deletions

View File

@@ -1,3 +1,21 @@
20000520-21:30 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* include/hbvmpub.h
+ Added: #define HB_FS_FIRST ( ( HB_SYMBOLSCOPE ) 0x40 )
* source/compiler/genc.c
+ Added logic to add | HB_FS_FIRST to first defined symbol in a prg.
* source/vm/hvm.c
* Modified hb_vmProcessSymbols() to llok for HB_FS_FIRST for startup procedure instead of any first symbol.
* source/compiler/harbour.y
* Minor consilidation in AsType
*** I am aware of 6 reduce conflicts resulting from previous removal of FROM_CLASS, and am looking into it. ***
* tests/testwarn.prg
! Corrected the #translate to reflect latest syntax
20000521-00:37 DST Paul Tucker <ptucker@sympatico.ca>
* source/rtl/setkey.c
+ include "hbgtapi.h" - needed for proper c++ support

View File

@@ -79,6 +79,7 @@ typedef HB_DYNS_FUNC( PHB_DYNS_FUNC );
#define HB_FS_EXIT ( ( HB_SYMBOLSCOPE ) 0x10 )
#define HB_FS_INITEXIT ( HB_FS_INIT | HB_FS_EXIT )
#define HB_FS_MESSAGE ( ( HB_SYMBOLSCOPE ) 0x20 )
#define HB_FS_FIRST ( ( HB_SYMBOLSCOPE ) 0x40 )
#define HB_FS_MEMVAR ( ( HB_SYMBOLSCOPE ) 0x80 )
extern void hb_vmExecute( const BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */

View File

@@ -153,6 +153,15 @@ void hb_compGenCCode( PHB_FNAME pFileName ) /* generates the C language ou
if( ( pSym->cScope != HB_FS_MESSAGE ) && ( pSym->cScope & HB_FS_MESSAGE ) ) /* only for non public symbols */
fprintf( yyc, " | HB_FS_MESSAGE" );
if( hb_comp_bStartProc )
{
if( strcmp( pSym->szName, hb_comp_functions.pFirst->szName ) == 0 )
fprintf( yyc, " | HB_FS_FIRST" );
}
else if( hb_comp_functions.pFirst->pNext )
if( strcmp( pSym->szName, hb_comp_functions.pFirst->pNext->szName ) == 0 )
fprintf( yyc, " | HB_FS_FIRST" );
/* specify the function address if it is a defined function or an
external called function */
if( hb_compFunctionFind( pSym->szName ) ) /* is it a function defined in this module */

View File

@@ -286,14 +286,7 @@ AsType : /* not specified */ { hb_comp_cVarType = ' '; }
| AS_OBJECT { hb_comp_cVarType = 'O'; }
| AS_OBJECT IdentName { hb_comp_cVarType = 'S'; hb_comp_szFromClass = $2 }
| AS_VARIANT { hb_comp_cVarType = ' '; }
| AS_NUMERIC_ARRAY { hb_comp_cVarType = 'n'; }
| AS_CHARACTER_ARRAY { hb_comp_cVarType = 'c'; }
| AS_DATE_ARRAY { hb_comp_cVarType = 'd'; }
| AS_LOGICAL_ARRAY { hb_comp_cVarType = 'l'; }
| AS_ARRAY_ARRAY { hb_comp_cVarType = 'a'; }
| AS_BLOCK_ARRAY { hb_comp_cVarType = 'b'; }
| AS_OBJECT_ARRAY { hb_comp_cVarType = 'o'; }
| AS_OBJECT_ARRAY IdentName { hb_comp_cVarType = 's'; hb_comp_szFromClass = $2 }
| AsArray
;
AsArray : AS_ARRAY { hb_comp_cVarType = 'A'; }
@@ -304,6 +297,7 @@ AsArray : AS_ARRAY { hb_comp_cVarType = 'A'; }
| AS_ARRAY_ARRAY { hb_comp_cVarType = 'a'; }
| AS_BLOCK_ARRAY { hb_comp_cVarType = 'b'; }
| AS_OBJECT_ARRAY { hb_comp_cVarType = 'o'; }
| AS_OBJECT_ARRAY IdentName { hb_comp_cVarType = 's'; hb_comp_szFromClass = $2 }
;
ParamList : IdentName AsType { hb_compVariableAdd( $1, hb_comp_cVarType ); $$ = 1; }

View File

@@ -2402,7 +2402,7 @@ static void hb_vmArrayPush( void )
{
if( pArray->item.asArray.value->uiHolders > 1 )
{
/* this is a temporary copy of an array - we can overwrite
/* this is a temporary copy of an array - we can overwrite
* it with no problem
*/
hb_arrayGet( pArray, ulIndex, pArray );
@@ -4067,7 +4067,7 @@ void hb_vmProcessSymbols( PHB_SYMB pModuleSymbols, USHORT uiModuleSymbols ) /* m
hSymScope = ( pModuleSymbols + ui )->cScope;
pNewSymbols->hScope |= hSymScope;
if( ( ! s_pSymStart ) && ( hSymScope == HB_FS_PUBLIC ) )
if( ( ! s_pSymStart ) && ( hSymScope & HB_FS_FIRST ) )
s_pSymStart = pModuleSymbols + ui; /* first public defined symbol to start execution */
if( ( hSymScope == HB_FS_PUBLIC ) || ( hSymScope & ( HB_FS_MESSAGE | HB_FS_MEMVAR ) ) )

View File

@@ -37,16 +37,19 @@
#TRANSLATE AS DATE =>
#TRANSLATE AS ARRAY =>
#TRANSLATE AS BLOCK =>
#TRANSLATE AS OBJ =>
#TRANSLATE AS OBJECT =>
#TRANSLATE AS BOOL =>
#TRANSLATE AS BOOLEAN =>
#TRANSLATE AS LOG =>
#TRANSLATE AS LOGICAL =>
#TRANSLATE AS VAR =>
#TRANSLATE AS VARIANT =>
#COMMAND DECLARE FUNCTION <*x*> =>
#COMMAND DECLARE <*x*> =>
#endif
//DECLARE Function nMyFunc AS NUMERIC
@@ -70,15 +73,15 @@ DECLARE MyClass ;
nMyFunc( nVal As Num ) As Num ;
nMyFunc( nVal As Num ) As Num ;
cMyData ;
aInstances AS Array Of Object FROM CLASS MyClass ;
oNext( oInstance AS Object FROM CLASS MyClass ) As Object FROM CLASS MyClass
aInstances AS Array Of Object MyClass ;
oNext( oInstance AS Object MyClass ) As Object MyClass
DECLARE OtherClass ;
nMyFunc( nVal As Num ) As Num ;
nMyFunc( nVal As Num ) As Num ;
cMyData ;
aInstances AS Array Of Object FROM CLASS MyClass ;
oNext( oInstance AS Object FROM CLASS OtherClass ) As Object FROM CLASS MyClass
aInstances AS Array Of Object MyClass ;
oNext( oInstance AS Object OtherClass ) As Object MyClass
FIELD a AS CHAR
FIELD b AS CHAR
@@ -89,11 +92,11 @@ STATIC lGlobal AS LOGICAL
PROCEDURE THEMAIN( optional )
STATIC lStatic := 0, oMyObj As Object From CLASS WrongClass
STATIC lStatic := 0, oMyObj As Object WrongClass
LOCAL cVar AS CHAR := [declare function]
LOCAL a As Char, ob AS Object FROM CLASS MyClass, c AS Char, d AS Object FROM CLASS OtherClass
LOCAL a As Char, ob AS Object MyClass, c AS Char, d AS Object OtherClass
FIELD b AS NUM
USE TEMP