Commit Graph

136 Commits

Author SHA1 Message Date
Przemyslaw Czerpak
215e18e9bd 2008-08-13 05:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/pp/ppcore.c
  * harbour/source/pp/hbpp.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/hvm.c
  * harbour/source/common/hbver.c
  * harbour/source/macro/macrolex.c
  * harbour/source/hbpcre/pcrecomp.c
  * harbour/source/compiler/hbpcode.c
  * harbour/contrib/hbmisc/spd.c
  * harbour/contrib/hbsqlit3/sqlite3/sqlite3.c
    * pacified warnings

  * harbour/config/w32/dm.cf
    * updated to work with SHELL env
    - comment -w7 switch
2008-08-13 03:31:00 +00:00
Viktor Szakats
b9c3cbccfc 2008-01-25 21:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* harbour-ce-spec
   * harbour-w32-spec
   * bin/bld.bat
   * harbour.spec
   * common.mak
   * source/pp/Makefile
   * source/lang/Makefile
   * source/macro/Makefile
   * source/rtl/Makefile
   * source/vm/mainstd/Makefile
   * source/vm/Makefile
   * source/vm/mainwin/Makefile
   * source/main/Makefile
   * source/debug/Makefile
   * source/codepage/Makefile
   * source/common/Makefile
   * source/rdd/nulsys/Makefile
   * source/rdd/Makefile
   * source/rdd/hsx/Makefile
   * source/rdd/usrrdd/Makefile
   * source/compiler/Makefile
   * contrib/hbct/tests/Makefile
   * contrib/hbodbc/tests/bld_b32.bat
   * contrib/hbole/tests/bld_b32.bat
   * contrib/hbapollo/tests/bld.bat
   * contrib/hbfbird/tests/bld_b32.bat
   * contrib/hbfbird/tests/Makefile
   * contrib/hbpgsql/tests/Makefile
   * contrib/hbfimage/tests/bld_b32.bat
   * contrib/hbgd/tests/bldtest.bat
   * contrib/hbmisc/tests/Makefile
   * contrib/hbgf/tests/bld_b32.bat
   * contrib/hbbtree/tests/Makefile
   * contrib/examples/guestbk/Makefile
   * contrib/examples/pe/Makefile
   * contrib/examples/dbu/Makefile
   * contrib/examples/misc/Makefile
   * contrib/examples/hscript/Makefile
   * utils/hbdoc/Makefile
   * utils/hbextern/Makefile
   * utils/hbdot/Makefile
   * utils/hbmake/Makefile
   * utils/hbmake/hbmutils.prg
   * utils/hbmake/hbmake.prg
   * utils/hbpp/Makefile
   * utils/hbpptest/Makefile
   * utils/hbtest/Makefile
   * utils/hbrun/Makefile
   * tests/Makefile
     * Core libs renamed to be prefixed with hb, while 
       having the first significant 5 chars unique.

       Old name    New name
       --------    --------
       codepage -> hbcpage 
       common   -> hbcommon
       compiler -> hbcplr  
       debug    -> hbdebug 
       hbsix    -> hbsix   
       hsx      -> hbhsx   
       lang     -> hblang  
       macro    -> hbmacro 
       pp       -> hbpp    
       rtl      -> hbrtl   
       vm       -> hbvm    
       rdd      -> hbrdd
       dbfcdx   -> rddcdx
       dbffpt   -> rddfpt
       dbfntx   -> rddntx
       nulsys   -> hbnulrdd
       usrrdd   -> hbusrrdd
       mainwin  -> hbmainwin
       mainstd  -> hbmainstd

       NOTE/TODO: We're currently not in sync with contribs, 
                  regarding hb prefixing, since in contrib 
                  rdds and gts (rightly) also have hb prefixes.
                  The only reason not to add them in core this
                  time, is to keep compatibility with DJGPP.
                  Maybe we should remove those prefixes from 
                  contrib.

       NOTE/TODO: Do tests in as many platforms and as many contrib 
                  tests as possible. Feedback from hbmake users is 
                  also welcome.

       !!! Please update your local make files !!!

   * include/hbgtinfo.ch
     + Added HB_ prefixed versions for all GTI_ macros.
       Unprefixed GTI_ macros are to be considered xhb 
       compatible (or legacy) ones, and they can be 
       excluded by #defining HB_GT_NO_XHB if they seem to 
       collide with user code.
       TODO: Switch to use HB_GTI_* inside Harbour code.
2008-01-25 20:40:49 +00:00
Przemyslaw Czerpak
4d9930caa6 2008-01-09 15:03 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/estack.c
    * added missing static to s_initSymbol declaration

  * harbour/include/hbgtinfo.ch
  * harbour/source/rtl/scroll.c
    * formatting

  * harbour/common.mak
    * added empty line necessary for some make systems (f.e. wmake)

  * harbour/bin/hb-func.sh
    * changed system libs order to avoid problems on some platforms

  * harbour/bin/pack_src.sh
    * collect information about repository files using 'svn status -v'
      command instead of scanning .svn/entries files to avoid problems
      with different formats used by SVN

  * harbour/include/hbchksum.h
  * harbour/include/hbset.h
    ! added missing extern in few function prototypes

  * harbour/include/hbclass.ch
    * use HB_CLS_PARAM_LIST macro instead of ... for strict C52 mode

  * harbour/source/common/hbfsapi.c
    + added missing const to one declaration

  * harbour/source/common/hbstr.c
    * minor cleanup in hb_stricmp()

  * harbour/source/rtl/inkey.c
    ! casting to avoid negative values during char to int translation

  * harbour/source/rtl/mouse53.c
    * added one internal definition

  * harbour/source/rtl/philes.c
    * removed unnecessary #include(s)
    * added missing const to one declaration

  * harbour/source/rtl/valtype.c
  * harbour/source/vm/hashfunc.c
    * cleanup RT error call to eliminate hb_paramError() function

  * harbour/source/pp/pplib.c
  * harbour/source/vm/runner.c
  * harbour/source/vm/debug.c
  * harbour/source/vm/arrayshb.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtfunc.c
  * harbour/source/rtl/hbinet.c
  * harbour/source/rtl/hbregex.c
  * harbour/source/rtl/idle.c
  * harbour/source/rtl/errorapi.c
  * harbour/source/rtl/hbtoken.c
  * harbour/source/rtl/direct.c
  * harbour/source/rdd/dbcmd.c
  * harbour/source/rdd/dbcmd53.c
  * harbour/source/rdd/fieldhb.c
  * harbour/source/rdd/hbsix/sxcompr.c
  * harbour/source/rdd/hbsix/sxcrypt.c
  * harbour/source/compiler/hbcmplib.c
  * harbour/contrib/hbrddads/adsfunc.c
  * harbour/contrib/hbrddads/adsmgmnt.c
    - removed unnecessary calls to hb_ret()
    % replaced hb_itemRelease( hb_itemReturn( pItem ) ) with
      hb_itemReturnRelease( pItem )
    % replaced hb_itemPut*( hb_arrayGetItemPtr( pArray, ... ), ... ) with
      hb_arraySetNI( pArray, ... )

  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/contrib/xhb/cstructc.c
  * harbour/contrib/hbw32/w32_ole.c
  * harbour/contrib/hbgtwvg/wvtcore.c
    * cleaned typos with double ;;

  * harbour/source/vm/extend.c
  * harbour/source/rtl/math.c
    * cleaned HB_EXPORT usage

  * harbour/source/pp/ppcore.c
    ! fixed Harbour extension which allows to use match marker
      at the beginning of rule definition

  * harbour/source/main/harbour.c
    ! fixed hex conversion in FM log module - fix done by Phil Krylov
      in xHarbour

  * harbour/source/rdd/nulsys/nulsys.c
    + added dummy version of DBEVAL() and DBFILTER() - these functions
      are used in RTL

  * harbour/contrib/hbct/bitnum.c
    + added INTNEG(), INTPOS()

  + harbour/contrib/hbct/ctrand.prg
    + added RANDOM(), RAND() - borrowd from xHarbour by Pavel Tsarenko

  + harbour/contrib/hbct/setrc.c
    + added SETRC()

  * harbour/contrib/hbct/getinput.prg
    % minor optimization

  * harbour/contrib/hbct/Makefile
  * harbour/contrib/hbct/common.mak
    * updated for new files

  * harbour/contrib/hbnf/tempfile.prg
    * use HB_FTempCreate() - modification borrowed from xHarbour
      TOFIX this function uses hb_isbyref() which does not exist
      in Harbour

  * harbour/config/w32/msvc.cf
    + added -nologo flag for cl.exe (Phil Krylov's modification borrowed
      from xHarbour

  * harbour/config/w32/mingw32.cf
    - removed repeated definitions

  * harbour/config/w32/install.cf
    ! added alternative install rule for command.com with max line size limit
2008-01-09 14:04:12 +00:00
Przemyslaw Czerpak
01bc547035 2007-10-13 02:13 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
    * updated for recent modifications
2007-10-13 00:14:07 +00:00
Przemyslaw Czerpak
c374d6f243 2007-10-13 02:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/doc/destruct.txt
    * update description for multiple inherited destructors

  * harbour/source/compiler/complex.c
    * _HB_CLASS and _HB_MEMBER are not longer reserved words

  * harbour/include/hbclass.ch
  * harbour/include/hbexprop.h
  * harbour/include/hbexprb.c
  * harbour/source/macro/macro.y
  * harbour/source/compiler/harbour.y
    * formatting and minor code cleanup

  * harbour/source/compiler/hbusage.c
    * added missing information about -undef:<id> switch to usage
      description

  * harbour/source/compiler/gencc.c
    ! fixed bug reported by Teo in code generated for SWITCH statement
2007-10-13 00:12:25 +00:00
Przemyslaw Czerpak
423df1e50d 2007-09-28 19:26 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
    * pass compile time -ks state to RT macro compiler flags.
      It means that if you compile some with which &macros
      then -ks compile time switch will be passed also to
      macro compiler and respected later at runtime

  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.y
    + added support for passing by reference array and object items

  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
    * generate compile time error for @func(<vars,...>)
      only @func() is acceptable
2007-09-28 17:26:32 +00:00
Przemyslaw Czerpak
20719c1cf1 2007-07-31 21:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    * disable CTOD("") optimization when -kc switch is used

  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.y
    * fixed typo reported by Mindaugas

  * harbour/source/vm/classes.c
    * fixed typo reported by Lost
2007-07-31 19:01:07 +00:00
Przemyslaw Czerpak
b7a2da9dac 2007-07-02 18:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.y
  * harbour/source/macro/macrolex.c
    ! allow to use 'FIELD' and '_FIELD' as variable/function/field name.
    * allow to use 'IF' and 'IIF' as variable/field name.
2007-07-02 16:10:58 +00:00
Przemyslaw Czerpak
581507c90d 2007-06-01 15:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/harbour.spec
    * set attributes explicitly to clean some wrong attributes committed
      to CVS and minor cleanup

  * harbour/include/hbapierr.h
  * harbour/source/rtl/errorapi.c
    + added hb_errorBlock()

  * harbour/source/macro/macro.yyc
  * harbour/source/compiler/harbour.yyc
    * manual hack to pacify BCC warning messages

  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbopt.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/vm/hvm.c
    + added support for:
         BEGIN SEQUENCE WITH <errorBlockExp>
            [<statements;...>]
         [ RECOVER [ USING oErr ] ]
            ...
         [ ALWAYS ]
            ...
         END
      It works like normal BEGIN SEQUENCE but sets <errorBlockExp> as
      ErrorBlock() before executing <statements;...> and restore
      previous ErrorBlock() at the end or when exception will appear.
      I hope it will make some xHarbour user happy ;-)

  * harbour/include/hbcompat.ch
    + added preprocessor directive for TRY / CATCH / FINALLY / END
      working like in xHarbour - translated to:
         BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
            ...
         [ RECOVER [ USING oErr ] ]
            ...
         [ ALWAYS ]
            ...
         END
