1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-07-13 22:02:40 -07:00
parent e477f03d08
commit 45e67ddcf2
24 changed files with 88 additions and 94 deletions

View file

@ -15,10 +15,7 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IASTTypeId extends IASTNode { public interface IASTTypeId extends IASTNode {
/** public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = {};
* Constant.
*/
public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = new IASTTypeId[0];
/** /**
* <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTTypeId</code> * <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTTypeId</code>
@ -35,7 +32,7 @@ public interface IASTTypeId extends IASTNode {
"IASTTypeId.ABSTRACT_DECLARATOR - IASTDeclarator for IASTTypeId"); //$NON-NLS-1$ "IASTTypeId.ABSTRACT_DECLARATOR - IASTDeclarator for IASTTypeId"); //$NON-NLS-1$
/** /**
* Get the decl specifier. * Returns the decl specifier.
* @return <code>IASTDeclSpecifier</code> * @return <code>IASTDeclSpecifier</code>
*/ */
public IASTDeclSpecifier getDeclSpecifier(); public IASTDeclSpecifier getDeclSpecifier();
@ -54,7 +51,7 @@ public interface IASTTypeId extends IASTNode {
public IASTDeclarator getAbstractDeclarator(); public IASTDeclarator getAbstractDeclarator();
/** /**
* Set the abstract declarator. * Sets the abstract declarator.
* @param abstractDeclarator <code>IASTDeclarator</code> * @param abstractDeclarator <code>IASTDeclarator</code>
*/ */
public void setAbstractDeclarator(IASTDeclarator abstractDeclarator); public void setAbstractDeclarator(IASTDeclarator abstractDeclarator);

View file

@ -16,7 +16,6 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IASTTypeIdExpression extends IASTExpression { public interface IASTTypeIdExpression extends IASTExpression {
/** /**
* <code>op_sizeof</code> sizeof (typeId) expression * <code>op_sizeof</code> sizeof (typeId) expression
*/ */

View file

@ -17,7 +17,6 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IASTWhileStatement extends IASTStatement { public interface IASTWhileStatement extends IASTStatement {
/** /**
* <code>CONDITIONEXPRESSION</code> represents the relationship between an <code>IASTWhileStatement</code> and * <code>CONDITIONEXPRESSION</code> represents the relationship between an <code>IASTWhileStatement</code> and
* it's nested <code>IASTExpression</code>. * it's nested <code>IASTExpression</code>.

View file

@ -19,7 +19,6 @@ package org.eclipse.cdt.core.dom.ast;
* @since 5.3 * @since 5.3
*/ */
public interface ICPPASTCompletionContext extends IASTCompletionContext { public interface ICPPASTCompletionContext extends IASTCompletionContext {
/** /**
* Returns bindings that start with the given name or prefix, only considering those that are valid for * Returns bindings that start with the given name or prefix, only considering those that are valid for
* this context, including those in the requested set of namespaces. * this context, including those in the requested set of namespaces.

View file

@ -21,15 +21,16 @@ public interface ICompositeType extends IBinding, IType {
public static final int k_union = IASTCompositeTypeSpecifier.k_union; public static final int k_union = IASTCompositeTypeSpecifier.k_union;
/** /**
* Returns the type of the composite, {@link #k_struct}, {@link #k_union}, or * Returns the type of the composite, {@link #k_struct}, {@link #k_union},
* {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#k_class}. * or {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#k_class}.
*/ */
public int getKey(); public int getKey();
/** /**
* Returns whether the type is anonymous or not. A type for which objects or * Returns whether the type is anonymous or not. A type for which objects or
* pointers are declared is not considered an anonymous type. * pointers are declared is not considered an anonymous type.
* <pre> struct Outer { * <pre>
* struct Outer {
* struct {int a;}; // anonymous * struct {int a;}; // anonymous
* struct {int b;} c; // not anonymous * struct {int b;} c; // not anonymous
* } * }

View file

@ -10,11 +10,10 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp; package org.eclipse.cdt.core.dom.ast.cpp;
/** /**
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPConstructor extends ICPPMethod { public interface ICPPConstructor extends ICPPMethod {
public static final ICPPConstructor [] EMPTY_CONSTRUCTOR_ARRAY = new ICPPConstructor[0]; public static final ICPPConstructor[] EMPTY_CONSTRUCTOR_ARRAY = {};
} }

View file

@ -21,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IType;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPEnumeration extends IEnumeration, ICPPBinding { public interface ICPPEnumeration extends IEnumeration, ICPPBinding {
/** /**
* Returns whether this enumeration is scoped. * Returns whether this enumeration is scoped.
* An enumeration can only be scoped in C++. * An enumeration can only be scoped in C++.

View file

@ -17,6 +17,5 @@ import org.eclipse.cdt.core.dom.ast.IField;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPField extends IField, ICPPMember, ICPPVariable { public interface ICPPField extends IField, ICPPMember, ICPPVariable {
public static final ICPPField [] EMPTY_CPPFIELD_ARRAY = new ICPPField[0]; public static final ICPPField[] EMPTY_CPPFIELD_ARRAY = {};
} }

View file

@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPFunctionScope extends ICPPScope { public interface ICPPFunctionScope extends ICPPScope {
/** /**
* Get the scope representing the function body. returns null if there is no * Get the scope representing the function body. returns null if there is no
* function definition * function definition

View file

@ -17,5 +17,4 @@ package org.eclipse.cdt.core.dom.ast.cpp;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
*/ */
public interface ICPPFunctionTemplate extends ICPPFunction, ICPPTemplateDefinition { public interface ICPPFunctionTemplate extends ICPPFunction, ICPPTemplateDefinition {
} }

View file

@ -91,7 +91,8 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return CPPSemantics.resolveAmbiguities(name, specs); return CPPSemantics.resolveAmbiguities(name, specs);
} }
@Deprecated @Override @Deprecated
@Override
final public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, final public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup,
IIndexFileSet fileSet) { IIndexFileSet fileSet) {
return getBindings(new ScopeLookupData(name, resolve, prefixLookup)); return getBindings(new ScopeLookupData(name, resolve, prefixLookup));

View file

@ -15,8 +15,8 @@ import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousCastVsFunctionCallExpression; import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousCastVsFunctionCallExpression;
public class CPPASTAmbiguousCastVsFunctionCallExpression extends public class CPPASTAmbiguousCastVsFunctionCallExpression
ASTAmbiguousCastVsFunctionCallExpression implements ICPPASTExpression { extends ASTAmbiguousCastVsFunctionCallExpression implements ICPPASTExpression {
public CPPASTAmbiguousCastVsFunctionCallExpression(IASTCastExpression castExpr, IASTFunctionCallExpression funcCall) { public CPPASTAmbiguousCastVsFunctionCallExpression(IASTCastExpression castExpr, IASTFunctionCallExpression funcCall) {
super(castExpr, funcCall); super(castExpr, funcCall);

View file

@ -18,9 +18,8 @@ import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousNode; import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousNode;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression; import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression;
public class CPPASTAmbiguousExpression extends ASTAmbiguousNode implements public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
IASTAmbiguousExpression, ICPPASTExpression { implements IASTAmbiguousExpression, ICPPASTExpression {
private IASTExpression[] exp = new IASTExpression[2]; private IASTExpression[] exp = new IASTExpression[2];
private int expPos= -1; private int expPos= -1;
@ -29,7 +28,6 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode implements
addExpression(e); addExpression(e);
} }
@Override @Override
public IASTExpression copy() { public IASTExpression copy() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View file

@ -34,9 +34,8 @@ import org.eclipse.core.runtime.Assert;
* <br> * <br>
* template<typename... T> void function(T ...); // is T a parameter pack? * template<typename... T> void function(T ...); // is T a parameter pack?
*/ */
public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode implements public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode
IASTAmbiguousParameterDeclaration, ICPPASTParameterDeclaration { implements IASTAmbiguousParameterDeclaration, ICPPASTParameterDeclaration {
private ICPPASTParameterDeclaration fParameterDecl; private ICPPASTParameterDeclaration fParameterDecl;
public CPPASTAmbiguousParameterDeclaration(ICPPASTParameterDeclaration decl) { public CPPASTAmbiguousParameterDeclaration(ICPPASTParameterDeclaration decl) {
@ -48,7 +47,6 @@ public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode implem
assert false; assert false;
} }
@Override @Override
protected final IASTNode doResolveAmbiguity(ASTVisitor resolver) { protected final IASTNode doResolveAmbiguity(ASTVisitor resolver) {
final IASTAmbiguityParent owner= (IASTAmbiguityParent) getParent(); final IASTAmbiguityParent owner= (IASTAmbiguityParent) getParent();

View file

@ -32,9 +32,10 @@ public class CPPASTAmbiguousStatement extends ASTAmbiguousNode implements IASTAm
private IASTDeclaration fDeclaration; private IASTDeclaration fDeclaration;
public CPPASTAmbiguousStatement(IASTStatement... statements) { public CPPASTAmbiguousStatement(IASTStatement... statements) {
for (IASTStatement s : statements) for (IASTStatement s : statements) {
addStatement(s); addStatement(s);
} }
}
@Override @Override
protected void beforeResolution() { protected void beforeResolution() {

View file

@ -33,11 +33,11 @@ import org.eclipse.core.runtime.Assert;
* Ambiguity node for deciding between type-id and id-expression in a template argument. * Ambiguity node for deciding between type-id and id-expression in a template argument.
*/ */
public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements ICPPASTAmbiguousTemplateArgument { public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements ICPPASTAmbiguousTemplateArgument {
private List<IASTNode> fNodes; private List<IASTNode> fNodes;
/** /**
* @param nodes nodes of type {@link IASTTypeId}, {@link IASTIdExpression} or {@link ICPPASTPackExpansionExpression}. * @param nodes nodes of type {@link IASTTypeId}, {@link IASTIdExpression}
* or {@link ICPPASTPackExpansionExpression}.
*/ */
public CPPASTAmbiguousTemplateArgument(IASTNode... nodes) { public CPPASTAmbiguousTemplateArgument(IASTNode... nodes) {
fNodes= new ArrayList<IASTNode>(2); fNodes= new ArrayList<IASTNode>(2);
@ -57,7 +57,6 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
} }
} }
@Override @Override
protected void beforeAlternative(IASTNode node) { protected void beforeAlternative(IASTNode node) {
// The name may be shared between the alternatives make sure it's parent is set correctly // The name may be shared between the alternatives make sure it's parent is set correctly
@ -77,13 +76,11 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
} }
} }
@Override @Override
protected void afterResolution(ASTVisitor resolver, IASTNode best) { protected void afterResolution(ASTVisitor resolver, IASTNode best) {
beforeAlternative(best); beforeAlternative(best);
} }
@Override @Override
public IASTNode copy() { public IASTNode copy() {
return copy(CopyStyle.withoutLocations); return copy(CopyStyle.withoutLocations);
@ -91,7 +88,6 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
@Override @Override
public IASTNode copy(CopyStyle style) { public IASTNode copy(CopyStyle style) {
int sizeOfNodes = fNodes.size(); int sizeOfNodes = fNodes.size();
IASTNode[] copyNodes = new IASTNode[sizeOfNodes]; IASTNode[] copyNodes = new IASTNode[sizeOfNodes];
int arrayIndex = 0; int arrayIndex = 0;

View file

@ -16,7 +16,17 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.*; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.ALLCVQ;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.ARRAY;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.CVTYPE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.MPTR;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.PTR;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.calculateInheritanceDepth;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateTypeUptoPointers;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.isConversionOperator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;