Commit Graph

493 Commits

Author SHA1 Message Date
Ron Pinkas
a3a61fd11d 2000-06-04 03:05 UTC-0800 Ron Pinkas <Ron@Profit-Master.com>
* include/hbcomp.h
     + Added: extern char *        hb_pp_STD_CH;

   * include/hbpp.h
     + Added: extern void hb_pp_SetRules( BOOL (*hb_compInclude)(char *, PATHNAMES * ) );

   * source/compiler/hbusage.c
   * source/compiler/harbour.c
   * source/compiler/cmdcheck.c
     + Added support for -u[FileName]
     - Removed TODO for -u

   * source/pp/ppcomp.c
     + Added hb_pp_ReadRules() - Logic to process directives from user supplied command defs.

   * source/pp/ppcore.c
     + Added hb_pp_SetRules() - Logic to use predefined rules, none, or user defined.

   * source/pp/pptable.c
     + Added hb_pp_Table() - Moved predefined rules into this function, to allow for conditional use.
2000-06-04 10:12:52 +00:00
Viktor Szakats
6be58420c8 2000-06-02 02:54 UTC+0100 Victor Szakats <info@szelvesz.hu> 2000-06-02 01:55:16 +00:00
Viktor Szakats
d13e8ab76f 2000-06-02 02:54 UTC+0100 Victor Szakats <info@szelvesz.hu> 2000-06-02 01:34:35 +00:00
Viktor Szakats
879a134ee1 2000-05-29 08:29 UTC+0100 Victor Szakats <info@szelvesz.hu> 2000-05-29 06:28:24 +00:00
Viktor Szakats
9217251a5a 2000-05-29 02:47 UTC+0100 Victor Szakats <info@szelvesz.hu> 2000-05-29 00:51:57 +00:00
Viktor Szakats
eb952f521c 2000-05-28 22:57 UTC+0100 Victor Szakats <info@szelvesz.hu> 2000-05-28 21:01:27 +00:00
Viktor Szakats
be81ee127d 2000-05-27 23:12 UTC+0100 Victor Szakats <info@szelvesz.hu> 2000-05-28 19:52:03 +00:00
Ron Pinkas
04837b2eaa 2000-05-22 10:40 UTC-800 Ron Pinkas <Ron@Profit-Master.com>
* include/hbvmpub.h
     * Modified HB_FS_FIRST to  ( ( HB_SYMBOLSCOPE ) 0x04 )

   * source/compiler/harbour.c
     * Minor optimization when storing HB_FS_FIRST

   * source/pp/pptable.c
     - Removed built-in rule, for STRUCTURE support

   * source/vm/runner.c
     ! Fixed bug when there is no startup procedure

   * source/rtl/tclass.prg
     - Removed HB_Structure()

   * include/hbextern.ch
     * Moved EXTERNAL HB_STRUCTURE to separate section

   * tests/teststru.prg
     + added #INCLUDE "..\Include\HBSTRUC.CH"

   + include/hbstruc.ch

   + source/rtl/hbstruc.prg

   * makefile.bc
     + Added rules for hbstruc.prg
2000-05-26 07:39:42 +00:00
Paul Tucker
cb5c7083d4 Add missing cast to xgrab call 2000-05-24 04:25:29 +00:00
Ron Pinkas
9f05928bd2 20000522-10:40 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-23 01:31:34 +00:00
Viktor Szakats
7c3033e04e 20000523-02:06 GMT+1 Victor Szakats <info@szelvesz.hu> 2000-05-23 00:06:44 +00:00
Viktor Szakats
6a0ab26de6 20000523-02:06 GMT+1 Victor Szakats <info@szelvesz.hu> 2000-05-23 00:03:41 +00:00
Ron Pinkas
5dafe5ee47 20000522-09:20 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.c
     + Added code to main() to process symbols and look for the first symbol in the prg and give it scope HB_FS_FIRST

   * source/compiler/genc.c
     + Added check for HB_FS_FIRST in the symbol processing loop, and output to the symbol table.

   * source/vm/hvm.c
     ! Fixed bug where if first symbol was an init symbol, it got executed twice.

   * source/vm/runner.c
     + Added logic to look for first symbol, to provide correct startup.
     ! Fixed bug where if first symbol was an init symbol, it got executed twice.

   * source/rtl/tclass.prg
     ! Corrected minor typo in HB_Structure()

   * tests/teststru.prg
     ! Corrected minor typo.

   + tests/testinit.prg
     + Added file to test proper startup processing.
2000-05-22 16:27:20 +00:00
Ron Pinkas
eb2d8afdb4 20000522-06:15 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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
2000-05-22 13:53:14 +00:00
Ron Pinkas
34b7814957 20000521-21:50 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.y
     - Removed few unneeded hb_strdup() from calls to hb_compClassFind()
     + Added auto addition of Method Declaration for the SET Function of a declared Var of a declared class.

   * source/compiler/harbour.c
     - Removed few unneeded hb_strdup() from calls to hb_compClassFind()
2000-05-22 04:53:45 +00:00
Ron Pinkas
c7e237273e 20000521-14:15 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
     + Added "as class"

   * source/compiler/harbour.y
     ! Fixed shift conflicts and reduce conflicts.
     * Modified rules for syntax "AS Object ClassName" to "As Class ClassName"

   * tests/testwarn.prg
     ! Corrected the #translate to reflect latest syntax
     ! Corrected syntax to use AS CLASS ClassName instead of AS OBJECT ClassName.