2007-06-01 13:12:29 +00:00
Przemyslaw Czerpak
defb63f5f2 2007-05-30 01:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
    ! fixed bug in operator precedence - seems that it existed from
      beginning and partially were fixed in xHarbour. This code exploits
      the problem:
            #define EOL chr(13)+chr(10)
            #command ? [<x,...>] => [outstd( <x> );]outstd(EOL)
            #command TEST <exp> => BEGIN SEQUENCE     ;
                                 ;   ? <exp>          ;
                                 ; RECOVER USING oErr ;
                                 ;   ? "Error:", oErr:subCode, ;
                                       oErr:description, oErr:operation ;
                                 ; END
            proc main()
            local oErr, s1:="X", s2:="Y", t:=.T.
            errorBlock({|oErr|break(oErr)})
            TEST t != s1 $ s2
            TEST t == s1 $ s2
            TEST t =  s1 $ s2
            TEST t <  s1 $ s2
            TEST t <= s1 $ s2
            TEST t >  s1 $ s2
            TEST t >= s1 $ s2
            TEST s1 $ s2 != t
            TEST s1 $ s2 == t
            TEST s1 $ s2 =  t
            TEST s1 $ s2 >  t
            TEST s1 $ s2 <  t
            TEST s1 $ s2 >= t
            TEST s1 $ s2 <= t
            return
2007-05-29 23:04:09 +00:00
Przemyslaw Czerpak
541d776d85 2007-05-25 01:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbexpra.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macrolex.c
  * harbour/source/vm/macro.c
    - removed hb_macroIsIdent()
    + added hb_macroTextSymbol()
    ! fixed old bug (it exists in all [x]Harbour versions) in macrocompiler
      which caused HVM stack corruption
    * generate from lexer symbols which are well formatted
      (uppercase and size <= HB_SYMBOL_NAME_LEN)
    % use hb_dynsymGetCase() instead of hb_dynsymGet()
    % some minor speed improvement

  * harbour/source/rtl/gtwin/gtwin.c
    % use hb_dynsymFind() instead of hb_dynsymFindName()

  * harbour/source/rdd/dbcmd.c
  * harbour/source/rdd/wafunc.c
    * reenabled by default strict clipper compatible behavior for
      code select(), dbSelectArea() and alias allocating

  * harbour/source/rdd/dbf1.c
    + added DBI_ISENCRYPTED for tables encrypted by SIX3

  * harbour/source/rtl/hbinet.c
    ! added missing break (Ron fix from xHarbour)
2007-05-24 23:35:25 +00:00
Przemyslaw Czerpak
74adc6f86c 2007-04-23 18:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbopt.c
    ! reverted fix for unnecessary -W2 warning:
         Function '...' does not end with RETURN statement
      in code like:
            func f(v)
            if v
               return "TRUE"
            else
               return "FALSE"
            endif
      Sorry but I had to make it because this fix was wrong and causes
      that code like:
            func f(v)
            if v
               ? v
            else
               return "FALSE"
            endif
      was compiled without any warnings but wrong PCODE was generated.
      In some spare time I'll try to implement valid RETURN detection,
      now simply add RETURN NIL at the end of such functions - it will
      be removed by dead code eliminator.
    ! fixed memory leak when more then one .prg file was given as compiler
      parameter
    + cleaned some code for future modifications

  * harbour/source/macro/macro.y
    + added small hack for two BCC/OW warnings
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
    * regenerated with modified Bison version which should give code
      without BCC warnings - I cannot promise I'll keep it in the
      future but I will try.

  * harbour/source/rdd/dbcmd.c
    ! use default RDD instead of current one in COPY TO and APPEND FROM

  * harbour/source/vm/classes.c
    * added support for (@func()):eval(...)
2007-04-23 16:27:57 +00:00
Przemyslaw Czerpak
88cda3200d 2007-03-22 12:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
    * updated for new files - please check

  * harbour/harbour.spec
    * added compiler library

  * harbour/bin/pack_src.sh
  * harbour/bin/hb-func.sh
    * updated for new files and libraries

  * harbour/config/w32/mingw32.cf
  * harbour/config/w32/watcom.cf
  * harbour/config/w32/xcc.cf
    * added winsock libraries

  * harbour/include/hbapicdp.h
  * harbour/source/rtl/cdpapi.c
    + added hb_cdpicmp() - not case sensitive version of hb_cdpcmp()

  * harbour/include/hbapiitm.h
  * harbour/source/vm/itemapi.c
    + hb_itemStrICmp(), hb_itemCopyFromRef(), hb_itemMoveFromRef()

  * harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/include/hbpcode.h
  * harbour/include/hbvmpub.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/genhrb.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbopt.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/macro/macrolex.c
  * harbour/source/vm/Makefile
  * harbour/source/vm/arrays.c
  * harbour/source/vm/asort.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/eval.c
  * harbour/source/vm/garbage.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/macro.c
  + harbour/source/vm/hashes.c
  + harbour/source/vm/hashfunc.c
    + added hash items, f.e.:
         local h1 := {=>}, h2 := { "a"=>1.234, "b"=>2.345 }
         ? h2[ "a" ], h2[ "b ]
    + added support for DYNAMIC function declaration - it allow to define
      functions which are lately bound at runtime, f.e.:
         /*** t01.prg ***/
         dynamic func1
         proc main()
         local h:=__hrbload("t02.hrb")
         ? func1()
         return

         /*** t02.prg ***/
         func func1
         return "Hello!!!"

    % use new FUNCALL structure to hold EXTERNAL and DYNAMIC functions,
      it reduce memory usage, FUNCALL is much smaller then FUNCTION
    % use symbol scope bits when possible instead of making some linear scan
    + added new enumarator message: __ENUMKEY - it allow to access
      key value when hash item is base enumerator value, f.e.:
         proc main()
         local v, h:={"a"=>1.000,"b"=>2.000,"c"=>3.000}
         heval( h, { |k,v,i| qout( k, v, i ) } ); ?
         for each v in h
            ? v, "=>", v:__enumKey(), v:__enumValue(), v:__enumIndex(), ;
                       valtype(v:__enumBase())
            v += 0.123
         next
         ? ;heval( h, { |k,v,i| qout( k, v, i ) } )
         return
    + added C level hb_hash*() functions
    + added support for full HASH item cloning and updated array cloning
      to also clone nested hashes - please note that xHarbour does not do
      that, in xHarbour ACLONE() clones _ONLY_ nested arrays and HCLONE()
      _DOES_NOT_ clone _ANY_ nested items.

  * harbour/include/hbextern.ch
    + added hash functions HB_H*()
    * changed INET*() functions to HB_INET*()
    + added hash functions H*() and socket functions INET*() when
      HB_COMPAT_XHB is set

  * harbour/include/hbtypes.h
    + added missing HB_EXTERN_BEGIN / HB_EXTERN_END

  * harbour/include/hbpp.h
  * harbour/source/pp/ppcore.c
    ! added protection against automatic word concatenation in some cases
    ! fixed preprocessing expressions when match marker matches ';' token

  * harbour/source/rtl/Makefile
  + harbour/source/rtl/itemseri.c
    + added functions for item serialization: HB_SERIALIZE() and
      HB_DESERIALIZE() - these function are not binary compatible
      with xHarbour functions with the same names but make very
      similar job with the exception to serialization of codeblock
      and object variables - Harbour does not allow to serialize
      codeblocks and serialize objects as arrays.
      In most cases these functions can replace the xHarbour ones
    + added HB_DESERIALBEGIN() and HB_DESERIALIZE() functions covered
      by HB_COMPAT_XHB macro - this functions are only for compatibility
      with existing xHarbour code, In Harbour HB_DESERIALBEGIN() is
      dummy function which returns first parameter and HB_DESERIALNEXT()
      is a simple wrapper to HB_DESERIALIZE() so it's not necessary to
      use them.

  * harbour/source/rtl/hbinet.c
    * changed INET*() functions to HB_INET*() and enable them for default
      build
    + added INET*() functions wrappers covered by HB_COMPAT_XHB macro

  * harbour/source/rtl/hbrandom.c
    + added HB_RANDOMINT() - xHarbour compatible

  * harbour/source/rtl/len.c
    + added support for HASHes

  * harbour/source/rtl/valtype.c
    + added support for HASHes
    + added set of HB_IS*() functions - they are a little bit faster then
      calling VALTYPE( v ) == <cVal>
    - removed HB_ISBYREF() - this function cannot longer work, it was using
      a Clipper incompatible anomalies in passing variables by reference I
      fixed so it has to stop to work. If it will be realy necessary to
      implement HB_ISBYREF() function then please inform me - it will have
      to be done at compiler level or with some much deeper HVM stack
      checking.

  * harbour/source/vm/extend.c
    ! fixed hb_extIsArray() and hb_extIsObject() to work well with
      parameters passed by reference.
      Please note that now hb_extIsArray() return TRUE only for pure arrays
      not object values.

  * harbour/contrib/Makefile
  + harbour/contrib/tip/Changelog
  + harbour/contrib/tip/Makefile
  + harbour/contrib/tip/atokens.c
  + harbour/contrib/tip/base64x.c
  + harbour/contrib/tip/cgi.prg
  + harbour/contrib/tip/client.prg
  + harbour/contrib/tip/credent.prg
  + harbour/contrib/tip/cstr.prg
  + harbour/contrib/tip/encb64.prg
  + harbour/contrib/tip/encmthd.c
  + harbour/contrib/tip/encoder.prg
  + harbour/contrib/tip/encqp.prg
  + harbour/contrib/tip/encurl.prg
  + harbour/contrib/tip/ftpcln.prg
  + harbour/contrib/tip/hbhex2n.c
  + harbour/contrib/tip/httpcln.prg
  + harbour/contrib/tip/mail.prg
  + harbour/contrib/tip/popcln.prg
  + harbour/contrib/tip/smtpcln.prg
  + harbour/contrib/tip/tip.ch
  + harbour/contrib/tip/url.prg
  + harbour/contrib/tip/utils.c
    + added TIP library - code borrowed from xHarbour



   Please test - a lot of above code is not well tested, also some peaces
   were written over year ago for different things (f.e. serialization for
   NETRDD) and now I collected them and committed.
   The TIP library was not tested at all. It can be compiled but I cannot
   say if it works - I hope that people familiar with it can make necessary
   test and fixes.
   It's also not the final version of low level HASH item code. I'm working
   on more efficient structure which uses binary tries but I cannot say when
   I'll finish it (maybe in this weekend or maybe in next year) so I committed
   working version now even if I'm not happy with overall performance (BTW
   not worser then in xHarbour)
