Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 57608 Details for
Bug 158192
indexing failures due to MSVC extensions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch applied to CDT 4.0 HEAD
declspec_Jan26_1.txt (text/plain), 26.57 KB, created by
Andrew Ferguson
on 2007-01-26 12:54:14 EST
(
hide
)
Description:
patch applied to CDT 4.0 HEAD
Filename:
MIME Type:
Creator:
Andrew Ferguson
Created:
2007-01-26 12:54:14 EST
Size:
26.57 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core.tests >Index: parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java,v >retrieving revision 1.24 >diff -u -r1.24 CompleteParser2Tests.java >--- parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java 15 Jul 2005 14:08:16 -0000 1.24 >+++ parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java 26 Jan 2007 16:48:34 -0000 >@@ -61,6 +61,7 @@ > import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; > import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType; > import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; >+import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; > import org.eclipse.cdt.core.parser.CodeReader; > import org.eclipse.cdt.core.parser.IScanner; > import org.eclipse.cdt.core.parser.NullLogService; >@@ -2575,6 +2576,66 @@ > writer.write("#define A( a, b ) a ## b \n"); //$NON-NLS-1$ > writer.write("#define FOOBAR 1 \n"); //$NON-NLS-1$ > writer.write("int i = A( FOO, BAR ); \n"); //$NON-NLS-1$ >- parse( writer.toString() ); >+ parse( writer.toString(), true, ParserLanguage.CPP ); >+ } >+ >+ public void test158192_declspec_on_class() throws Exception { >+ Writer writer = new StringWriter(); >+ writer.write("class __declspec(foobar) Foo1 {};\n"); >+ writer.write("union __declspec(foobar) Foo2 {};\n"); >+ writer.write("struct __declspec(foobar) Foo3 {};\n"); >+ IASTTranslationUnit tu = parse( writer.toString(), true, ParserLanguage.CPP, true ); >+ >+ CPPNameCollector col = new CPPNameCollector(); >+ tu.accept( col ); >+ >+ assertEquals( 3, col.size()); >+ ICompositeType fooClass = (ICompositeType) col.getName(0).resolveBinding(); >+ ICompositeType fooUnion = (ICompositeType) col.getName(1).resolveBinding(); >+ ICompositeType fooStruct = (ICompositeType) col.getName(2).resolveBinding(); >+ >+ assertEquals(ICPPClassType.k_class, fooClass.getKey()); >+ assertEquals(ICompositeType.k_union, fooUnion.getKey()); >+ assertEquals(ICompositeType.k_struct, fooStruct.getKey()); >+ >+ assertInstances(col, fooClass, 1); >+ assertInstances(col, fooUnion, 1); >+ assertInstances(col, fooStruct, 1); >+ } >+ >+ public void test158192_declspec_on_variable() throws Exception { >+ Writer writer = new StringWriter(); >+ writer.write("__declspec(foobar) class Foo {} bar;\n"); >+ IASTTranslationUnit tu = parse( writer.toString(), true, ParserLanguage.CPP, true); >+ >+ CPPNameCollector col = new CPPNameCollector(); >+ tu.accept( col ); >+ >+ assertEquals( 2, col.size()); >+ ICompositeType fooClass = (ICompositeType) col.getName(0).resolveBinding(); >+ ICPPVariable bar = (ICPPVariable) col.getName(1).resolveBinding(); >+ >+ assertInstances(col, fooClass, 1); >+ assertInstances(col, bar, 1); >+ } >+ >+ // MSVC does not allow declspec in this position, GCC does so we test for this >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=158192 >+ public void test158192_declspec_in_declarator() throws Exception { >+ Writer writer = new StringWriter(); >+ >+ writer.write("int * __declspec(foo) bar = 0;\n"); >+ IASTTranslationUnit tu = parse( writer.toString(), true, ParserLanguage.CPP, true); >+ >+ IASTProblem [] problems = CPPVisitor.getProblems(tu); >+ assertFalse("__declspec rejected inside declarator", problems.length>0 ); >+ >+ CPPNameCollector col = new CPPNameCollector(); >+ tu.accept( col ); >+ >+ assertEquals( 1, col.size()); >+ ICPPVariable bar = (ICPPVariable) col.getName(0).resolveBinding(); >+ >+ assertInstances(col, bar, 1); > } > } >#P org.eclipse.cdt.core >Index: parser/org/eclipse/cdt/internal/core/dom/parser/c/ANSICParserExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ANSICParserExtensionConfiguration.java,v >retrieving revision 1.5 >diff -u -r1.5 ANSICParserExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/c/ANSICParserExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.5 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/c/ANSICParserExtensionConfiguration.java 26 Jan 2007 16:48:35 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.c; > >@@ -65,4 +66,10 @@ > return false; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.cdt.internal.core.dom.parser.c.ICParserExtensionConfiguration#supportDeclspecSpecifiers() >+ */ >+ public boolean supportDeclspecSpecifiers() { >+ return false; >+ } > } >Index: parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java,v >retrieving revision 1.83 >diff -u -r1.83 GNUCSourceParser.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java 3 Jan 2007 12:01:54 -0000 1.83 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java 26 Jan 2007 16:48:36 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Rational Software - Initial API and implementation > * Markus Schorn (Wind River Systems) >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.c; > >@@ -147,7 +148,8 @@ > .supportTypeofUnaryExpressions(), config > .supportAlignOfUnaryExpression(), config > .supportKnRC(), config.supportGCCOtherBuiltinSymbols(), >- config.supportAttributeSpecifiers()); >+ config.supportAttributeSpecifiers(), >+ config.supportDeclspecSpecifiers()); > supportGCCStyleDesignators = config.supportGCCStyleDesignators(); > this.index= index; > } >@@ -1589,6 +1591,12 @@ > else > throwBacktrack(LA(1).getOffset(), LA(1).getLength()); > break; >+ case IGCCToken.t__declspec: // __declspec precedes the identifier >+ if (identifier == null && supportDeclspecSpecifiers) >+ __declspec(); >+ else >+ throwBacktrack(LA(1).getOffset(), LA(1).getLength()); >+ break; > default: > if (supportTypeOfUnaries && LT(1) == IGCCToken.t_typeof) { > typeofExpression = unaryTypeofExpression(); >@@ -1741,6 +1749,8 @@ > > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ occurs after struct/union/class and before the identifier > __attribute__(); >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __declspec occurs after struct/union/class and before the identifier >+ __declspec(); > > IToken nameToken = null; > // class name >@@ -1750,6 +1760,8 @@ > > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ occurs after struct/union/class identifier and before the { or ; > __attribute__(); >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __declspec occurs after struct/union/class and before the identifier >+ __declspec(); > > if (LT(1) != IToken.tLBRACE) { > IToken errorPoint = LA(1); >@@ -1897,6 +1909,8 @@ > // if __attribute__ is after the pointer ops and before the declarator ex: void * __attribute__((__cdecl__)) foo(); > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ is after the parameters > __attribute__(); >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __declspec is after the parameters >+ __declspec(); > > if (!pointerOps.isEmpty()) { > finalOffset = calculateEndOffset((IASTPointerOperator) pointerOps >@@ -2065,6 +2079,13 @@ > else > throwBacktrack(LA(1).getOffset(), LA(1).getLength()); > break; >+ case IGCCToken.t__declspec: >+ if(supportDeclspecSpecifiers) >+ __declspec(); >+ else >+ throwBacktrack(LA(1).getOffset(), LA(1).getLength()); >+ break; >+ > default: > break; > } >@@ -2075,7 +2096,10 @@ > > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ is after the parameters > __attribute__(); >- >+ >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __attribute__ is after the parameters >+ __declspec(); >+ > IASTDeclarator d = null; > if (numKnRCParms > 0) { > ICASTKnRFunctionDeclarator functionDecltor = createKnRFunctionDeclarator(); >Index: parser/org/eclipse/cdt/internal/core/dom/parser/c/GCCParserExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GCCParserExtensionConfiguration.java,v >retrieving revision 1.6 >diff -u -r1.6 GCCParserExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/c/GCCParserExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.6 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/c/GCCParserExtensionConfiguration.java 26 Jan 2007 16:48:35 -0000 >@@ -7,9 +7,12 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.c; > >+import org.eclipse.core.runtime.Platform; >+ > /** > * @author jcamelon > */ >@@ -65,4 +68,13 @@ > return true; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.cdt.internal.core.dom.parser.c.ICParserExtensionConfiguration#supportDeclspecSpecifiers() >+ */ >+ public boolean supportDeclspecSpecifiers() { >+ // XXX Yes, this is a hack -- should use the target platform >+ if (Platform.getOS().equals(Platform.OS_WIN32)) >+ return true; >+ return false; >+ } > } >Index: parser/org/eclipse/cdt/internal/core/dom/parser/c/ICParserExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ICParserExtensionConfiguration.java,v >retrieving revision 1.5 >diff -u -r1.5 ICParserExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/c/ICParserExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.5 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/c/ICParserExtensionConfiguration.java 26 Jan 2007 16:48:36 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.c; > >@@ -35,4 +36,10 @@ > */ > public boolean supportAttributeSpecifiers(); > >+ /** >+ * Win32 compiler extensions also supported by GCC on Win32 >+ * @return >+ */ >+ public boolean supportDeclspecSpecifiers(); >+ > } >Index: parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPParserExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPParserExtensionConfiguration.java,v >retrieving revision 1.5 >diff -u -r1.5 ICPPParserExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPParserExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.5 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPParserExtensionConfiguration.java 26 Jan 2007 16:48:37 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > > /* >@@ -32,5 +33,6 @@ > public boolean supportKnRC(); > public boolean supportGCCOtherBuiltinSymbols(); > public boolean supportAttributeSpecifiers(); >+ public boolean supportDeclspecSpecifiers(); > > } >Index: parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java,v >retrieving revision 1.114 >diff -u -r1.114 GNUCPPSourceParser.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java 26 Jan 2007 15:46:51 -0000 1.114 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java 26 Jan 2007 16:48:37 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Markus Schorn (Wind River Systems) > * Bryan Wilkinson (QNX) - https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.cpp; > >@@ -1990,7 +1991,8 @@ > super(scanner, log, mode, config.supportStatementsInExpressions(), > config.supportTypeofUnaryExpressions(), config > .supportAlignOfUnaryExpression(), config.supportKnRC(), >- config.supportGCCOtherBuiltinSymbols(), config.supportAttributeSpecifiers()); >+ config.supportGCCOtherBuiltinSymbols(), config.supportAttributeSpecifiers(), >+ config.supportDeclspecSpecifiers()); > allowCPPRestrict = config.allowRestrictPointerOperators(); > supportExtendedTemplateSyntax = config.supportExtendedTemplateSyntax(); > supportMinAndMaxOperators = config.supportMinAndMaxOperators(); >@@ -3489,6 +3491,13 @@ > else > throwBacktrack(LA(1).getOffset(), LA(1).getLength()); > break; >+ case IGCCToken.t__declspec: // if __declspec appears before identifier >+ if (duple == null && supportDeclspecSpecifiers) >+ __declspec(); >+ else >+ throwBacktrack(LA(1).getOffset(), LA(1).getLength()); >+ break; >+ > default: > if (supportTypeOfUnaries && LT(1) == IGCCToken.t_typeof) { > typeofExpression = unaryTypeofExpression(); >@@ -3870,6 +3879,8 @@ > // if __attribute__ is after the pointer ops and before the declarator ex: void * __attribute__((__cdecl__)) foo(); > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ is after the parameters > __attribute__(); >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __declspec occurs after struct/union/class and before the identifier >+ __declspec(); > > if (!pointerOps.isEmpty()) > finalOffset = calculateEndOffset((IASTNode) pointerOps >@@ -4297,7 +4308,9 @@ > > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ occurs after struct/union/class and before the identifier > __attribute__(); >- >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __declspec occurs after struct/union/class and before the identifier >+ __declspec(); >+ > // class name > if (LT(1) == IToken.tIDENTIFIER) > name = createName(name()); >@@ -4306,6 +4319,8 @@ > > if (LT(1) == IGCCToken.t__attribute__ && supportAttributeSpecifiers) // if __attribute__ occurs after struct/union/class identifier and before the { or ; > __attribute__(); >+ if (LT(1) == IGCCToken.t__declspec && supportDeclspecSpecifiers) // if __declspec occurs after struct/union/class and before the identifier >+ __declspec(); > > if (LT(1) != IToken.tCOLON && LT(1) != IToken.tLBRACE) { > IToken errorPoint = LA(1); >Index: parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GPPParserExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GPPParserExtensionConfiguration.java,v >retrieving revision 1.5 >diff -u -r1.5 GPPParserExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GPPParserExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.5 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GPPParserExtensionConfiguration.java 26 Jan 2007 16:48:37 -0000 >@@ -7,9 +7,12 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.cpp; > >+import org.eclipse.core.runtime.Platform; >+ > /** > * @author jcamelon > */ >@@ -100,4 +103,11 @@ > return true; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportDeclspecSpecifiers() >+ */ >+ public boolean supportDeclspecSpecifiers() { >+ // XXX: a hack, should use the target's platform >+ return Platform.getOS().equals(Platform.OS_WIN32); >+ } > } >Index: parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ANSICPPParserExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ANSICPPParserExtensionConfiguration.java,v >retrieving revision 1.5 >diff -u -r1.5 ANSICPPParserExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ANSICPPParserExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.5 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ANSICPPParserExtensionConfiguration.java 26 Jan 2007 16:48:36 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser.cpp; > >@@ -100,4 +101,10 @@ > return false; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportDeclspecSpecifiers() >+ */ >+ public boolean supportDeclspecSpecifiers() { >+ return false; >+ } > } >Index: parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java,v >retrieving revision 1.76 >diff -u -r1.76 AbstractGNUSourceCodeParser.java >--- parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java 3 Jan 2007 12:01:54 -0000 1.76 >+++ parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java 26 Jan 2007 16:48:35 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Rational Software - Initial API and implementation > * Markus Schorn (Wind River Systems) >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.dom.parser; > >@@ -91,13 +92,16 @@ > protected final boolean supportGCCOtherBuiltinSymbols; > > protected final boolean supportAttributeSpecifiers; >+ >+ protected final boolean supportDeclspecSpecifiers; > > protected AbstractGNUSourceCodeParser(IScanner scanner, > IParserLogService logService, ParserMode parserMode, > boolean supportStatementsInExpressions, > boolean supportTypeOfUnaries, boolean supportAlignOfUnaries, > boolean supportKnRC, boolean supportGCCOtherBuiltinSymbols, >- boolean supportAttributeSpecifiers) { >+ boolean supportAttributeSpecifiers, boolean supportDeclspecSpecifiers) { >+ > this.scanner = scanner; > this.log = wrapLogService(logService); > this.mode = parserMode; >@@ -107,6 +111,7 @@ > this.supportKnRC = supportKnRC; > this.supportGCCOtherBuiltinSymbols = supportGCCOtherBuiltinSymbols; > this.supportAttributeSpecifiers = supportAttributeSpecifiers; >+ this.supportDeclspecSpecifiers = supportDeclspecSpecifiers; > } > > protected boolean parsePassed = true; >@@ -2269,6 +2274,27 @@ > } > } > >+ protected void __declspec() throws BacktrackException, EndOfFileException { >+ IToken token = LA(1); >+ >+ if (token.getType() == IGCCToken.t__declspec) { >+ consume(); >+ >+ token = LA(1); >+ >+ if (token.getType() == IToken.tLPAREN) { >+ consume(); >+ while(true) { >+ token = LA(1); >+ consume(); >+ if (token.getType() == IToken.tRPAREN) { >+ break; >+ } >+ } >+ } >+ } >+ } >+ > /** > * In case a cast expression is followed by +/- or & we should avoid it: > * (a)+1 vs. (int)+1; >Index: parser/org/eclipse/cdt/core/parser/IGCCToken.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IGCCToken.java,v >retrieving revision 1.7 >diff -u -r1.7 IGCCToken.java >--- parser/org/eclipse/cdt/core/parser/IGCCToken.java 23 Jun 2006 17:26:58 -0000 1.7 >+++ parser/org/eclipse/cdt/core/parser/IGCCToken.java 26 Jan 2007 16:48:35 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > > package org.eclipse.cdt.core.parser; >@@ -22,5 +23,6 @@ > public static final int tMAX = tLAST + 3; > public static final int tMIN = tLAST + 4; > public static final int t__attribute__ = tLAST + 5; >+ public static final int t__declspec = tLAST + 6; > > } >Index: parser/org/eclipse/cdt/core/parser/GCCKeywords.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/GCCKeywords.java,v >retrieving revision 1.7 >diff -u -r1.7 GCCKeywords.java >--- parser/org/eclipse/cdt/core/parser/GCCKeywords.java 23 Jun 2006 17:26:58 -0000 1.7 >+++ parser/org/eclipse/cdt/core/parser/GCCKeywords.java 26 Jan 2007 16:48:35 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Rational Software - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > > package org.eclipse.cdt.core.parser; >@@ -20,9 +21,11 @@ > public static final String TYPEOF = "typeof"; //$NON-NLS-1$ > public static final String __ALIGNOF__ = "__alignof__"; //$NON-NLS-1$ > public static final String __ATTRIBUTE__ = "__attribute__"; //$NON-NLS-1$ >+ public static final String __DECLSPEC = "__declspec"; //$NON-NLS-1$ > > public static final char [] cpTYPEOF = TYPEOF.toCharArray(); > public static final char [] cp__ALIGNOF__ = __ALIGNOF__.toCharArray(); > public static final char [] cp__ATTRIBUTE__ = __ATTRIBUTE__.toCharArray(); >+ public static final char [] cp__DECLSPEC = __DECLSPEC.toCharArray(); > > } >Index: parser/org/eclipse/cdt/internal/core/parser/scanner2/GCCScannerExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/GCCScannerExtensionConfiguration.java,v >retrieving revision 1.3 >diff -u -r1.3 GCCScannerExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/parser/scanner2/GCCScannerExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.3 >+++ parser/org/eclipse/cdt/internal/core/parser/scanner2/GCCScannerExtensionConfiguration.java 26 Jan 2007 16:48:37 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.parser.scanner2; > >@@ -69,6 +70,7 @@ > result.put( GCCKeywords.cp__ALIGNOF__, IGCCToken.t___alignof__ ); > result.put( GCCKeywords.cpTYPEOF, IGCCToken.t_typeof ); > result.put( GCCKeywords.cp__ATTRIBUTE__, IGCCToken.t__attribute__ ); >+ result.put( GCCKeywords.cp__DECLSPEC, IGCCToken.t__declspec ); > return result; > } > >Index: parser/org/eclipse/cdt/internal/core/parser/scanner2/GPPScannerExtensionConfiguration.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/GPPScannerExtensionConfiguration.java,v >retrieving revision 1.3 >diff -u -r1.3 GPPScannerExtensionConfiguration.java >--- parser/org/eclipse/cdt/internal/core/parser/scanner2/GPPScannerExtensionConfiguration.java 15 Jul 2005 14:08:12 -0000 1.3 >+++ parser/org/eclipse/cdt/internal/core/parser/scanner2/GPPScannerExtensionConfiguration.java 26 Jan 2007 16:48:37 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Ed Swartz (Nokia) > *******************************************************************************/ > package org.eclipse.cdt.internal.core.parser.scanner2; > >@@ -40,6 +41,7 @@ > additionalCPPKeywords.put( Keywords.cRESTRICT, IToken.t_restrict ); > additionalCPPKeywords.put( Keywords.c_COMPLEX, IToken.t__Complex ); > additionalCPPKeywords.put( Keywords.c_IMAGINARY, IToken.t__Imaginary ); >+ additionalCPPKeywords.put( GCCKeywords.cp__DECLSPEC, IGCCToken.t__declspec ); > return additionalCPPKeywords; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 158192
:
50657
|
54881
| 57608