2000-05-21 21:19:51 +00:00
Ron Pinkas
8e184f78a4 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
2000-05-21 04:55:06 +00:00
Ron Pinkas
f778702d2d 20000520-10:07 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
     - Removed rule for "FROM CLASS"
     + Added "AS Obj" as an abrreviation for "AS Object"

   * source/compiler/harbour.y
     * Changed "AS Object FROM CLASS ClassName" to "As Object ClassName"

   * tests/testwarn.prg
     * Modified code to demonstrate new syntax for "As Object..."
2000-05-20 17:12:20 +00:00
Ron Pinkas
9339186a1b 20000519-15:40 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/hbpcode.c
     + Minor correction in hb_compStrongType()
2000-05-19 22:41:06 +00:00
Ron Pinkas
9f3912cbd9 20000519-15:28 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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 ...
2000-05-19 22:31:19 +00:00
Ron Pinkas
7c2cac0386 20000519-10:17 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-19 17:19:58 +00:00
Ron Pinkas
59501e617d 20000519-02:05 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-19 09:25:06 +00:00
Ron Pinkas
b8f0090858 20000515-19:45 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
    ! Corrected (again) rules for OPTIONAL to not conflict with DO OPTIONAL WITH ... and FOR Counter := OPTIONAL TO ...
2000-05-16 02:48:54 +00:00
Viktor Szakats
de583b1979 20000516-03:59 GMT+1 Victor Szakats <info@szelvesz.hu> 2000-05-16 02:04:00 +00:00
Ron Pinkas
4d80141da2 20000515-18:00 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.c
    - Removed: warning of unitialized static variable.

  * source/compiler/hbpcode.c
    - Removed: warning of unitialized static variable.
    ! Minor correction to hb_compStrongType()
2000-05-16 01:02:26 +00:00
Viktor Szakats
f5bea47692 20000515-22:47 GMT+1 Victor Szakats <info@szelvesz.hu> 2000-05-15 20:43:42 +00:00
Ron Pinkas
de42b22c12 20000515-10:15 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
    + Added states DECLARE & OPTIONAL_
    * Modified rules for "declare" and "optiona" to use states, and support abbreviations.
    * Modified rules for "declare" to support backdated syntax DECLARE aVar[...]
2000-05-15 17:16:10 +00:00
Ron Pinkas
4eb57576a2 20000514-22:25 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-15 05:35:04 +00:00
Ron Pinkas
7733005732 20000514-19:17 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.y
    ! Additional Correction so '@' handled correctly on any var in a Function Declaration.
2000-05-15 02:17:10 +00:00
Ron Pinkas
0527bfff2f 20000514-18:57 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.c
    * Remmed some debug printf()
2000-05-15 02:03:27 +00:00
Ron Pinkas
998c3e4c84 20000514-12:20 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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"
2000-05-15 01:59:21 +00:00
Ron Pinkas
cd9e54dc06 20000514-12:20 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-14 19:22:22 +00:00
Ron Pinkas
7943176b91 20000514-10:07 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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 ...
2000-05-14 17:07:30 +00:00
Ron Pinkas
f336ac266e 20000514-09:45 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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
2000-05-14 16:47:48 +00:00
Ron Pinkas
d1d3198841 20000514-09:10 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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 ...
2000-05-14 16:12:23 +00:00
Ryszard Glab
aaf0d2c062 ChangeLog 20000514-14:55 GMT+1 2000-05-14 12:47:34 +00:00
Ryszard Glab
e692ba8959 ChangeLog 20000513-14:50 GMT+1 2000-05-13 12:44:55 +00:00
Ron Pinkas
95dd157b13 20000512-08:00 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.y
    + Added support for END to be used with FOR loops.
2000-05-12 15:07:48 +00:00
Maurilio Longo
3d1d1d3875 20000510-22:01 GMT+2 Maurilio Longo <maurilio.longo@libero.it> 2000-05-10 20:07:30 +00:00
Ron Pinkas
30cc98a20d 20000510-03:00 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-10 10:13:16 +00:00
Paul Tucker
d0fd162828 Added casts 2000-05-10 06:47:38 +00:00
Ron Pinkas
cca893bb9d 20000509-00:15 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/hbpcode.c
     ! Corrcted HB_P_NOT and minor fixes.
2000-05-09 07:16:21 +00:00
Ron Pinkas
d3cba77156 20000508-22:50 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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
2000-05-09 06:08:45 +00:00
Ron Pinkas
123e544346 20000508-00:20 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/harbour.l
     + Added rules so that "optional" won't conflict with identifiers named optional.
2000-05-08 07:20:50 +00:00
Ron Pinkas
0d504bfd5c 20000507-21:20 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-08 04:28:21 +00:00
Patrick Mast
da551faae0 Added -? and -h option for the compiler. 2000-05-07 21:35:26 +00:00
Ron Pinkas
8d68c4da51 20000507-13:35 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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.
2000-05-07 20:36:33 +00:00
Ron Pinkas
3e7718e76e 20000507-05:20 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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".
2000-05-07 12:27:18 +00:00
Ron Pinkas
83015ce56c 20000506-22:45 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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
2000-05-07 05:55:07 +00:00
Ron Pinkas
6cc426a0b8 20000506-16:35 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* 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\'"
2000-05-06 23:39:13 +00:00