2007-03-22 12:28:14 +00:00
Przemyslaw Czerpak
8ce0d03aa0 2007-03-09 04:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
  * harbour/makefile.bc
  * harbour/makefile.vc
  * harbour/bin/hb-func.sh
  * harbour/config/global.cf
  * harbour/include/error.ch
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  - harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/source/Makefile
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  - harbour/source/compiler/exproptc.c
  - harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbgenerr.c
  + harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/macro/Makefile
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  - harbour/source/macro/macroc.c
  + harbour/source/main/Makefile
  + harbour/source/main/harbour.c
  * harbour/source/vm/macro.c
    * resolved name conflicts between compiler and macro compiler.
      Now new compiler library is created.
      There are some things which can be improved and cleaned yet
      but it's enough to create single binaries with compiler+HVM+RTLs.
      I updated non GNU make files but I cannot tested the modifications
      - please check and fix me if necessary
2007-03-09 03:44:42 +00:00
Przemyslaw Czerpak
56cb6bcd62 2007-01-14 16:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/macro/macro.y
    * formatting
  * harbour/source/vm/macro.c
    ! fixed macrocompiler for proper compilation of string with embedded
      ASCII NUL byte (chr(0)), f.e.:
         ? &("'["+chr(0)+"]'")
2007-01-14 15:09:30 +00:00
Przemyslaw Czerpak
3fd903247e 2007-01-07 05:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbusage.c
  * harbour/source/compiler/ppcomp.c
  * harbour/source/macro/Makefile
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/vm/macro.c
  * harbour/source/vm/memvars.c
  * harbour/source/vm/memvclip.c
    * keep prefix definition for bison public symbols in *.y files instead
      of passing them as bison arguments to avoid possible mistakes during
      *.yy[hc] file generation
    ! fixed iif() reduction when used as single function parameter
    + add -kM compiler switch - turn off macrotext substitution
    * updated <string> + <string> optimization and other macrotext usage
      to keep more Clipper compatible behavior
    ! fixed typo in expression type checking in IIF() reduction - it was
      working because wrongly used macros has the same values as the valid
      ones
    - removed compiler switches and macros for old HB_INLINE() syntax - it
      was not supported after last months modifications. Only:
         HB_INLINE([params,...]) { C code }
      is supported.
    ! fixed passing parameters by reference in IIF() statement and macro
      compiler. The following valid Clipper code:
         &("myfunc(<exp>, @var1, @var2)")
      was not supported
    ! do not allow to use references or empty expressions in expression list
      AFAIK it's Clipper compatible. If I'm wrong then please fix me but
      Clipper allows to use references only as function arguments, 2-nd and
      3-rd IIF() argument and as directly created array items ( {...@var...} )
      DO ... WITH ... is a special case of function call.
    ! Changed grammar rules to accept only Clipper compatible parameters.
    ! fixed typo in macro name in hb_memvarNewParameter() function.
    * use HB_FUNC_EXEC(...) instead of HB_FUNCNAME(...)()
2007-01-07 04:09:09 +00:00
Przemyslaw Czerpak
647e9281bf 2006-12-30 22:45 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/macro/macrolex.c
  * harbour/source/vm/macro.c
    * final grammar cleanup: removed unused and/or unnecessary grammar
      expressions in *.y files, fixed some differences between compiler
      and macrocompiler, fixed some other bugs, typos, clipper
      incompatibilities, etc.
      It's end of year, it's late and sorry but I'd like to begin making
      something absolutely differ then creating detail description ;-)
      If you will have any questions then I'll answer in new year.

  * harbour/source/rdd/dbffpt/Makefile
    * small hack for XCC compilation

best regards and happy new year,
Przemek
2006-12-30 21:51:33 +00:00
Przemyslaw Czerpak
bdb38dde43 2006-12-15 16:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbdefs.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/common/hbstr.c
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencobj.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/rtl/console.c
  * harbour/source/rtl/isprint.c
  * harbour/source/rtl/left.c
  * harbour/source/rtl/right.c
  * harbour/source/rtl/strtran.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
    * general PCODE cleanup and address most of TODO/TOFIX notes in
      source code:
      ! fixed GPF traps when too long string or codeblock is generatd
      + added support for 16MB codeblocks and strings
      ! removed macrocompiler limitation for jumps range
      ! fixed GPF when more then 255 local variables is used and added
        support for 2^15 locals
      ! removed all strtok() functions
      % added optimization for all +=, -=, *=, %=, ^=, **= operations
        when left side of expression is variable or array item
      % added optimization for all +=, -=, *=, %=, ^=, **= operations
        when left side of expression is object method and updated ++, --
        for new code. It's still disabled until we will not add support
        for late evaluated reference items to HVM
      ! fixed a[++i]++ and similar operations (a[++i]*=2, ...). Now ++i is
        executed only once. It's not Clipper compatible but it was in
        TODO note in source code. It can be disabled by -kc option
      * finished support to xHarbour like #pragma TEXTHIDDEN(1)
      ! fixed local add int optimization when PARAMETERS used after
        optimization changed local variable number over 255
      ! fixed GPF trap when in HB_P_<op>EQ PCODEs when executed for
        direct values
      * others
    ! fixed problems reported by Chen
    * optimized strtran(), left(), right() to not create new string copy
      when the same value is returned
2006-12-15 15:54:28 +00:00
Przemyslaw Czerpak
0ed571953a 2006-12-04 19:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/macro/macrolex.c
    * added support for extended string (e"...") to macro compiler and
      strings with embedded ASCII NUL character (chr(0))

  * harbour/source/rtl/valtostr.c
    * added HB_STRTOEXP() function which converts string item to valid
      expression which can be compiled by macro compiler. String may
      contain any characters.

  * harbour/source/rtl/persist.prg
    * use HB_STRTOEXP() for sting conversion and 0d....... for date
      constants

  * harbour/source/rtl/readvar.prg
  * harbour/source/rtl/xsavescr.c
    * minor cleanup
2006-12-04 18:22:29 +00:00
Przemyslaw Czerpak
4dfc616250 2006-12-01 18:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/pack_src.sh
    + added packing *.yy[ch] files

  * harbour/makefile.bc
  * harbour/makefile.vc
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbpp.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/pp/ppcore.c
    + added hb_comp prefix to grammar/lexer compiler public functions to
      reduce possible conflict with 3-rd party code which may use default
      yy prefix.
    ! do not use bison destructors for expressions. Internal bison logic
      cannot properly detect if expression was used or not in some of our
      grammar rules and it's possible that some expressions will not be freed
      and some other freed twice.
    ! added protection against multiple destructors execution for CBSTART
      and LITERAL tokens
    * added small garbage collector for deallocating expressions which were
      not freed (such situation can happen in syntax errors)
    % some optimizations in used structures to reduce their sizes
    + added protection against execution PCODE optimizations for functions
      which were not cleanly compiled.

  * harbour/source/rtl/idle.c
    * use const in nanosec() timeout declaration
2006-12-01 18:00:53 +00:00
Przemyslaw Czerpak
1808aec080 2006-11-30 03:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
    * removed declaration and all references to global variable hb_comp_data
      it's not longer necessary after last modifications

  * harbour/source/compiler/harbour.yyc
    * synced compiler grammar parser

  * harbour/source/macro/macro.yyc
    ! regenerated macro compiler grammar parser with -p hb_macro - I forgot
      about this prefix before last commit
2006-11-30 02:54:29 +00:00
Przemyslaw Czerpak
390affe026 2006-11-28 16:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/Makefile
    + added hbcompdf.h and hbstdgen.ch

  * harbour/source/compiler/harbour.y
  * harbour/source/macro/macro.y
    + added #define __STDC__ as workaround for __BORLANDC__ which seems
      to not properly understand ANSI C declarations. It should pacify
      some of BCC warning messages about undeclared functions
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
    * updated generated grammar parser files for above modification
      in parser definition files (.y)
