diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java
index d99156cece2..bb3c28109da 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java
@@ -495,8 +495,8 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
@Override
public void setUp() throws Exception {
cproject = cpp ?
- CProjectHelper.createCCProject(getName()+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER) :
- CProjectHelper.createCProject(getName()+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
+ CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER) :
+ CProjectHelper.createCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
Bundle b = CTestPlugin.getDefault().getBundle();
testData = TestSourceReader.getContentsForTest(b, "parser", IndexBindingResolutionTestBase.this.getClass(), getName(), 2);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTLambdaExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTLambdaExpression.java
index bf04d08f418..9c54f21d77c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTLambdaExpression.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTLambdaExpression.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@@ -16,7 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
/**
- * Lambda expression, introduced in C++0x.
+ * Lambda expression, introduced in C++11.
*
* @since 5.3
* @noextend This interface is not intended to be extended by clients.
@@ -64,8 +64,7 @@ public interface ICPPASTLambdaExpression extends ICPPASTExpression, IASTImplicit
* when creating AST for content assist.
*/
IASTCompoundStatement getBody();
-
-
+
/**
* Not allowed on frozen AST.
* @see #getCaptureDefault()
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/AbstractCPPParserExtensionConfiguration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/AbstractCPPParserExtensionConfiguration.java
index 8f7fe9ce6f8..36cef5e89bd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/AbstractCPPParserExtensionConfiguration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/AbstractCPPParserExtensionConfiguration.java
@@ -12,121 +12,79 @@
package org.eclipse.cdt.core.dom.parser.cpp;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
-import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.IToken.ContextSensitiveTokenType;
+import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.internal.core.dom.parser.GCCBuiltinSymbolProvider;
-
/**
* Abstract C++ parser extension configuration to help model C++ dialects.
*
* @since 4.0
*/
public abstract class AbstractCPPParserExtensionConfiguration implements ICPPParserExtensionConfiguration {
-
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#allowRestrictPointerOperators()
- */
@Override
public boolean allowRestrictPointerOperators() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportAlignOfUnaryExpression()
- */
@Override
public boolean supportAlignOfUnaryExpression() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportAttributeSpecifiers()
- */
@Override
public boolean supportAttributeSpecifiers() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportComplexNumbers()
- */
@Override
public boolean supportComplexNumbers() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportDeclspecSpecifiers()
- */
@Override
public boolean supportDeclspecSpecifiers() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportExtendedTemplateSyntax()
- */
@Override
public boolean supportExtendedTemplateSyntax() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportGCCOtherBuiltinSymbols()
- */
@Override
public boolean supportGCCOtherBuiltinSymbols() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportKnRC()
- */
@Override
public boolean supportKnRC() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportLongLongs()
- */
@Override
public boolean supportLongLongs() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportMinAndMaxOperators()
- */
@Override
public boolean supportMinAndMaxOperators() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportRestrictKeyword()
- */
@Override
public boolean supportRestrictKeyword() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportStatementsInExpressions()
- */
@Override
public boolean supportStatementsInExpressions() {
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#supportTypeofUnaryExpressions()
- */
@Override
public boolean supportTypeofUnaryExpressions() {
return false;
@@ -159,9 +117,6 @@ public abstract class AbstractCPPParserExtensionConfiguration implements ICPPPar
return false;
}
- /*
- * @see org.eclipse.cdt.core.dom.parser.cpp.ICPPParserExtensionConfiguration#getBuiltinBindingsProvider()
- */
@Override
public IBuiltinBindingsProvider getBuiltinBindingsProvider() {
return new GCCBuiltinSymbolProvider(ParserLanguage.CPP, supportGCCOtherBuiltinSymbols());
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguousSimpleDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguousSimpleDeclaration.java
index a896e7f1379..647af5e7717 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguousSimpleDeclaration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguousSimpleDeclaration.java
@@ -30,8 +30,9 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTInternalScope;
/**
* Handles ambiguities for parameter declarations.
- *
+ *
* void function(const D*); // is D a type? + ** @since 5.0.1 */ public class CASTAmbiguousSimpleDeclaration extends ASTAmbiguousNode implements IASTAmbiguousSimpleDeclaration { @@ -47,7 +48,7 @@ public class CASTAmbiguousSimpleDeclaration extends ASTAmbiguousNode implements @Override protected void beforeResolution() { - // populate containing scope, so that it will not be affected by the alternative branches. + // Populate containing scope, so that it will not be affected by the alternative branches. IScope scope= CVisitor.getContainingScope(this); if (scope instanceof IASTInternalScope) { ((IASTInternalScope) scope).populateCache(); @@ -94,6 +95,7 @@ public class CASTAmbiguousSimpleDeclaration extends ASTAmbiguousNode implements return fSimpleDecl.getAttributes(); } + @Deprecated @Override public void addAttribute(IASTAttribute attribute) { fSimpleDecl.addAttribute(attribute); @@ -114,18 +116,18 @@ public class CASTAmbiguousSimpleDeclaration extends ASTAmbiguousNode implements final IASTAmbiguityParent owner= (IASTAmbiguityParent) getParent(); IASTNode nodeToReplace= this; - // handle nested ambiguities first + // Handle nested ambiguities first. owner.replace(nodeToReplace, fSimpleDecl); IASTDeclSpecifier declSpec= fSimpleDecl.getDeclSpecifier(); declSpec.accept(resolver); - // find nested names + // Find nested names. final NameCollector nameCollector= new NameCollector(); declSpec.accept(nameCollector); final IASTName[] names= nameCollector.getNames(); - // resolve names + // Resolve names. boolean hasIssue= false; for (IASTName name : names) { try { @@ -140,13 +142,13 @@ public class CASTAmbiguousSimpleDeclaration extends ASTAmbiguousNode implements } } if (hasIssue) { - // use the alternate version + // Use the alternate version. final IASTAmbiguityParent parent = (IASTAmbiguityParent) fSimpleDecl; parent.replace(declSpec, fAltDeclSpec); parent.replace(fSimpleDecl.getDeclarators()[0], fAltDtor); } - // resolve further nested ambiguities + // Resolve further nested ambiguities. fSimpleDecl.accept(resolver); return fSimpleDecl; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java index 18160fab4d6..c8404e94ba4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java @@ -15,11 +15,13 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp; +import java.util.ArrayDeque; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; +import java.util.Deque; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -95,7 +97,7 @@ public class ClassTypeHelper { return new IBinding[] { new ProblemBinding(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) }; } } - ObjectSet
true
if binding
is a friend of classType
.
+ * @return {@code true} if {@code binding} is a friend of {@code classType}.
*/
public static boolean isFriend(IBinding binding, ICPPClassType classType) {
IType type;
@@ -282,7 +284,7 @@ public class ClassTypeHelper {
* @return An array of base classes in arbitrary order.
*/
public static ICPPClassType[] getAllBases(ICPPClassType classType, IASTNode point) {
- HashSettrue
if {@code subclass} is a subclass of {@code superclass}.
+ * @return {@code true} if {@code subclass} is a subclass of {@code superclass}.
*/
public static boolean isSubclass(ICPPClassType subclass, ICPPClassType superclass, IASTNode point) {
ICPPBase[] bases= getBases(subclass, point);
@@ -348,7 +350,7 @@ public class ClassTypeHelper {
* include methods declared in base classes.
*/
public static ObjectSetmember
in the host
.
- * Throws an IllegalArgumentException if member
is not a member of host
+ * Returns the visibility for a given {@code member} in the {@code host}.
+ * Throws an IllegalArgumentException if {@code member} is not a member of {@code host}
*
* @param classType The class to get the member's visibility specifier of.
- * @return the visibility of the member
.
+ * @return the visibility of the {@code member}.
*/
public static int getVisibility(ICPPInternalClassTypeMixinHost classType, IBinding member) {
if (classType.getDefinition() == null) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java
index 654a08ab043..584f60451b7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/DeclarationGeneratorImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Tomasz Wesolowski
+ * Copyright (c) 2010, 2014 Tomasz Wesolowski
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,6 +39,7 @@ import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.ast.IPointerType;
import org.eclipse.cdt.core.dom.ast.IQualifierType;
import org.eclipse.cdt.core.dom.ast.IType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNameSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
@@ -128,18 +129,19 @@ public class DeclarationGeneratorImpl extends DeclarationGenerator {
IASTDeclarator returnedDeclarator = null;
try {
- // Addition of pointer operators has to be in reverse order, so it's deferred until the end
+ // Addition of pointer operators has to be in reverse order, so it's deferred until
+ // the end.
Map