2006-11-21 05:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/compiler/complex.c
  + harbour/source/compiler/hbcomp.c
    * added missing header and file in my previous commit
This commit is contained in:
Przemyslaw Czerpak
2006-11-21 04:06:19 +00:00
parent 0cada37011
commit b78cf8e34b
3 changed files with 140 additions and 102 deletions

View File

@@ -8,6 +8,11 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
detail description will have to take me few days.
2006-11-21 14:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
+ added missing compiler/hbcomp.c file
2006-11-21 05:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/compiler/complex.c

View File

@@ -1,110 +1,62 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* compiler lexer which converts PP tokens to the ones which
* grammar parser generated by bison can understand
*
* Copyright 2006 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbpp.h"
#include "hbcomp.h"
#include "hbdate.h"
#include "harboury.h"
/*
keywords:
ANNO[UNCE] -> ANNOUNCE
BEGI[N] SEQU[ENCE]-> BEGINSEQ
BREA[K] -> BREAK
CASE -> CASE
_PROCREQ_( -> PROCREQ
DECL[ARE] -> DECLARE, PRIVATE, IDENTIFIER
OPTI[ONAL] -> OPTIONAL
DO -> DO
DO CASE -> DOCASE
DO WHILE -> WHILE
DESCEND -> DESCEND
ELSE -> ELSE
ELSEI[F] -> ELSEIF
END SEQU[ENCE] -> END
ENDI[F] -> ENDIF
ENDC[ASE] -> ENDCASE
ENDD[O] -> ENDDO
END -> END
EXIT -> EXIT
EXTE[RNAL] -> EXTERN
_FIE[LD] -> FIELD
FIEL[D] -> FIELD
FOR -> FOR
FOR EACH -> FOREACH
FUNC[TION] -> FUNCTION
HB_INLINE -> ???
IIF -> IIF
IF -> IF, IIF
IN -> IN
INIT -> INIT
LOOP -> LOOP
MEMV[AR] -> MEMVAR
NEXT -> NEXT
NIL -> NIL
OTHE[RWISE] -> OTHERWISE
PARA[METERS] -> PARAMETERS
PRIV[ATE] -> PRIVATE
PROC[EDURE] -> PROCEDURE
PUBL[IC] -> PUBLIC
QSELF() -> SELF
RECO[VER] -> RECOVER
RECO[VER] USIN[G] -> RECOVERUSING
RETU[RN] -> RETURN
STAT[IC] -> STATIC
STEP -> STEP
SWITCH -> DOSWITCH
TO -> TO
WHILE -> WHILE
WITH -> WITH
WITH OBJECT -> WITHOBJECT
AS ARRA[Y] -> AS_ARRAY
AS CODE[BLOCK] -> AS_BLOCK
AS STRI[NG] -> AS_CHARACTER
AS CHAR[ACTER] -> AS_CHARACTER
AS CLAS[S] -> AS_CLASS
AS DATE -> AS_DATE
AS LOGI[CAL] -> AS_LOGICAL
AS NUME[RIC] -> AS_NUMERIC
AS OBJE[CT] -> AS_OBJECT
AS USUA[L] -> AS_VARIANT
AS ANYT[YPE] -> AS_VARIANT
AS ARRA[Y] OF USUA[L] -> AS_ARRAY
AS ARRA[Y] OF ANYT[YPE] -> AS_ARRAY
AS ARRA[Y] OF ARRA[Y] -> AS_ARRAY_ARRAY
AS ARRA[Y] OF CODE[BLOCK] -> AS_BLOCK_ARRAY
AS ARRA[Y] OF STRI[NG] -> AS_CHARACTER_ARRAY
AS ARRA[Y] OF CHAR[ACTER] -> AS_CHARACTER_ARRAY
AS ARRA[Y] OF CLAS[S] -> AS_CLASS_ARRAY
AS ARRA[Y] OF DATE -> AS_DATE_ARRAY
AS ARRA[Y] OF LOGI[CAL] -> AS_LOGICAL_ARRAY
AS ARRA[Y] OF NUME[RIC] -> AS_NUMERIC_ARRAY
AS ARRA[Y] OF OBJE[CT] -> AS_OBJECT_ARRAY
_HB_CLASS -> DECLARE_CLASS
_HB_MEMBER -> DECLARE_MEMBER
iState usage:
'[': OPERATOR, LSEPARATOR, LARRAY, IF, ELSEIF, CASE, BREAK,
RETURN, WITH, WHILE
break: LOOKUP
case: LOOKUP
declare: DO
do: LOOKUP
end: LOOKUP
field: LOOKUP
for: LOOKUP
iif: FUNCTION, PROCEDURE
if: FUNCTION, PROCEDURE, LOOKUP
init: LOOKUP
next: LOOKUP
otherwise: LOOKUP
recover: LOOKUP
return: LOOKUP
switch: LOOKUP
while: DO, LOOKUP
whith: LOOKUP, DO, WHILE, MACROVAR, MACROTEXT, IDENTIFIER,
RSEPARATOR
*/
#define HB_PP_LEX_SELF(t) ( HB_PP_TOKEN_TYPE((t)->type) == HB_PP_TOKEN_SEND && \
(t)->pNext && t->pNext->spaces == 0 && \
HB_PP_TOKEN_TYPE((t)->pNext->type) == HB_PP_TOKEN_SEND )

View File

@@ -0,0 +1,81 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* allocate/free new compiler context
*
* Copyright 2006 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbcomp.h"
HB_COMP_PTR hb_comp_new( void )
{
HB_COMP_PTR pComp = NULL;
PHB_PP_STATE pPP = hb_pp_new();
if( pPP )
{
pComp = ( HB_COMP_PTR ) hb_xgrab( sizeof( HB_COMP ) );
memset( pComp, 0, sizeof( HB_COMP ) );
pComp->pLex = ( PHB_COMP_LEX ) hb_xgrab( sizeof( HB_COMP_LEX ) );
memset( pComp->pLex, 0, sizeof( HB_COMP_LEX ) );
pComp->pLex->pPP = pPP;
}
return pComp;
}
void hb_comp_free( HB_COMP_PTR pComp )
{
if( pComp->pLex )
{
if( pComp->pLex->pPP )
hb_pp_free( pComp->pLex->pPP );
hb_xfree( pComp->pLex );
}
hb_xfree( pComp );
}