2006-11-29 15:06:27 +00:00
Przemyslaw Czerpak
9967551273 2006-11-28 19:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/compiler/harbour.y
    * use HB_COMP_PARAM macro in expression destructor instead of
      direct accessing hb_comp_data global variable to make compiler
      code MT safe

  + harbour/source/compiler/harbour.yyc
  + harbour/source/compiler/harbour.yyh
  + harbour/source/macro/macro.yyc
  + harbour/source/macro/macro.yyh
    + added generated by bison 2.3 grammar parsers for compiler and
      macro compiler

  * harbour/config/dos/global.cf
  * harbour/config/dos/install.cf
  * harbour/config/w32/global.cf
    * changed CP definition for COMMAND.COM so it can work as standalone
      command and added DIRSEP macro

  * harbour/config/c.cf
    + added support for HB_REBUILD_PARSER=no environment variable.
      When it's set then during build process grammars parsers
      will not be generated from grammar definitions files (.y)
      but instead the predefined ones (.yyc) used.
      Tested and works well in Linux and DOS

  * harbour/makefile.bc
    + added support for HB_REBUILD_PARSER=no environment variable.
      Not tested. It's even possible that I've just broken the BCC
      compilation with this modification. Please check it and fix
      me if necessary.
2006-11-28 18:29:44 +00:00
Przemyslaw Czerpak
33ccad6661 2006-11-27 02:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/tests/codebl.prg
  * harbour/tests/langmsg.prg
  * harbour/utils/hbpptest/pp_test.prg
  * harbour/utils/hbpptest/pretest.prg
  * harbour/samples/pe/license.txt
    * removed carriage return (\r) characters

  * harbour/include/hbcomp.h
  * harbour/include/hbapi.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/vm/macro.c
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/genjava.c
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbident.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/ppcomp.c
    * separated HB_COMP and HB_MACRO definitions and added HB_COMMON
      structure used when HB_COMMON_SUPPORT macro is set
    * hide HB_MACRO internal definitions in hbapi.h when HB_MACRO_SUPPORT
      is not set
    These modifications should help in future compiler and macro compiler
    integration into single binary.

    + added clipper compatible error message in unclosed structures
      In general we should cleanup rules to make error reporting more
      user friendly and Clipper compatible
    % eliminated unnecessary allocations
    + added int mode member to common part of HB_COMP and HB_MACRO
      structure. It's initialized to HB_MODE_MACRO or HB_MODE_COMPILER
    + add TOFIX note about memory leaks in cParamTypes and pParamClasses
      members of COMDECLARED structure. It's a part of unfinished strong
      typing code. I do not know what Ryszard plan to do with it so I'm
      leaving it as is. The part of strong typing which were operating
      on emulated HVM stack has been removed.
    * removed static variables from genjava.c. Also gencli.c and genobj32.c
      should be fixed but this will not make this code working so I haven't
      touched it.
    * changed 3-rd parameter of hb_compIdentifierNew() from BOOL to int.
      Now it can have the following values: HB_IDENT_STATIC, HB_IDENT_FREE,
      HB_IDENT_COPY. This modification will allow in the future using common
      for static and dynamic symbol hash table without additional source code
      changes. I also plan to use identifier hash table in PP the reduce
      number of memory allocations and speed-up preprocessing by using
      second level hashing for hash keys.

  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
    * changed HB_MACRO_SUPPORT to HB_COMMON_SUPPORT to automatically detect
      possible conflicts between compiler and macro compiler
    ! removed first detected conflict which existed for long time
    + added hb_compExprMacroAsAlias() function to convert HB_ET_VARIABLE
      expression to HB_ET_ALIAS.

  * harbour/source/macro/macro.y
    ! fixed using prefix&macro-> and &macro.sufix-> when macro cannot be
      substituted by compiler, f.e.:
         M->v := NIL
         x := "&v.1->fld"
         M->v := "v"
         M->v1:= "data"
         ? &x
    ! fixed memory leak in macro substituted expression compilation

  * harbour/source/vm/macro.c
    ! fixed initialization of some HB_MACRO members
    ! fixed value returned for type("&V->F") when alias does not exist
    - removed not longer used hb_comp_bShortCuts global variable
2006-11-28 01:10:34 +00:00
Przemyslaw Czerpak
74deff4644 2006-11-25 19:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/macro/macro.y
    + added support for strings with with ASCII NUL character
      Strings with ASCII NUL character are not stored with hash table
      but dynamically allocated/deallocated
    ! fixed compilation of strings with ASCII NUL character which
      can appear in escaped strings e"..." or after compiler chr(0)
      optimization
    % removed some not longer necessary memory allocations

  * harbour/source/vm/macro.c
    ! fixed GPF caused by HB_MACRO structure double freeing
    - removed some code which was added as workaround for the old
      behavior of HVM QUIT and false FM stat memory leak reports.
      It's not longer necessary in current HVM.

  * harbour/source/common/hbstr.c
    ! fixed final string size calculation in extended strings

  * harbour/source/compiler/gencli.c
    * cleaned BCC warning
2006-11-25 18:33:28 +00:00
Przemyslaw Czerpak
e6a3baea64 2006-11-24 19:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/bsd/gcc.cf
  * harbour/config/darwin/gcc.cf
  * harbour/config/dos/djgpp.cf
  * harbour/config/dos/owatcom.cf
  * harbour/config/hpux/gcc.cf
  * harbour/config/linux/gcc.cf
  * harbour/config/linux/owatcom.cf
  * harbour/config/os2/gcc.cf
  * harbour/config/sunos/gcc.cf
  * harbour/config/w32/bcc32.cf
  * harbour/config/w32/gcc.cf
  * harbour/config/w32/mingw32.cf
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbver.h
  * harbour/source/common/hbstr.c
  * harbour/source/common/hbver.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/genjava.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.c
  - harbour/source/compiler/harbour.simple
  - harbour/source/compiler/harbour.slx
  - harbour/source/compiler/harbour.sly
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbgenerr.c
  - harbour/source/compiler/hbslex.c
  - harbour/source/compiler/hbstrong.c
  * harbour/source/compiler/hbusage.c
  - harbour/source/compiler/simplex.c
  * harbour/source/macro/Makefile
  - harbour/source/macro/macro.slx
  - harbour/source/macro/macroslx.c
  * harbour/source/pp/ppcore.c
  * harbour/utils/hbpp/hbppcomp.c
    - removed SIMPLEX references
    ! fixed memory leak in request _GET_
    * use hb_compIdentifiersNew() in INLINE and AUTOOPEN structures
      members
    * eliminated all internal exit() calls. Now hb_compGenError() with
      fatal errors does not interrupt application but only sets
         HB_COMP_PARAM->fExit = TRUE;
      What should cause silent clean application close.
      Please keep it in mind making future modifications and do not
      introduce and exit() function call.
    + added support for \x<hex> and \<oct> quoting in extended strings
      (just like in C). Warning !!!. Embedded 0 bytes are supported by
      PP, lexer and expression optimizer but not by bison. To make them
      working it will be necessary to change Literal terminal symbol
      holder and add length field in bison rules and also change the hash
      table used to hold identifiers, literals and macros to store and use
      real string length. If someone will try to use strings with embedded
      0 now then they will be cut but nothing worser should happen.
2006-11-24 18:10:07 +00:00
Przemyslaw Czerpak
9cd2098d6d 2006-11-23 20:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  + harbour/include/hbcompdf.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/include/hbpp.h
  * harbour/include/hbvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/gencobj.c
  * harbour/source/compiler/genhrb.c
  * harbour/source/compiler/genjava.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbfunchk.c
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hbident.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/ppcomp.c
  * harbour/source/macro/macro.y
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
  * harbour/source/vm/cmdarg.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/fm.c
  * harbour/source/vm/macro.c
  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbpp/hbpp.h
  * harbour/utils/hbpp/hbppcomp.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpp/hbpplib.c
  * harbour/utils/hbpp/pragma.c
    * changed the internal compiler API to be MT safe.
      All global and static non constant variables replaced by
      HB_COMP structure which have all compiler context settings.
      It's possible to allocate simultaneously many compiler contexts
      and compile code. Only constant/read only variables are shared.
      In macro compiler HB_COMP is replaced by HB_MACRO.
      In source code I everywhere used to macros: HB_COMP_DECL and
      HB_COMP_PARAM which are equivalents of old HB_MACRO_DECL and
      HB_MACRO_PARAM definitions.
      We will only have to change compiler FATAL errors support to
      not execute exit() for non batch systems.
    * make macro compiler fully MT safe
    * removed not longer used definitions and variables
    ! add direct accessing to PP line number information - it fixes missing
      line numbers reported recently
    ! added generating .ppo files when tokens are teken directly by compiler
      - it fixes empty .ppo file problem
    ! clear hb_stack internall variables after removing hb_stack to avoid
      possible GPF if application still works and try to access unexsiting
      hb_stack
    ! do not allocate new memory block when final FM statistic report is
      generated - it fixes problem with GPF when application compiled with
      FM statistic exits and CLIPPER envvar is set.
    ! fixed memory leak hb_cmdargCheck()
    ! added to harbour.y symbol destructors - it should fixes memory leaks
      in syntax errors but it uses quite new bison feature which is not
      fully supported yet. Unfortunately it's also not MT safe and the
      destructors implementation in 1.875c does not respect %parse-param.
      Bison documentation says that it should so I hope it will be fixed
      soon (or maybe even already is in the newest bison versions) before
      I'll add multi context compilation support. If not then I will have
      to add some workaround. I can pass compiler context pointer inside
      YYSTYPE using hack in a lexer but it will force really huge number
      modifications in existing bison rules so probably it will be much
      easier to fix bison or write a small tool to update generated parser.
    * other modifications - the total size of patch is nearly 1MB and
      detail description will have to take me few days.
