* source/compiler/hbpcode.c
* Corrected 1 compiler warning.
* source/pp/ppcomp.c
* Cleaned-up and corrected bug when rules files had an #include directive.
+ Added CloseInclude() and moved relevant logic into it.
* source/pp/ppcore.c
- Removed unused s_iIncludes, and hb_pp_nEmptyStrings
* utils/hbpp/hbpp.c
+ Added local hb_pp_nEmptyStrings to hb_pp_Parse()
* include/hbcomp.h
* source/compiler/harbour.c
+ Added: char hb_comp_cCastType
* source/compiler/harbour.y
! Optimized AsType
+ Added: support for type casting like: Var := FunCal() AS ... and, return Var AS ...
/* Todo: add support for Array[n] := ... AS ..., and oVar:Data := ... AS ... */
* source/compiler/hbpcode.c
+ Added type casting support to:
HB_P_POPLOCAL
HB_P_POPLOCALNEAR
HB_P_POPMEMVAR
HB_P_POPSTATIC
HB_P_RETVALUE
* include/hbclass.ch
+ Added type casting to resolve Strong Type warnings:
return s_oClass:Instance() AS CLASS _CLASS_NAME_
local Self AS CLASS <ClassName> := QSelf() AS CLASS <ClassName>
/* Note: Strong Type code, and Class code, should compile with upto -w4, without [invalid] Strong Type warnings. */
* hb_slex.bc
* Synchronized with makefile.bc
* include/hbclass.ch
+ Added: [AS <type>] optional clause to all Methods/Messages syntax.
+ Added directives to generate class declaration from same class creation code.
* include/hbcomp.h
* source/compiler/harbour.c
+ Added: char hb_comp_cDataListType;
* source/compiler/harbour.l
+ Added support for new _HB_CLASS and _HB_MEMBER alternate class declaration syntax.
* source/macro/macro.slx
! Moved .T., .Y., .F., and, .N. from self contained words to words.
* source/compiler/harbour.slx
! Moved .T., .Y., .F., and, .N. from self contained words to words.
+ Added support for new _HB_CLASS and _HB_MEMBER alternate class declaration syntax.
* source/compiler/harbour.y
! Improved definition of formal and optional paramter lists.
+ Added support for alternate class declaration syntax:
_HB_CLASS ClassName
_HB_MEMBER { [AS ...] Var1, VarN }
_HB_MEMBER MethodName( [ [OPTIONAL] [@]FormalParam [AS ...] | @FunPointer() ] ) [ AS ... ]
/* This syntax allows the class declaration to be on multiple seperated lines (needed to allow utilization of class creation code.)
Tokens _HB_CLASS & _HB_MEMBER are not final, until some discussion with Ryszard. */
* source/compiler/hbpcode.c
* Completed classes strong type support for adaptive type variable.
* source/rtl/tlabel.prg
* source/rtl/treport.prg
! Corrected typos: AS {} -> INIT {} AS ARRAY, AS .T. -> INIT .T. AS LOGICAL etc..
* tests/testdecl.prg
* Changed to demonstrate class creation used as declaration.
* utils/hbtest/hbtest.prg
* Changed DBFNTX -> DBFCDX (was not working because DBFNTX is disabled.
* source/compiler/harbour.c
* source/compiler/harbour.y
+ Added support for DECLARE FunName(...) AS CLASS ClassName
+ Added support for DECLARE FunName( ... @SomeFun() ... ) - Function Pointer declared parameter.
* source/compiler/simplex.c
* Corrected some compiler warnings.
* source/compiler/harbour.slx
* Reenabled support for ID_ON_HOLD.
* include/hberror.h
+ Added: #define HB_COMP_WARN_RETURN_SUSPECT 28
* source/compiler/hbgenerr.c
+ Added: "4Suspecious return type: \'%s\' expected: \'%s\'"
* source/compiler/hbpcode.c
+ Completed support for Strong Typed variables as declared classes, as well as Adaptive Typed usage with declared classes.
* Few other corrections and enhancements.
* include/hbclass.ch
+ Added TClass declaration:
DECLARE TClass ;
New( cName AS STRING, OPTIONAL SuperParams ) AS CLASS TClass ;
Create() AS OBJECT;
Instance() AS OBJECT ;
AddClsMthds( cName AS STRING, @Method(), nScope AS NUMERIC, n2 AS NUMERIC, n3 AS NUMERIC );
AddMultiClsData( cType AS STRING, uVal, nScope AS NUMERIC, aDatas AS ARRAY OF STRING );
AddMultiData( cType AS STRING, uVal, nScope AS NUMERIC, aDatas AS ARRAY OF STRING );
AddMethod( cName AS STRING, @Method(), nScope AS NUMERIC );
AddInLine( cName AS STRING, bBlock AS CODEBLOCK, nScope AS NUMERIC );
AddVirtual( cName AS STRING )
+ Added declaration to s_oClass AS CLASS TClass
* tests/testdecl.prg
* Minor refinement.
* source/compiler/harbour.slx
* Changed VARIANT to ANYTYPE as it appear to be the prefered choice.
* source/compiler/hbpcode.c
* Changed \[ to [ to correct compiler warnings.
* Changed Usual. to AnyType.
* source/compiler/hbpcode.c
! Fixed ambigious else in hb_StrongType()
* source/pp/pptable.c
! Fixed STRUCTURE rule to allow nesting of structures.
* tests/teststru.prg
* Enhanced to demonstrate Structure as element of other structure and self reference capabilities.
* source/compiler/harbour.l
+ Added "as structure", "as stru", "as array of structure", "as array of stru"
* source/compiler/hbpcode.c
* Improved some logic in hb_StrongType()
* source/vm/hvm.c
! Corrected startup symbol when having to use Main() as per Ryszard.
* source/pp/pptable.c
+ Added the equivalent of:
#COMMANDS STRUCTURE <StruName> <Var1> AS <Type1> [, <VarN> AS <TypeN> ] => ;
STATIC __<StruName> := {|| IF( __<StruName> == NIL, , ) , HB_Structure( <"StruName">, { <"Var1"> [, <"VarN">] } )} ;;
DECLARE <StruName> <Var1> AS <Type1> [ <VarN> AS <TypeN> ] ;;
#TRANSLATE AS NEW <ClassName> => AS CLASS <StruName> := ( Eval( __<StruName> ), HB_Structure( <StruName> ) )
#TRANSLATE AS NEW <ClassName> => AS CLASS <ClassName> := <ClassName>():New()
* source/rtl/tclass.prg
+ Added Function HB_Structure() ( Fully Declared! ) This function is used internally, but may be freely called from Clipper level.
It Aceepts Parameter 1 Structure Name, and optional parameter 2, as array of structure variable names.
If called with 2nd parameter, returns NIL (just creates the new Structure), if called with just parameter 1, it returns
new instance of defined structure.
+ tests\teststru.prg
+ Added demo for new structure syntax
* include/hbcomp.h
+ Added member pParamClasses to COMDECLARED
* Changed hb_comp_szClass to hb_comp_szFromClass
* source/compiler/harbour.y
* Changed hb_comp_szClass to hb_comp_szFromClass
* source/compiler/harbour.c
+ Added support for declared parameters of Functions/Methods AS Object FROM CLASS ...
* source/compiler/hbpcode.c
+ Added Strong Type checking for declared parameters of Functions/Methods AS Object FROM CLASS ...
* tests/testwarn.prg
+ Added code to demonstrate warnings for declared parameters of Functions/Methods AS Object FROM CLASS ...
* source/compiler/harbour.y
* source/compiler/harbour.c
* source/compiler/hbpcode.c
+ Added support for AS Array Of Objects FROM CLASS ClassName syntax and type checking.
* tests/testwarn.prg
+ Added code to demonstrate syntax and warnings for AS Array Of Objects FROM CLASS ClassName syntax and type checking.
* include/hbcomp.h
! Consoldated COMDECLARED and COMMETHOD into COMDECLARED
+ Added member pClass to COMDECLARED
+ Added member pLast to COMCLASS
* source/compiler/harbour.y
+ Added support for Methods/Datas of type Object of a declared Class.
* source/compiler/harbour.c
! Fixed bug in hb_compMethodAdd()
* source/compiler/hbpcode.c
+ Added Strong Type Checking to Objects syntax.
* include/hberrors.h
+ Added : "HB_COMP_WARN_MESSAGE_NOT_FOUND"
* source/compiler/hbgenerr.c
+ Added : "3Message \'%s\' not known in Class \'%s\'"
* tests/testwarn.prg
+ Added code to demonstrate syntax and warnings for OO Strong Type Checking.
* include/hbcomp.h
+ Added new structures COMCLASS and COMMETHOD
+ Added new element pClass to structure VAR
+ Added:
extern PCOMCLASS hb_compClassAdd( char * );
extern PCOMCLASS hb_compClassFind( char * );
extern PCOMMETHOD hb_compMethodAdd( PCOMCLASS pClass, char * );
extern PCOMMETHOD hb_compMethodFind( PCOMCLASS pClass, char * );
* source/compiler/harbour.c
+ Added:
PCOMCLASS hb_compClassAdd( char * );
PCOMCLASS hb_compClassFind( char * );
PCOMMETHOD hb_compMethodAdd( PCOMCLASS pClass, char * );
PCOMMETHOD hb_compMethodFind( PCOMCLASS pClass, char * );
* Modified hb_compVariableAdd() to process params of declared class methods.
* source/compiler/harbour.l
+ Added tokens CLASSMETHOD CLASSDATA and FROMCLASS
* source/compiler/harbour.y
+ Added support for class declaration syntax:
DECLARE CLASS ClassName HAS Method MethodName( ... ) As ... HAS Data PropertyName ...
+ Added support for declaration of Object of a sdeclared class sysntax:
DECLARE oObjectVar AS Object FROM ClassName
* source/compiler/hbpcode.c
+ Started support for object methods and properties type checking.
* tests/testwarn.prg
+ Added code to demonstrate declarion of classes and objects of a declared class.
* source/compiler/harbour.l
- Removed un used token DECLARE_
* source/compiler/harbour.y
! Fixed warning about conflict
! Verified all calls to hb_compVariableAdd() to use hb_comp_cVarType (and VT_OFFSET_* constants) as 2nd parameter
+ Added rules to support syntax of declartion of variable by reference parameter.
* include/hbcomp.h
+ Added :
#define VT_OFFSET_BYREF 60
#define VT_OFFSET_VARIANT 90
#define VT_OFFSET_OPTIONAL 90
* source/compiler/harbour.c
* Minor cleanup in hb_compVariableAdd()
* source/compiler/hbpcode.c
* Modified hb_compStrongType() to use VT_OFFSET_* constants.
* source/compiler/hbgenerr.c
* Changed "number" to "#" in HB_COMP_WARN_PARAM_TYPE message.
* tests/testwarn.prg
+ Added code to demonstrate new "Declared Refernced Paramater" syntax:
DECLARE FRead( nHandle As Num, @cBufferVar As Char, nBytes As Num ) AS Num
* source/compiler/harbour.l
+ Added token "optional"
* source/compiler/harbour.y
+ Added token "optional", DecParam, DecParamList, OptParams.
+ Added support for optional parameters syntax in declared functions.
* source/compiler/harbour.c
+ Added logic in hb_compVariableAdd() to deal with optional parameters of declared functions.
* source/compiler/hbpcode.c
+ Added logic in hb_compStrongType() to deal with optional parameters of declared functions.
* tests/testwarn.prg
+ Added code to demonstrate usage and warnings of optional parameters in declared functions.
* include/hberrors.h
+ Added : #define HB_COMP_WARN_VAL_NOT_USED 20
* source/compiler/harbour.c
+ Added logic to hb_compOptimizeFrames() to warn about invalid statics usage.
* source/compiler/hbgenerr.c
+ Added: "3Value of Variable \'%s\' never used"
* source/compiler/hbpcode.c
* Enhanced support for statics
* tests/testwarn.prg
+ Added more code to demonstrate more warnings.
* include/hbpcomp.c
+ Added pPrivates to structure FUNCTION.
* source/compiler/harbour.c
+ Added logic to maintain linked list pPrivates of pFunc.
* source/compiler/harbour.y
+ Added support for MEMVAR AS ... syntax.
* source/compiler/hbpcode.c
+ Added support for FIELD AS ... and MEMVAR AS both local and global.
! More refinments
* tests/testwarn.prg
+ Added code to demonstrate "Adaptive Type Checking".
* include/hbcomp.h
+ Added #define VS_NONE 0
* source/compiler/harbour.c
! Fixed bug in hb_compVariableAdd() was never adding new var to pFunc->pMemvars because
hb_comp_iVarScope was tested with == rather & VS_MEMVAR
* source/compiler/harbour.y
+ Added hb_comp_iVarScope = VS_NONE to reset it after PRIVATE PUBLIC and PARAMETERS statements.
* source/compiler/hbpcode.c
+ Added logic to reset type of privates (need to check publics) after calls to functions or procedures which might affect them.
! Many fixes and consolodiations
* source/compiler/hbpcode.c
+ Added logic to hb_compStrongType() to support object methods and properties.
* Enhanced logic of array checks.
* include/hberrors.h
! Added #define HB_COMP_WARN_ARRAY_ASSIGN_SUSPECT
* source/compiler/hbgenerr.c
* Added : 4Suspicious type in assignment to declared array element expected: \'%s\'"
* source/compiler/hbpcode.c
+ Added logic to allow PLUS an MINUS to accept any type as long as same.
! Fixed compiler warning about pVar
* Minor optimizations
* source/compiler/harbour.c
- Removed static qualifier from hb_compVariableGetPos() so it can be called from hb_compStrongType()
* source/compiler/hbpcode.c
+ Added logic to hb_compStrongType() to allow assigment of NIL to any type variable.
+ Added "Adaptive Type Checking" to control type mismatch in undeclared variables.
* include/hberrors.h
! Added #define HB_COMP_ARRAY_ASSIGN_TYPE to HB_COMP_WARN_ARRAY_ASSIGN_TYPE
* source/compiler/hbgenerr.c
* Added : Moved "Suspecious ..." to level w4
* tests/testwarn.prg
+ Added code to demonstrate "Adaptive Type Checking".
* include/hbcomp.h
+ Added:
#define VU_NOT_USED 0
#define VU_INITIALIZED 1
#define VU_USED 2
* source/compiler/harbour.c
* Modified refrences to pVar->iUsed to use new VU_* constants.
* source/compiler/hbpcode.c
* Enhanced hb_compStrongType() to check and set pVar->iUsed with new VU_*constants.
* source/compiler/hbpcode.c
* Fixed hb_compStrongType() to difrentiate between a MEMVAR and a DECLARED FUNCTION with the same name.
+ Added support for HB_P_ARRAYPUSH
* source/compiler/hbgenerr.c
* Minor correction to "Incompatibe return type"
* tests/testwarn.prg
+ Added code to demonstrate more warnings.
* include/hbcomp.h
- Removed members cParamTypes and iParamCount from COMSYMBOL
+ Added member USHORT iStackSize to FUNCTION structure
* Modified member pStack of FUNCTION to not pre allocate any memory.
+ Added new structure COMDECLARED
+ Added: extern PCOMDECLARED hb_compDeclaredAdd( char * ) and extern PCOMDECLARED hb_compDeclaredFind( char * );
+ Adede: extern PCOMDECLARED hb_comp_pFirstDeclared and extern PCOMDECLARED hb_comp_pLastDeclared
* include/hberrors.h
+ Added:
#define HB_COMP_DUP_DECLARATION 17
#define HB_COMP_DECLARATION_CONFLICT 18
* source/compiler/genc.c
* Modified hb_compGenCCode() to free the Declared Function linked list.
* source/compiler/harbour.c
+ Added: PCOMDECLARED hb_compDeclaredAdd( char * ) and PCOMDECLARED hb_compDeclaredFind( char * );
+ Adede: PCOMDECLARED hb_comp_pFirstDeclared and PCOMDECLARED hb_comp_pLastDeclared
* source/compiler/harbour.y
* Modified parsing of DECLARE FUNCTION to use new PCOMDECLARED rather than PCOMSYMBOL
* source/compiler/hbgenerr.c
+ Added:
"3Duplicate Declaration of Function %s"
"3Function \'%s\' conflicting with its declaration"
* source/compiler/hbpcode.c
* Modifief hb_compStrongType() to utilize PCOMDECLARED rather than PCOMSYMBOL
* Modifief hb_compStrongType() to increase the pFunc->pStack as needed.
* tests/testwarn.prg
+ Added code to demonstrate more warnings.
* source/compiler/harbour.c
* Correction compiler warning about piShifts in hb_compOptimizeJumps().
* source/compiler/hbpcode.c
* Correction compiler warning about pSym in hb_compStrongType().
* source/compiler/harbour.c
* Minor correction to hb_compVariableAdd().
* source/compiler/hbpcode.c
* Enhancements to hb_compStrongType() to support new PUSH/POPALIASEDFIELDNEAR.
* tests/testwarn.prg
+ Added code to demonstrate more warnings.
* include/hbcomp.h
+ Added to COMSYMBOL :
BYTE * cParamTypes;
int iParamCount;
+ Added :
extern char * hb_comp_szDeclaredFun
* source/compiler/harbour.y
* Enhanced DECLARE FUNCTION parsing to properly maintain number and type of declared function parameters.
* source/compiler/harbour.c
+ Added char * hb_comp_szDeclaredFun
* Modified hb_compVariableAdd() to support dummy parameter vars in Function Decleration.
* source/compiler/hbpcode.c
* Enhancements to hb_compStrongType() to support parameter checks of declared function.
* tests/testwarn.prg
+ Added code to demonstrate more warnings.
* include/hberrors.h
+ Added :
#define HB_COMP_PARAM_COUNT 15
#define HB_COMP_PARAM_TYPE 16
* source/compiler/hbgenerr.c
+ added :
"3Invalid number of parameters: \'%s\' expected: \'%s\'"
"3Incompatible parameter # %s expected: \'%s\'"
* source/compiler/harbour.c
- Removed refrence to pFunc->iFunctionIndex.
* source/compiler/hbpcode.c
* Enhancements to hb_compStrongType()
* tests/testwarn.prg
+ Added code to demonstrate more warnings.
* include/hberrors.h
- Removed pFunctionCalls and iFunctionIndex members of _FUNC structure.
* harbour/source/compiler/harbour.c
! Fixed hb_compVariableAdd() to utilize parameter cValueType for Codeblock local variables, so that correct type is stored.
* harbour/source/compiler/harbour.y
! Fixed hb_compExprCBVarAdd( $<asExpr>0, $1, $2 ) to hb_compExprCBVarAdd( $<asExpr>0, $1, hb_comp_cVarType ) and
hb_compExprCBVarAdd( $<asExpr>0, $3, $4 ) to hb_compExprCBVarAdd( $<asExpr>0, $3, hb_comp_cVarType ) so that
correct type is passed.
+ Added hb_comp_cVarType = ' ' to reset declared type after BlockVar[s] PRIVATE and PUBLIC.
* harbour/source/compiler/hbpcode.c
* Minor corrections to hb_compStrongType()