diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-26 11:11:12 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-26 11:11:12 +0000 |
commit | f8183bfe7302f9822ba3604c28780efea2dda6cf (patch) | |
tree | 4e581039572f0877bf8b1a18ef00e43a9e7ff4e5 /idlc/source | |
parent | c082fe0562e8f972efa156081daff5030b3f3c79 (diff) |
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'idlc/source')
-rw-r--r-- | idlc/source/errorhandler.cxx | 6 | ||||
-rw-r--r-- | idlc/source/idlccompile.cxx | 26 | ||||
-rw-r--r-- | idlc/source/idlcproduce.cxx | 5 | ||||
-rw-r--r-- | idlc/source/makefile.mk | 8 | ||||
-rw-r--r-- | idlc/source/options.cxx | 5 | ||||
-rw-r--r-- | idlc/source/parser.y | 30 | ||||
-rw-r--r-- | idlc/source/preproc/cpp.c | 8 | ||||
-rw-r--r-- | idlc/source/preproc/include.c | 6 | ||||
-rw-r--r-- | idlc/source/preproc/lex.c | 20 | ||||
-rw-r--r-- | idlc/source/preproc/makefile.mk | 7 | ||||
-rw-r--r-- | idlc/source/preproc/tokens.c | 6 | ||||
-rw-r--r-- | idlc/source/preproc/unix.c | 6 | ||||
-rw-r--r-- | idlc/source/scanner.ll | 10 |
13 files changed, 73 insertions, 70 deletions
diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 7d1b23fb9253..e49e24fb62c2 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -2,9 +2,9 @@ * * $RCSfile: errorhandler.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jbu $ $Date: 2001-05-09 07:57:56 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -548,7 +548,7 @@ void ErrorHandler::warning2(WarningCode w, AstDeclaration* d1, AstDeclaration* d void ErrorHandler::syntaxError(ParseState ps, sal_Int32 lineNumber, sal_Char* errmsg) { errorHeader(EIDL_SYNTAX_ERROR, lineNumber); - fprintf(stderr, "%s%s\n", parseStateToMessage(ps), errmsg + 11); + fprintf(stderr, "%s: %s\n", parseStateToMessage(ps), errmsg); idlc()->incErrorCount(); } diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index c082de99ab85..6a4fe7a6cbc5 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -2,9 +2,9 @@ * * $RCSfile: idlccompile.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: hr $ $Date: 2002-02-21 11:31:12 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,7 +85,6 @@ #include <io.h> #endif -#include <string.h> #ifdef SAL_UNX #include <unistd.h> #if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) @@ -173,10 +172,19 @@ OString makeTempName(const OString& prefix, const OString& postfix) tmpPath = OUStringToOString(uTmpPath, RTL_TEXTENCODING_UTF8); #if defined(SAL_W32) || defined(SAL_UNX) - strcpy(tmpFilePattern, tmpPath); - strcat(tmpFilePattern, PATH_SEPARATOR); - strcat(tmpFilePattern, prefix.getStr()); - strcat(tmpFilePattern, "XXXXXX"); + + OSL_ASSERT( sizeof(tmpFilePattern) > ( strlen(tmpPath) + + RTL_CONSTASCII_LENGTH( + PATH_SEPARATOR ) + + prefix.getLength() + + RTL_CONSTASCII_LENGTH( + "XXXXXX") ) ); + + tmpFilePattern[ sizeof(tmpFilePattern)-1 ] = '\0'; + strncpy(tmpFilePattern, tmpPath, sizeof(tmpFilePattern)-1); + strncat(tmpFilePattern, PATH_SEPARATOR, sizeof(tmpFilePattern)-1-strlen(tmpFilePattern)); + strncat(tmpFilePattern, prefix.getStr(), sizeof(tmpFilePattern)-1-strlen(tmpFilePattern)); + strncat(tmpFilePattern, "XXXXXX", sizeof(tmpFilePattern)-1-strlen(tmpFilePattern)); #ifdef SAL_UNX int nDescriptor = mkstemp(tmpFilePattern); @@ -195,11 +203,11 @@ OString makeTempName(const OString& prefix, const OString& postfix) Is the postfix necessarry? */ // if ( postfix.getLength() ) -// strcat(tmpFilePattern, postfix.getStr()); +// strncat(tmpFilePattern, postfix.getStr(), sizeof(tmpFilePattern)-1-strlen(tmpFilePattern)); #endif #ifdef __OS2__ - strcpy(tmpFilePattern, tempnam(NULL, prefix.getStr()); + strncpy(tmpFilePattern, tempnam(NULL, prefix.getStr()), sizeof(tmpFilePattern)-1); #endif return OString(tmpFilePattern); diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index 682fe1072d85..78da9d03a74a 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -2,9 +2,9 @@ * * $RCSfile: idlcproduce.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: hr $ $Date: 2002-02-21 11:31:12 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,7 +83,6 @@ #include <errno.h> #endif -#include <string.h> #ifdef SAL_UNX #include <unistd.h> #include <sys/stat.h> diff --git a/idlc/source/makefile.mk b/idlc/source/makefile.mk index f84b0365cc3b..c68cc567ffb0 100644 --- a/idlc/source/makefile.mk +++ b/idlc/source/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: hjs $ $Date: 2002-07-17 10:52:00 $ +# last change: $Author: hr $ $Date: 2003-03-26 12:11:09 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -147,3 +147,7 @@ $(MISC)$/stripped_scanner.ll : scanner.ll $(MISC)$/scanner.cxx: $(MISC)$/stripped_scanner.ll +flex -o$(MISC)$/scanner.cxx $(MISC)$/stripped_scanner.ll +# JSC: Please do not remove this lines !! +#$(MISC)$/parser.cxx: parser.y +# +bison -v -d -o$(MISC)$/parser.cxx parser.y +# +$(COPY) $(MISC)$/parser.cxx.h $(OUT)$/inc$/parser.hxx diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index 61bcea621320..fcc44a63c565 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -2,9 +2,9 @@ * * $RCSfile: options.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: hr $ $Date: 2002-02-21 11:31:12 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,6 @@ * ************************************************************************/ #include <stdio.h> -#include <string.h> #ifndef _IDLC_OPTIONS_HXX_ #include <idlc/options.hxx> diff --git a/idlc/source/parser.y b/idlc/source/parser.y index eeb2f1b70f05..d4e4de05d7d0 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -2,9 +2,9 @@ * * $RCSfile: parser.y,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obo $ $Date: 2002-10-29 12:54:35 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,10 +144,6 @@ int fprintf(FILE* stream, const char* format, ...) return res; } -/* - Following code not for msvc7.net compiler -*/ -#ifndef M1300 void* malloc( size_t size ) { return ::malloc(size); @@ -157,7 +153,6 @@ void free( void *memblock ) { ::free(memblock); } -#endif }; #endif @@ -527,7 +522,8 @@ interface_dcl : */ else { - pForward->setInheritedInterfaces(*$1->getInherits()); + if ( $1->getInherits() ) + pForward->setInheritedInterfaces(*$1->getInherits()); pForward->setImported(pInterface->isImported()); pForward->setInMainfile(pInterface->isInMainfile()); @@ -790,6 +786,11 @@ opt_attrflag : idlc()->setParseState(PS_RemoveableSeen); $$ = AF_REMOVEABLE; } + | error ']' + { + yyerror("unknown property|attribute flag"); + yyerrok; + } ; operation : @@ -1000,7 +1001,8 @@ constants_export : { idlc()->setParseState(PS_ConstantDeclSeen); } - ';' + ';' {}; + const_dcl : IDL_CONST @@ -1321,7 +1323,7 @@ exception_dcl : * Push the scope of the exception on the scopes stack */ idlc()->scopes()->push(pExcept); - delete $1 + delete $1; } '{' { @@ -1710,10 +1712,10 @@ type_dcl : { idlc()->setParseState(PS_TypedefSeen); } - type_declarator - | struct_type - | union_type - | enum_type + type_declarator {} + | struct_type {} + | union_type {} + | enum_type {} ; type_declarator : diff --git a/idlc/source/preproc/cpp.c b/idlc/source/preproc/cpp.c index 39d47f89cf25..6d46ed4534f3 100644 --- a/idlc/source/preproc/cpp.c +++ b/idlc/source/preproc/cpp.c @@ -2,9 +2,9 @@ * * $RCSfile: cpp.c,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jsc $ $Date: 2001-03-15 12:48:45 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,7 +77,7 @@ int ifdepth; int ifsatisfied[NIF]; int skipping; -char rcsid[] = "$Version 1.2 $ $Revision: 1.1 $ $Date: 2001-03-15 12:48:45 $"; +char rcsid[] = "$Version 1.2 $ $Revision: 1.2 $ $Date: 2003-03-26 12:11:11 $"; int realargc; char* realargv[512]; @@ -170,7 +170,7 @@ int main(int argc, char **argv) void process(Tokenrow * trp) { - int anymacros = 0; /* S390: XDBX strzt ab! */ + int anymacros = 0; for (;;) { diff --git a/idlc/source/preproc/include.c b/idlc/source/preproc/include.c index 71d9b33eab20..57b6284aedf2 100644 --- a/idlc/source/preproc/include.c +++ b/idlc/source/preproc/include.c @@ -2,9 +2,9 @@ * * $RCSfile: include.c,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jsc $ $Date: 2001-03-15 12:48:45 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,7 +63,7 @@ #include <string.h> #include <fcntl.h> -#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) && !(defined S390) +#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) # include <io.h> #else # include <unistd.h> diff --git a/idlc/source/preproc/lex.c b/idlc/source/preproc/lex.c index 3c06ac197e26..e2f89e14fbb8 100644 --- a/idlc/source/preproc/lex.c +++ b/idlc/source/preproc/lex.c @@ -2,9 +2,9 @@ * * $RCSfile: lex.c,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jsc $ $Date: 2001-03-15 12:48:45 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,7 +61,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) && !(defined S390) +#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) #include <io.h> #else #include <unistd.h> @@ -97,11 +97,7 @@ #define C_ALPH 2 #define C_NUM 3 #define C_EOF 4 -#ifdef S390 -#define C_XX 6 -#else #define C_XX 5 -#endif enum state { @@ -328,12 +324,8 @@ void continue; case C_ALPH: for (j = 0; j <= 256; j++) -#ifdef S390 - if( isalpha( j ) || (j == '_') ) -#else if ('a' <= j && j <= 'z' || 'A' <= j && j <= 'Z' || j == '_') -#endif bigfsm[j][fp->state] = nstate; continue; case C_NUM: @@ -411,7 +403,7 @@ int } } maxp = &trp->bp[trp->max]; - runelen = 1; /* S390: XDBX strzt ab! */ + runelen = 1; for (;;) { continue2: @@ -430,7 +422,7 @@ continue2: { oldstate = state; - c = *ip; /* S390: XDBX strzt (gelegentlich) ab! */ + c = *ip; if ((state = bigfsm[c][state]) >= 0) { @@ -476,7 +468,7 @@ continue2: if (c == '\n') { - while (s->inp + 1 >= s->inl && fillbuf(s) != EOF); /* S390: XDBX strzt (manchmal) ab! */ + while (s->inp + 1 >= s->inl && fillbuf(s) != EOF); if (s->inp[1] == '\r') { diff --git a/idlc/source/preproc/makefile.mk b/idlc/source/preproc/makefile.mk index 85ea1282abe2..accb69195182 100644 --- a/idlc/source/preproc/makefile.mk +++ b/idlc/source/preproc/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.2 $ +# $Revision: 1.3 $ # -# last change: $Author: hr $ $Date: 2001-09-26 14:42:47 $ +# last change: $Author: hr $ $Date: 2003-03-26 12:11:11 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -70,10 +70,9 @@ TARGETTHREAD=ST # --- Settings ----------------------------------------------------- NO_DEFAULT_STL=TRUE +LIBSALCPPRT=$(0) -.INCLUDE : svpre.mk .INCLUDE : settings.mk -.INCLUDE : sv.mk # --- Files -------------------------------------------------------- diff --git a/idlc/source/preproc/tokens.c b/idlc/source/preproc/tokens.c index 44e48a391dbe..840ae673ea81 100644 --- a/idlc/source/preproc/tokens.c +++ b/idlc/source/preproc/tokens.c @@ -2,9 +2,9 @@ * * $RCSfile: tokens.c,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jsc $ $Date: 2001-03-15 12:48:46 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,7 +62,7 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> -#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) && !(defined S390) +#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) #include <io.h> #else #include <unistd.h> diff --git a/idlc/source/preproc/unix.c b/idlc/source/preproc/unix.c index 7ca4793d7952..217be49782ac 100644 --- a/idlc/source/preproc/unix.c +++ b/idlc/source/preproc/unix.c @@ -2,9 +2,9 @@ * * $RCSfile: unix.c,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jsc $ $Date: 2001-03-15 12:48:46 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,7 +64,7 @@ #include <string.h> #include <ctype.h> #include <fcntl.h> -#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) && !(defined S390) +#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) #include <io.h> #else #include <unistd.h> diff --git a/idlc/source/scanner.ll b/idlc/source/scanner.ll index edea98f42d99..3298f370dba4 100644 --- a/idlc/source/scanner.ll +++ b/idlc/source/scanner.ll @@ -2,9 +2,9 @@ * * $RCSfile: scanner.ll,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: hjs $ $Date: 2002-03-06 13:25:45 $ + * last change: $Author: hr $ $Date: 2003-03-26 12:11:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -329,9 +329,9 @@ oneway return IDL_ONEWAY; return IDL_STRING_LITERAL; } -("-")?{DIGIT}*(e|E){1}(("+"|"-")?{DIGIT}+)+(f|F)? | -("-")?"."{DIGIT}*((e|E)("+"|"-")?{DIGIT}+)?(f|F)? | -("-")?{DIGIT}*"."{DIGIT}*((e|E)("+"|"-")?{DIGIT}+)?(f|F)? { +("-")?{DIGIT}+(e|E){1}(("+"|"-")?{DIGIT}+)+(f|F)? | +("-")?"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? | +("-")?{DIGIT}*"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? { yylval.dval = asciiToFloat( yytext ); return IDL_FLOATING_PT_LITERAL; } |