2006-11-23 18:57:54 +00:00
Przemyslaw Czerpak
0cada37011 2006-11-21 03:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
  * harbour/source/compiler/Makefile
  * harbour/include/hbcomp.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.slx
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hbident.c
  * harbour/source/compiler/ppcomp.c
  + harbour/source/compiler/complex.c
    + added new PP based compiler lexer - it's smaller, MT safe and a
      little bit faster then then the FLEX version.
    + added HB_COMP structure to hold compiler data in future MT version
    + added global variable HB_COMP_PTR hb_comp_data to make conversion
      to MT easier - now it holds only PP and lexer data.
    * update PP related code in compiler to be MT safe
    + added %pure-parser, %parse-param and %lex-param for bison to generate
      MT safe grammar parser.
    * updated FLEX to work with recent compiler modifications and pure-parser
      bison API

  * harbour/makefile.bc
  * harbour/makefile.vc
  * harbour/source/macro/Makefile
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
  * harbour/source/macro/macrolex.c
    * use hb_macro prefix instead of hb_comp in bison/flex parser/lexer
      used in macro compiler to avoid possible conflicts in the future
    * separated lexer data

  * harbour/include/hbapi.h
  * harbour/include/hbpp.h
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
  * harbour/source/vm/macro.c
    * removed not used members from HB_MACRO structure to make it
      cleaner before creating common to compiler and macro compiler
      structure
    + added new token HB_PP_TOKEN_EPSILON
    + added void * cargo parameters passed to executed user functions
    + hb_pp_tokenGet(), hb_pp_tokenToString(), hb_pp_tokenBlockString()
      functions for new PP based compiler lexer

  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbpp/hbpp.h
  * harbour/utils/hbpp/hbppcomp.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpp/hbpplib.c
  * harbour/utils/hbpp/pragma.c
    * updated to compile with recent compiler header file modifications


    PP, new lexer and most of grammar parser should be MT safe. Now we should
    update all compiler functions to pass pointer to HB_COMP data structure
    where we should all current global variables. This structure as first
    member should have HB_CMPCOMMON structure which will hold common to
    compiler and macro compiler data. Ryszard I think you are the best person
    to define this structure.

    We have new lexer which is MT safe but please note that it has to be
    extensively tested so I would like to ask everybody to compile as much
    as possible different code and check if the final programs work as
    expected. Working on new code I removed some limitations existing in
    FLEX though not all. At the beginning I tried to replicate the exact
    FLEX behavior but I've found that in few places it does not work as
    it should so I begin to encode rules in a way which remove some
    limitations. In fact now it's much easier to control some things.
    I kept the FLEX code working and made all necessary modifications
    so it still can be used but keeping FLEX working cost us IMHO too
    much. It's not possible to introduce some improvements to grammar
    parser. All identifiers, keyword and macros returned by new lexer
    are converted to upper letters, do not have to be freed by hb_xfree()
    and is guarantied that will be always accessible. So from grammar file
    we can remove all hb_compIdentifierNew( hb_strupr($1), TRUE ) what
    should give noticeable speed improvement but will break the FLEX code.
    Ryszard and other you will have to decide if we will support FLEX in
    the future. We can also clean the code and remove most of other
    redundant hb_strupr() and hb_strdup() used in many places. BTW only
    one terminal symbol can be returned with lower letters: DOIDENT
    and I make it intentionally so it's possible to use:
         DO prog1 WITH "sth"
    on case sensitive file systems so this symbol should be cloned in
    upper cases as function symbol but used without modification as
    file name. It's current behavior but I'm not sure you will want
    to keep it. Maybe compiler switch to always convert file names
    created from
         DO <id> [WITH <params,...>]
    to lower cases will be better. Please think about it.
2006-11-21 02:29:33 +00:00
Przemyslaw Czerpak
0e01f1412a 2006-11-20 15:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/macro/macrolex.c
    ! fixed bad typo in NIL, IIF, .AND., .NOT. tokens parsing
2006-11-20 14:21:56 +00:00
Przemyslaw Czerpak
403fd7f29e 2006-11-18 15:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macrolex.c
    * do not allocate separate memory in macro compiler for terminal
      symbols which needs string representation - it fixes some set
      of memory leaks and increase a little bit macro compilation
    ! fixed accessing freed memory in:
         private cMacro := "cEarly", cEarly := {"Early"}
         @ 12,10 GET &cMacro[1]
    ! fixed GPF in:
         p:=@left()
      and similar expressions

  * harbour/source/common/expropt2.c
    % minor modification

  * harbour/source/compiler/harbour.c
    ! fixed HB_TRACE message
2006-11-18 14:37:18 +00:00
Przemyslaw Czerpak
5e19a3c8fd 2006-11-17 22:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/pp/ppcore.c
    ! fixed casting - it resolves problem reported by Alexander with
      preprocessing chr(255) from static buffer (PP used by .prg code)

  * harbour/source/macro/macro.y
    + added some comments

  * harbour/source/macro/Makefile
    * commented out compilation of FLEX based lexer for macro compiler and
      added compilation of new small lexer written in pure .c

  * harbour/common.mak
    * replaced macrol.obj by macrolex.obj

  + harbour/source/macro/macrolex.c
    + new small lexer written in pure .c. The code is much smaller,
      MT safe and more friendly for grammar parser. I think it should
      be also faster but I haven't made any tests yet. When we update
      grammar parser to not free string representation of terminal
      symbols then we should expect some farther speed improvement,
      it will also resolve some set of memory leaks like in:
         type("user input")
      and will allow to make some parts of grammar parser common to
      compiler and macro compiler by removing #if[n]def HB_MACRO_SUPPORT
2006-11-17 22:06:54 +00:00
Przemyslaw Czerpak
8d38c093b4 2006-11-17 13:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/common/hbstr.c
  * harbour/source/compiler/harbour.l
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.slx
  * harbour/source/compiler/harbour.slx
    * changed parameters in function: hb_compStrToNum() now the string
      size is passed explicitly so it can work with strings which does
      not have trailing ASCII NUL character.

  * harbour/source/macro/macro.y
    * indenting

  * harbour/include/hbmacro.h
  * harbour/source/common/hbstr.c
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
    * added two new functions for macro compiler: hb_macroLexNew() and
      hb_macroLexDelete() to clearly separate lexer from grammar parser.

  * harbour/source/compiler/harbour.l
  * harbour/source/common/hbstr.c
  * harbour/source/pp/ppcore.c
    * added error generation for wrong e"..." strings and fixed \" quoting
    * removed \q quoting

  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
    * added small description in headers

  * harbour/common.mak
  * harbour/source/pp/Makefile
  * harbour/source/pp/pplib.c
  + harbour/source/pp/pplib2.c
  * harbour/include/hbextern.ch
    + added auto destructor for allocated PP context, it's not longer
      necessary to execute __PP_FREE() so this function was moved from
      the standard .prg API to file with backward compatible functions
    * changed __PREPROCESS() to __PP_PROCESS()
    * moved setting std rules to separate file so now if user uses PP
      with only his own rules we are not forcing linking static tables
      which are quite huge (over 100kb)
      To include stdandard rules in static binaries user should add
      to his code:
         REQUEST __PP_STDRULES

  + harbour/source/pp/pplib3.c
    * old PP functions for backward compatibility:
         __PPADDRULE(), __PREPROCESS(), __PP_FREE()
      Please note that using this function is not MT safe. They should
      work like with old PP code. Using any of this function automatically
      forces linking __PP_STDRULES
2006-11-17 12:29:24 +00:00
Przemyslaw Czerpak
c448973306 2006-11-15 14:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
    + added
         void * pLex;
      member to HB_MACRO structure - it will be necessary for MT safe
      macro parser

  * harbour/include/set.ch
  * harbour/include/hbexprb.c
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
    * indenting, formatting and converting tabs to spaces

  * harbour/include/hbpp.h
  * harbour/source/compiler/ppcomp.c
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
    * make HB_PP_TOKEN structure public for other code and changed
      public PP API to not force including static rules by programs
      which does not need them.
    + added basic API for using PP as lexer
    * divided HB_PP_TOKEN_MACRO to HB_PP_TOKEN_MACROVAR and
      HB_PP_TOKEN_MACROTEXT and mark
         [<keyword>][&<keyword>[.[<nextidchars>]]]+
      as HB_PP_TOKEN_MACROTEXT not pair HB_PP_TOKEN_KEYWORD and
      HB_PP_TOKEN_MACRO
      It allows easier integration PP as (macro)compiler lexer and
      fixes preprocessing [<keyword>][&<keyword>[.[<nextidchars>]]]+
      in some patterns.

  * harbour/utils/hbtest/Makefile
    + added PP library to linked library list

  * harbour/source/macro/macro.y
    + added seaport to use PP as lexer. It's disabled by default and
      can be enabled using by defining HB_PP_MACROLEX. It eliminates
      using FLEX or SIMPLEX lexer in macro compiler. Now it emulates
      the behavior of FLEX lexer because I wanted to minimize the
      modification but in fact because parsed token are freed when
      macro compiler finish its job then we can resolve RT memory
      leaks which apear during parsing wrong expressions. It will be
      enough to drop allocating memory for new terminal symbols and
      using them as is like in compiler. It will also quite nice
      simplify include/hbexpr*.c code and will allow to move some
      functions to COMMON library. I want to make also pure compiler
      code MT safe so I will have to add passing pointer to a structure
      with compiler context just like in macro compiler. It means that
      if we define a structure which will be common to compiler and macro
      compiler with local (not common) data stored in other structure for
      which will will keep only a pointer then we will be able to move most
      of include/hbexpr*.c code to common library. But I do not want to
      make farther modification without consultation without Ryszard.
      Also to make PP default lexer some farther modifications should
      be done in core PP code and include/hbexpr*.c files to not reduce
      the speed. Now using HB_PP_MACROLEX for sure will have to cause
      speed reduction in macro compiler. But if we make necessary
      modifications then we should keep at least the same speed or
      probably reach noticeable better results.
2006-11-15 13:21:20 +00:00
Ryszard Glab
64509ea871 + added support for passing methods as macro
eg:
         o:&send()
         o:&send.end()
         o:&(expr)()
         o:&var++
         o:&var := 0
         o:&(expr)++
         WITH OBJECT obj
            ++:&var
            :&var += :&(var2+"oo")
         END

   NOTICE:
   For simple assigments (=,:=), compound assignments (+=,-=,*=,/=)
   and for pre/post increment operators( ++,--) the macro should
   evaluate to a symbol that starts with underscore '_'.
     To access a variable the macro should evaluate to a symbol
   with no '_' char.
