* source/compiler/harbour.l
- Removed: not needed states
- Removed "class method" "class data"
+ Added rules for "declare""
* source/compiler/harbour.y
* Changed rules for DECLARE FUNCTION as per Ryszard suhhestion, New Sysntax is simply:
DECLARE FunName([...]) [As ...]
* Changed rules for DECLARE CLASS as per Ryszard suhhestion, New Sysntax is simply:
DECLARE ClassName MethodName([...]) [As ...] DataVar [As ...]
* source/compiler/harbour.c
! Minor correction to allow final declaration to override previous declaration of same function.
* tests/testwarn.prg
* Modified code to demonstrate syntax functions, classes and objects of a declared class declarations.
* source/compiler/harbour.y
+ Seperated the DECLARE... from Function, moved into a Declare, and Added Declare as type of Source.
! Added reset of hb_comp_iVarScope to DECLARE... to fix wrong "Statement not allowed outside of procedure or function"
* source/compiler/harbour.y
+ Seperated the DECLARE... from Function, moved into a Declare, and Added Declare as type of Source.
! Added reset of hb_comp_iVarScope to DECLARE... to fix wrong "Statement not allowed outside of procedure or function"
* source/compiler/hbgenerr.c
* Modified : "3Duplicate Declaration of %s \'%s\'" to accept 1st parameter type of redeclaration ( Function, Class, Method ).
* source/compiler/harbour.c
* Modified calls to hb_compGenWarning() to use additional parameter of redclaration type.
* source/compiler/harbour.l
! Fixed parse error when DO OPTIONAL WITH 1 or " or other non alpha charcaters
! Fixed parse error when FOR Var := OPTIONAL TO ...
* source/compiler/harbour.y
! Fixed GPF when using DECLARE CLASS and -w < 3
* source/compiler/harbour.c
! Fixed GPF when using DECLARE CLASS and -w < 3
* source/compiler/harbour.l
! Fixed parse error when DO OPTIONAL WITH ...
* Changed FROM to FROM CLASS in AS Obect FROM CLASS ... (fixed conflict of FROM with DO FROM ...)
* Changed AS ... ARRAY to AS ARRAY OF ...
* 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".