2006-09-29 08:59:17 +00:00
Przemyslaw Czerpak
22b6c06fce 2006-09-04 19:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/TODO
    + added simpler example for memory leak in macro compiler:
         ? type("user input")

  * harbour/source/macro/macro.y
    * replaced TABs with SPACEs

  * harbour/source/vm/classes.c
    * added some TRACE() messages
    + added support for executing functions with <symItem>:EXEC()
      registered dynamically after creating <symItem>

  * harbour/source/vm/hvm.c
    * minor modification
2006-09-04 17:45:53 +00:00
Ryszard Glab
912b301c85 2006-07-14 16:00 UTC+0100 Ryszard Glab <rglab//imid.med.pl>
* include/hbcomp.h
   * include/hberrors.h
   * include/hbexpra.c
   * include/hbexprb.c
   * include/hbexprc.c
   * include/hbmacro.h
   * include/hbpcode.h
   * include/hbpp.h
   * include/hbxvm.h
   * source/common/expropt1.c
   * source/compiler/cmdcheck.c
   * source/compiler/expropta.c
   * source/compiler/exproptb.c
   * source/compiler/exproptc.c
   * source/compiler/genc.c
   * source/compiler/gencc.c
   * source/compiler/gencli.c
   * source/compiler/genhrb.c
   * source/compiler/genjava.c
   * source/compiler/genobj32.c
   * source/compiler/harbour.c
   * source/compiler/harbour.l
   * source/compiler/harbour.y
   * source/compiler/hbdead.c
   * source/compiler/hbfix.c
   * source/compiler/hbfunchk.c
   * source/compiler/hbgenerr.c
   * source/compiler/hblbl.c
   * source/compiler/hbpcode.c
   * source/compiler/hbstripl.c
   * source/macro/macroa.c
   * source/macro/macrob.c
   * source/macro/macroc.c
   * source/vm/hvm.c
   * source/vm/macro.c
      * fixed compilation of code that uses '@' pass by
       reference. The following syntax is no longer supported:
       var := IIF( .T., @var, var )
       however you can still use the following:
       funcall( IIF( bPassbyRef, @someVar, someVar ) )
      +added support for the following statement:
         WITH OBJECT <objexpression>
            ...
         END
       inside this statement you can use simplified form of sending
       messages to the object specified by <objexpression>
         :message( )    instead objexpression:message()
         :property      instead objexpression:property
       The runtime error will be generated at the time of message
       sending (or property access/assign) if <objexpression>
       is not a value of type object.
       You can use the reserved property:
         :__withobject
       to access/assign the controlling object.
      *fixed support for command line response file (@file.clp)
       to be compatible with Clipper (Clipper genertes a single
       obj file)
      *fixed memory leaks when there is a fatal error in autoopened
       module (using DO ... statement)
      *implicit startup functions are removed from the list of
       functions before generation of output code

   * source/pp/ppcomp.c
   * source/pp/pplib.c
   * source/pp/ppcore.c
      * redefinition of #define no longer causes a memory leak
      * fixed repeatable optional clauses
         #xcommand SET <var1> [, <varN>] WITH <val> =>
          <var1>:=<val>[; <varN>:=<val>]
      * fixed compilation of optional clauses (when used in different
        order then declared) -this fixes the following long
        waiting bug:
         #command MYCOMMAND [<mylist,...>] [MYCLAUSE <myval>] => ;
            MyFunction( {<mylist>} [, <myval>] )
         MYCOMMAND MYCLAUSE 321 "HELLO"
      * fixed restricted macro match marker <x:&>

   * tests/Makefile
   - tests/pretest.prg
   + utils/hbpptest
   + utils/hbpptest/Makefile
   + utils/hbpptest/pretest.prg
      * moved file 'pretest.prg' from tests to separate directory
        to make easier validation of the preprocessor

   * TODO
      * added note to fix hb_objGetMethod() so it will not generate
        error if there is no method

   * doc/en/clipper.txt
      * added documentation for WITH OBJECT usage
2006-07-14 13:47:17 +00:00
Przemyslaw Czerpak
fbd8b70d4b 2006-03-28 13:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
    + added hb_compPCodeSize() and hb_compStrongType() declarations

  * harbour/include/hbpp.h
    * formatting

  * harbour/source/compiler/Makefile
  + harbour/source/compiler/hbstrong.c
  * harbour/source/compiler/hbpcode.c
    * moved strong typing code to separate file

  * harbour/source/compiler/hbpcode.c
    + added hb_compPCodeSize() function
    + added support for automatic size checking of variable size PCODEs
      in hb_compPCodeEval()

  * harbour/source/compiler/gencc.c
    * added escaping of '?' character in generated strings to
      avoid possible conflicts with trigraph sequences which
      are part of ANSI C standard
    * force .0 at the end of double numbers to avoid possible range
      conflicts in generated .c files
    * removed unnecessary HB_SYMBOL_UNUSED()

  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
    * added #define realloc hb_xrealloc

  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbstripl.c
    * use hb_compPCodeSize() function
    * removed not longer necessary functions for checking the real size
      of variable size PCODEs

  * harbour/source/vm/hvm.c
    * fixed RT error number in hb_vmAddInt() for negative values to be
      Clipper compatible
2006-03-28 11:00:49 +00:00
Ryszard Glab
49d728084c 2006-03-09 16:30 UTC+0100 Ryszard Glab <rglab//imid.med.pl>
* include/hbapi.h
  * include/hbexpra.c
  * include/hbexprb.c
  * include/hbexprop.h
    * modified to support strings with embeded LF/CR characters

  * source/common/hbstr.c
  * source/rtl/strings.c
    * added hb_strRemEscSeq() function that removes C-like Esc
      sequences (\n \t \r \b currently)

  * source/compiler/cmdcheck.c
    * added new command line switch
      -r=<max_recursive_preprocessor_passes>
      with defaults equal to -r=1024

  * include/hbpp.h
  * source/compiler/harbour.l
  * source/compiler/harbour.y
  * source/macro/macro.y
  * source/pp/ppcomp.c
  * source/pp/ppcore.c
  * source/pp/pplib.c
  * source/pp/pptable.c
  * source/pp/pragma.c
    * fixed compilation of #command ( => (,7
      (loops in #define or #command are trapped now)
    * fixed compilation of \[ and \] in command/translate
    * modified TEXT/ENDTEXT to use '#pragma __text'
    + added #pragma __stream and #pragma __cstream
      (examples later)
2006-03-09 15:22:16 +00:00
Ryszard Glab
e92af8dbd2 2006-02-14 16:10 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbapiitm.h
   * include/hbexpra.c
   * include/hbexprc.c
   * include/hbexprop.h
   * source/compiler/expropta.c
   * source/compiler/exproptb.c
   * source/compiler/exproptc.c
   * source/macro/macroa.c
   * source/macro/macrob.c
   * source/macro/macroc.c
   * source/vm/hvm.c
   * source/vm/itemapi.c
      * fixed code for adding date and numeric values (introduced
        in my last commits)
      * removed hb_itemPutBHLong (use hb_itemPutNInt instead)
      * added more optimization for localvar+=integer
        using HB_P_LOCALNEARADDINT pcode
        (borrowed from xHarbour)
2006-02-14 15:12:07 +00:00
Ryszard Glab
adba72912b 2006-02-14 14:40 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbexprc.c
   * source/compiler/exproptc.c
   * source/macro/macroc.c
      * disabled optimalization of compound assignment in macro compiler
2006-02-14 13:29:35 +00:00
Ryszard Glab
0e182c922d 2006-02-14 13:40 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbexprc.c
   * source/compiler/exproptc.c
   * source/macro/macroc.c
      * disabled optimalization of compound assignment for fields
2006-02-14 12:29:11 +00:00
Ryszard Glab
6f0e36f665 2006-02-14 11:40 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbapiitm.h
   * include/hbcomp.h
   * include/hbexpra.c
   * include/hbexprb.c
   * include/hbexprc.c
   * include/hbexprop.h
   * include/hbpcode.h
   * source/common/expropt1.c
   * source/common/hbfsapi.c
   * source/compiler/expropta.c
   * source/compiler/exproptb.c
   * source/compiler/exproptc.c
   * source/compiler/genc.c
   * source/compiler/harbour.c
   * source/compiler/harbour.l
   * source/compiler/harbour.y
   * source/compiler/hbdead.c
   * source/compiler/hbfix.c
   * source/compiler/hbpcode.c
   * source/compiler/hbstripl.c
   * source/macro/macro.y
   * source/macro/macroa.c
   * source/macro/macrob.c
   * source/macro/macroc.c
   * source/pp/ppcore.c
   * source/vm/hvm.c
   * source/vm/itemapi.c
      * fixed many more memory leaks in the compiler
        (the Harbour code compiles itself with no memory leaks).
        However there are still leaks when the compiler aborts
        compilation due to errors.
      + added optimalization of '+=' '-=' '*=' '/=' operators
      + added hb_itemGetNDDec(),
        hb_itemPutHBLong(),
        hb_itemPutNumType()
        borrowed from xHarbour

      NOTE: new pcodes:
      HB_[PLUS|MINUS|MULT|DIV]EQ
      HB_[PLUS|MINUS|MULT|DIV]EQPOP
      recompile all sources.
2006-02-14 10:26:58 +00:00
Ryszard Glab
a46e6aff0f 2006-01-09 14:50 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbexprb.c
   * source/compiler/exproptb.c
   * source/macro/macrob.c
      * fixed to release the memory if macro compiled code contains
        a variable or a function reference

   * source/rtl/filesys.c
      * added missing '(' to copile correctly on UNIX'es
2006-01-09 13:41:27 +00:00
Ryszard Glab
dde0793b53 2005-11-14 11:00 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbcomp.h
   * include/hberrors.h
   * include/hbexpra.c
   * include/hbexprb.c
   * include/hbexprop.h
   * include/hbhash.h
   * include/hbmacro.h
   * include/hbpcode.h
   * source/common/Makefile
   * source/common/expropt1.c
   * source/common/expropt2.c
   * source/common/hbhash.c
   * source/compiler/expropta.c
   * source/compiler/exproptb.c
   * source/compiler/genc.c
   * source/compiler/harbour.c
   * source/compiler/harbour.l
   * source/compiler/harbour.y
   * source/compiler/hbfix.c
   * source/compiler/hbgenerr.c
   * source/compiler/hbident.c
   * source/compiler/hbpcode.c
   * source/macro/macro.l
   * source/macro/macro.y
   * source/macro/macroa.c
   * source/macro/macrob.c
   * source/rtl/dates.c
   * source/vm/hvm.c
   * source/vm/macro.c
   + source/common/hbdate.c
   + tests/ddate.prg
   + tests/switch.prg
      +added support for DATE type constants in the following format:
         0dYYYYMMDD
      for example (see tests/ddate.prg for more):
      IF( dDate > 0d20051112 )

      +added support for SWITCH command (see tests/switch.prg)
         SWITCH <expr>
         CASE <integer_expression>
            ...
            [EXIT]
         CASE <string_expression>
            ...
            [EXIT]
         [OTHERWISE]
            ...
         END

   Notice:
      - Integer and string expressions can be mixed in a single
        SWITCH command with no runtime errors;
      - CASE expression have to be resolved at compile time and
        the result has to be either an integer or string constant
      - if there is no EXIT statement then next CASE is executed
        (or OTHERWISE for the last CASE)
      For example:
      CASE 1+32+2*4
      CASE CHR(64)
      CASE ASC('A')
      CASE "A"+CHR(13)

   Notice:
      The above changes apply only to FLEX version!
2005-11-14 09:47:46 +00:00
Ryszard Glab
d947f68c8e 2005-11-07 14:35 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbapi.h
   * include/hbapiitm.h
   * include/hbcomp.h
   * include/hberrors.h
   * include/hbexpra.c
   * include/hbpcode.h
   * include/hbsetup.h
   * source/common/expropt1.c
   * source/compiler/expropta.c
   * source/compiler/genc.c
   * source/compiler/gencli.c
   * source/compiler/harbour.c
   * source/compiler/harbour.l
   * source/compiler/harbour.y
   * source/compiler/hbfix.c
   * source/compiler/hbgenerr.c
   * source/compiler/hbpcode.c
   * source/macro/macroa.c
   * source/vm/hvm.c
   * source/vm/itemapi.c
   + tests/foreach.prg
      + added support for FOR EACH loop
         FOR EACH var1 [,var255] IN expr1 [,expr255] [DESCEND]
         NEXT

         Note:
            -expr can be a string or an array
               if it is a string then assigments to the control
               variable does not change the string
            -after the loop the controlling variable(s) store the
             value which they had before entering the loop
            -the controlling variable supports the following properties
             :__enumindex - the loop counter for variable
             :__enumbase  - the value that is being traversed
             :__enumvalue - the value of variable
            -see tests/foreach.prg for examples

      + added warnings in cases of duplicated loop variables
       eg. FOR i:=1 TO 5
            FOR i:=i TO i+5

      -removed strong typing in the compiler (xHarbour too)
      (reactivate it by compiling with -DHB_COMP_STRONG_TYPES)

NOTE:
   The new pcodes were added - rebuild everything
2005-11-07 13:28:40 +00:00
Ryszard Glab
0dd2bc56b7 2005-01-03 14:15 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbexprb.c
   * source/compiler/exproptb.c
   * source/macro/macrob.c
      * fixed to compile with SIMPLEX defined
      Notice: Simplex version is not updated for a long time and
      it doesn't support all fixes from FLEX version
2005-01-03 13:09:47 +00:00
Ryszard Glab
181e59a3a6 2005-01-03 10:30 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbcomp.h
   * include/hbexprb.c
   * include/hbmacro.h
   * source/compiler/exproptb.c
   * source/compiler/harbour.c
   * source/compiler/hbgenerr.c
   * source/macro/macrob.c
   * source/vm/macro.c
      * compiler reports error on the following syntax now (Clipper
        compatibility):
         {|| &macrovar <operator> anysymbol}
        "codeblock contains both macro and declared symbol reference"
        Notice, that Clipper reports error even in this case:
        MEMVAR mvar
        {|| &mvar,mvar}

   * source/vm/memvars.c
      * restored initial and expand sizes for memvars table

   * source/pp/ppcore.c
      * some empty lines added
2005-01-03 09:28:58 +00:00
Przemyslaw Czerpak
e4ac791059 2004-12-28 10:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/harbour.spec
  * harbour/hbgtmk.sh
  * harbour/make_rpm.sh
  * harbour/bin/pack_src.sh
    * updated for recent changes in make process

  * harbour/contrib/Makefile
    * added odbc lib for Linux compilation

  * harbour/contrib/btree/Makefile
    * changed lib name from hb_btree to hbtree

  * harbour/contrib/btree/hb_btree.api
  * harbour/contrib/btree/hb_btree.c
    * fixed GCC compilation in HB_TR_DEBUG mode

  * harbour/contrib/hbzlib/hbzip.h
  * harbour/contrib/hbzlib/include/hbzip.h
  * harbour/include/hbapi.h
  * harbour/include/hbapicdp.h
  * harbour/include/hbapierr.h
  * harbour/include/hbapifs.h
  * harbour/include/hbapigt.h
  * harbour/include/hbapiitm.h
  * harbour/include/hbapilng.h
  * harbour/include/hbapirdd.h
  * harbour/include/hbcomp.h
  * harbour/include/hbdate.h
  * harbour/include/hbdbsort.h
  * harbour/include/hberrors.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/include/hbhash.h
  * harbour/include/hbinit.h
  * harbour/include/hbmacro.h
  * harbour/include/hbpp.h
  * harbour/include/hbrdddel.h
  * harbour/include/hbrddntx.h
  * harbour/include/hbrddsdf.h
  * harbour/include/hbrddwrk.h
  * harbour/include/hbset.h
  * harbour/include/hbstack.h
  * harbour/include/hbtrace.h
  * harbour/include/hbvm.h
  * harbour/include/hbvmpub.h
    * changed #if defined (HB_EXTERN_C) to HB_EXTERN_BEGIN / HB_EXTERN_END
      macros for easier manipulation with different ABI
    * added HB_IS_BADITEM() macro for debugging
    * synced CDP with xHarbour - added basic Unicode support
    * synced RDD with xHarbour

  * harbour/source/codepage/Makefile
  * harbour/source/codepage/cdp_tpl.c
  * harbour/source/codepage/cdpeldos.c
  * harbour/source/codepage/cdpelwin.c
  * harbour/source/codepage/cdpesdos.c
  * harbour/source/codepage/cdpeswin.c
  * harbour/source/codepage/cdpgedos.c
  * harbour/source/codepage/cdpgewin.c
  * harbour/source/codepage/cdphu852.c
  * harbour/source/codepage/cdphuwin.c
  * harbour/source/codepage/cdppl852.c
  * harbour/source/codepage/cdppliso.c
  * harbour/source/codepage/cdpplmaz.c
  * harbour/source/codepage/cdpplwin.c
  * harbour/source/codepage/cdppt850.c
  * harbour/source/codepage/cdpptiso.c
  * harbour/source/codepage/cdpru866.c
  * harbour/source/codepage/cdprukoi.c
  * harbour/source/codepage/cdpruwin.c
  * harbour/source/codepage/cdpsl437.c
  * harbour/source/codepage/cdpsl852.c
  * harbour/source/codepage/cdpsliso.c
  * harbour/source/codepage/cdpslwin.c
  * harbour/source/codepage/cdpsrwin.c
  + harbour/source/codepage/uc1250.c
  + harbour/source/codepage/uc1251.c
  + harbour/source/codepage/uc1253.c
  + harbour/source/codepage/uc1257.c
  + harbour/source/codepage/uc737.c
  + harbour/source/codepage/uc850.c
  + harbour/source/codepage/uc852.c
  + harbour/source/codepage/uc866.c
  + harbour/source/codepage/uc88591b.c
  + harbour/source/codepage/uc8859_1.c
  + harbour/source/codepage/uc8859_2.c
  + harbour/source/codepage/uckoi8.c
  + harbour/source/codepage/uckoi8u.c
  + harbour/source/codepage/ucmaz.c
  * harbour/source/rtl/cdpapi.c
    * synced HB CDP API with xHarbour - added basic Unicode support

  * harbour/source/common/expropt2.c

  * harbour/source/common/hbstr.c
    * removed unnecessary initialization to avoid BCC warnings

  * harbour/source/compiler/harbour.c
    * formatting
      hb_compCodeBlockStop() looks like work in progress or is has
      some old unused code - Ryszard, can you look at it?

  * harbour/source/macro/macro.y
    * removed hack for GCC and old Bison versions

  * harbour/source/pp/ppcore.c
    * removed unnecessary initialization to avoid BCC warnings

  * harbour/source/pp/pptable.c
    + added some sets for RDD synchronization with xHarbour

  * harbour/source/rdd/dbcmd.c
    + added __RDDGETTEMPALIAS

  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/dbfuncs.prg
  * harbour/source/rdd/dbnubs.c
  * harbour/source/rdd/dbstrux.prg
  * harbour/source/rdd/hbdbsort.c
  * harbour/source/rdd/rddord.prg
  * harbour/source/rdd/workarea.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbfdbt/dbfdbt1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/dbfntx/dbfntx1.c
    * synchronized with xHarbour - still dbcmd.c has to be synced yet
    ! fixed all known bugs
    Alexander, please look at DBFNTX - I hope all is correct.

  * harbour/source/vm/codebloc.c
    * formatting

  * harbour/source/vm/fm.c
    + added HB_PARANOID_MEM_CHECK to force reallocations in hb_xrealloc
      and fill allocated and freed memory with HB_MEMFILER (0xff by default)
      It's for debugging only.

  * harbour/source/vm/hvm.c
    ! fixed hb_vmTopNumber() declaration for BCC
    * use hb_gcCollectAll() at HVM exit instead of hb_gcReleaseAll() to
      report allocated and not freed items - It could caused that some
      programs begin to report memory leaks.

  * harbour/source/vm/itemapi.c
    * check for HB_IS_BADITEM inside hb_itemClear() when compiled with
      HB_PARANOID_MEM_CHECK for debugging

  * harbour/source/vm/memvars.c
    * formatting
    ! fixed pItem initialization in hb_memvarDetachLocal()
      BTW - is this really necessary? I copy it form hb_itemUnRef()
      but in fact it cannot detect all possible item reference cycles
      if they appear - can they appear?
2004-12-28 09:29:30 +00:00
Przemyslaw Czerpak
ef0883bf02 2004-10-11 21:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/Makefile
  + harbour/make_bsd.sh
  + harbour/make_drw.sh
  * harbour/make_tgz.sh
  + harbour/bin/hb-func.sh
  * harbour/bin/pack_src.sh
  + harbour/bin/postinst.bat
  + harbour/bin/postinst.sh
  * harbour/config/dir.cf
  * harbour/config/bsd/gcc.cf
  * harbour/config/bsd/global.cf
  + harbour/config/darwin/dir.cf
  + harbour/config/darwin/gcc.cf
  + harbour/config/darwin/global.cf
  + harbour/config/darwin/install.cf
  * harbour/config/dos/dir.cf
  * harbour/config/dos/global.cf
  * harbour/config/dos/install.cf
  * harbour/config/dos/owatcom.cf
  * harbour/config/dos/watcom.cf
  * harbour/config/linux/gcc.cf
  * harbour/config/linux/global.cf
  * harbour/contrib/Makefile
  * harbour/contrib/dot/pp_harb.ch
  * harbour/contrib/libct/Makefile
  * harbour/contrib/libct/bit1.c
  * harbour/contrib/libct/bit2.c
  * harbour/contrib/libct/bit3.c
  * harbour/contrib/libct/files.c
  * harbour/contrib/libct/ftoc.c
  - harbour/contrib/libct/invertwin.prg
  + harbour/contrib/libct/invrtwin.prg
  * harbour/contrib/libct/keyset.c
  * harbour/contrib/libct/makefile.bc
  * harbour/contrib/libmisc/dates2.c
  * harbour/contrib/rdd_ads/ads1.c
  * harbour/contrib/rdd_ads/adsfunc.c
  * harbour/contrib/samples/date.c
  * harbour/include/dbinfo.ch
  * harbour/include/hbapi.h
  * harbour/include/hbapicdp.h
  * harbour/include/hbapifs.h
  * harbour/include/hbapigt.h
  * harbour/include/hbapiitm.h
  * harbour/include/hbcomp.h
  * harbour/include/hbdate.h
  * harbour/include/hbdbf.h
  * harbour/include/hbdbferr.h
  * harbour/include/hbdefs.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/include/hbmath.h
  * harbour/include/hbpcode.h
  * harbour/include/hbrddcdx.h
  * harbour/include/hbrdddbf.h
  * harbour/include/hbrdddbt.h
  * harbour/include/hbrddfpt.h
  * harbour/include/hbrddntx.h
  * harbour/include/hbset.h
  * harbour/include/hbsetup.h
  * harbour/include/set.ch
  * harbour/source/common/Makefile
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  - harbour/source/common/hbffind.c
  * harbour/source/common/hbfsapi.c
  * harbour/source/common/hbstr.c
  * harbour/source/common/hbver.c
  + harbour/source/common/hbverdsp.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.slx
  * harbour/source/compiler/harbour.sly
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbusage.c
  * harbour/source/compiler/simplex.c
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.slx
  * harbour/source/macro/macro.y
  * harbour/source/pp/ppcore.c
  * harbour/source/rdd/dbcmd.c
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  - harbour/source/rdd/dbfcdx/dbfcdx1.h
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/dbfntx/dbfntx1.c
  * harbour/source/rtl/Makefile
  * harbour/source/rtl/abs.c
  * harbour/source/rtl/at.c
  * harbour/source/rtl/datec.c
  * harbour/source/rtl/dates.c
  * harbour/source/rtl/dateshb.c
  * harbour/source/rtl/datesx.c
  * harbour/source/rtl/empty.c
  * harbour/source/rtl/errorapi.c
  * harbour/source/rtl/errorint.c
  * harbour/source/rtl/filesys.c
  * harbour/source/rtl/fstemp.c
  + harbour/source/rtl/hbffind.c
  * harbour/source/rtl/hbrandom.c
  * harbour/source/rtl/idle.c
  * harbour/source/rtl/inkey.c
  * harbour/source/rtl/math.c
  * harbour/source/rtl/minmax.c
  * harbour/source/rtl/pad.c
  * harbour/source/rtl/padc.c
  * harbour/source/rtl/padl.c
  * harbour/source/rtl/padr.c
  * harbour/source/rtl/philes.c
  * harbour/source/rtl/round.c
  * harbour/source/rtl/soundex.c
  * harbour/source/rtl/str.c
  * harbour/source/rtl/strcase.c
  * harbour/source/rtl/strmatch.c
  * harbour/source/rtl/strtran.c
  * harbour/source/rtl/strzero.c
  * harbour/source/rtl/substr.c
  * harbour/source/rtl/val.c
  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gtcrs/kbdcrs.c
  * harbour/source/rtl/gtdos/gtdos.c
  * harbour/source/rtl/gtsln/gtsln.c
  * harbour/source/rtl/gtsln/kbsln.c
  * harbour/source/rtl/gtsln/keytrans.c
  * harbour/source/vm/arrays.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/eval.c
  * harbour/source/vm/extend.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/macro.c
  * harbour/source/vm/memvars.c
  * harbour/source/vm/runner.c
  * harbour/tests/bldtest/bldtest.c
  * harbour/utils/hbtest/hbtest.prg
  * harbour/utils/hbtest/rt_misc.prg
  * harbour/utils/hbtest/rt_str.prg
   * Sorry but it's too much modification for full description
     cvs diff gives file 785982 bytes length. So I only count the
     main things:
   ! cleand the code (no more warning messages under Linux and GCC and
     DOS OpenWatcom) - some of them were real bugs
   ! cleaned all endian dependend code I've found - now Harbour can be
     compiled on LITLE and BIG endian machines - for some other like
     PDP ENDIAN it's enough to define proper macros in hbdefs.h
   + added macros for to get/put values in chosen byte order:
         HB_GET_LE_[U]INT{16,24,32,64}( pPtr )
         HB_GET_BE_[U]INT{16,24,32,64}( pPtr )
         HB_PUT_LE_[U]INT{16,24,32,64}( pPtr, nVal )
         HB_PUT_BE_[U]INT{16,24,32,64}( pPtr, nVal )
   + added macro HB_CAST_BYTE_NUMBERS_OFF which disables casting in
     HB_{GET|PUT}_{LE|BE}_* macros - it's necessary for some platforms
     like ALPHA DEC.
   ! cleaned the code for 64bit machines
   * changed all parameters in hb_date* functions (day, month, year, week)
     from LONG to int - it doesn't change binary compatibility for 32bit
     machines but can cause troubles with compiling the old source
   + changed HB_IT_LONG type to HB_LONG which is mapped to long long
     by default for 32 bit machines.
   + change HB_IT_INTEGER to be real 'int' C type not 'short int'
   + added HB_IS_NUMINT() macro
   + added hb_parnll, hb_stornll, hb_retnll, hbretnlllen, hb_itemPutNLL,
     hb_itemPutNLLLen, hb_itemGetNLL which operates on LONGLONG
   + added hb_parnint, hb_stornint, hb_retnint, hb_retnintlen,
     hb_itemPutNInt, hb_itemPutNIntLen, hb_itemGetNInt which operates on
     HB_LONG
   + added HB_PUSHLONGLONG pcode
   + changed compiler and optimizer to use HB_LONG numbers and reduce
     conversion from to double which may damage the 64bit number.
   + common functions for string to number conversions for compiler, RTL
     and RDD to reduce problems with differ FL values for the same number:
     hb_compStrToNum(), hb_valStrnToNum(), hb_strToNum(), hb_strnToNum()
   + common function hb_numRoun() which uses exactly the same algorithms
     as string to number conversion for the same reason - please keep
     this functions together.
   + hack inside hb_numRound() similar to the one used by CL5.3
   + hb_numInt() which uses uses the same hack as hb_numRound()
   + rewritten number to string conversion
   + some new string manipulation functions hb_strncpy(), hb_strncat(), ...
     They works differ the the C one - always set 0 at the end, the buffer
     has to be n+1 bytes length, the n is total size of buffer not the
     left free space.
   ! cleaned some code which operates on ASCIIZ string to avoid potential
     buffer overflow
   + updated RDD code - it's the first part - in few days I plan to change
     workarea structure in both projects - it will break any 3rd party RDDs
     so they have to be updated. I want to add SUPERTABLE into workarea
     to allow creating new RDD on-line.
   ! cleaned the bugs with negating integers - on most machines (like x86)
     the integers are not 0 symmetric - it means that x = -x does not work
     for {INT,LONG,LONGLONG}_MIN (hb_vmNegate, ABS())
   + cleaned error messages to be Clipper compatible.
   + updated build process for .DEB packages - now hb* scripts and shared
     libs are created by standard make install
   * added new .prg #defines: __PLATFORM__<cPlatfrom>,
     __ARCH{16|32|64}BIT__, __LITTLE_ENDIAN__|__BIG_ENDIAN__|__PDP_ENDIAN__
     !!! cPlatfrom can have lower letters (for xHarbour compatibility)
     If you do not like it please change it.
   * others ...
2004-10-11 20:44:30 +00:00
Ryszard Glab
4ff4ff3d11 2004-05-14 16:05 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* include/hbexpra.c
   * source/compiler/expropta.c
   * source/compiler/harbour.c
   * source/macro/macroa.c
   * source/rtl/tget.prg
   * source/rtl/tgetint.prg
      * fixed to be more Clipper compatible

   * source/rtl/persist.prg
      * fixed to not use xBase extensions
2004-05-14 13:58:47 +00:00