mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
bed21120a4
commit
7aeacfdddc
4 changed files with 27 additions and 27 deletions
|
@ -110,14 +110,14 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
|
|||
/**
|
||||
* Returns the base specifiers.
|
||||
*
|
||||
* @return <code>ICPPASTBaseSpecifier []</code>
|
||||
* @return {@code ICPPASTBaseSpecifier[]}
|
||||
*/
|
||||
public ICPPASTBaseSpecifier[] getBaseSpecifiers();
|
||||
|
||||
/**
|
||||
* Adds a base specifier.
|
||||
*
|
||||
* @param baseSpec <code>ICPPASTBaseSpecifier</code>
|
||||
* @param baseSpec {@code ICPPASTBaseSpecifier}
|
||||
*/
|
||||
public void addBaseSpecifier(ICPPASTBaseSpecifier baseSpec);
|
||||
|
||||
|
|
|
@ -64,6 +64,11 @@ public class CPPASTQualifiedName extends CPPASTNameBase
|
|||
private boolean fIsFullyQualified;
|
||||
private char[] fSignature;
|
||||
|
||||
public CPPASTQualifiedName(ICPPASTName lastName) {
|
||||
if (lastName != null)
|
||||
setLastName(lastName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Prefer CPPASTQualifierName(ICPPASTName) instead.
|
||||
*/
|
||||
|
@ -71,10 +76,6 @@ public class CPPASTQualifiedName extends CPPASTNameBase
|
|||
public CPPASTQualifiedName() {
|
||||
}
|
||||
|
||||
public CPPASTQualifiedName(ICPPASTName lastName) {
|
||||
setLastName(lastName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTQualifiedName copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
|
@ -82,9 +83,8 @@ public class CPPASTQualifiedName extends CPPASTNameBase
|
|||
|
||||
@Override
|
||||
public CPPASTQualifiedName copy(CopyStyle style) {
|
||||
CPPASTQualifiedName copy = new CPPASTQualifiedName();
|
||||
if (fLastName != null)
|
||||
copy.addName(fLastName.copy(style));
|
||||
CPPASTQualifiedName copy =
|
||||
new CPPASTQualifiedName(fLastName == null ? null : fLastName.copy(style));
|
||||
for (ICPPASTNameSpecifier nameSpecifier : getQualifier()) {
|
||||
copy.addNameSpecifier(nameSpecifier == null ? null : nameSpecifier.copy(style));
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ public class ClassTypeHelper {
|
|||
}
|
||||
}
|
||||
IBinding binding = null;
|
||||
ICPPField[] result = null;
|
||||
ICPPField[] result = ICPPField.EMPTY_CPPFIELD_ARRAY;
|
||||
|
||||
IASTDeclaration[] decls = host.getCompositeTypeSpecifier().getMembers();
|
||||
for (IASTDeclaration decl : decls) {
|
||||
|
@ -220,7 +220,7 @@ public class ClassTypeHelper {
|
|||
for (IASTDeclarator dtor : dtors) {
|
||||
binding = ASTQueries.findInnermostDeclarator(dtor).getName().resolveBinding();
|
||||
if (binding instanceof ICPPField)
|
||||
result = ArrayUtil.append(ICPPField.class, result, (ICPPField) binding);
|
||||
result = ArrayUtil.append(result, (ICPPField) binding);
|
||||
}
|
||||
} else if (decl instanceof ICPPASTUsingDeclaration) {
|
||||
IASTName n = ((ICPPASTUsingDeclaration) decl).getName();
|
||||
|
@ -229,14 +229,14 @@ public class ClassTypeHelper {
|
|||
IBinding[] bs = ((ICPPUsingDeclaration) binding).getDelegates();
|
||||
for (IBinding element : bs) {
|
||||
if (element instanceof ICPPField)
|
||||
result = ArrayUtil.append(ICPPField.class, result, (ICPPField) element);
|
||||
result = ArrayUtil.append(result, (ICPPField) element);
|
||||
}
|
||||
} else if (binding instanceof ICPPField) {
|
||||
result = ArrayUtil.append(ICPPField.class, result, (ICPPField) binding);
|
||||
result = ArrayUtil.append(result, (ICPPField) binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ArrayUtil.trim(ICPPField.class, result);
|
||||
return ArrayUtil.trim(result);
|
||||
}
|
||||
|
||||
public static ICPPBase[] getBases(ICPPClassType classType, IASTNode point) {
|
||||
|
@ -378,7 +378,7 @@ public class ClassTypeHelper {
|
|||
}
|
||||
}
|
||||
IBinding binding = null;
|
||||
ICPPMethod[] result = null;
|
||||
ICPPMethod[] result = ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
||||
|
||||
IASTDeclaration[] decls = host.getCompositeTypeSpecifier().getMembers();
|
||||
for (IASTDeclaration decl : decls) {
|
||||
|
@ -391,7 +391,7 @@ public class ClassTypeHelper {
|
|||
for (IASTDeclarator dtor : dtors) {
|
||||
binding = ASTQueries.findInnermostDeclarator(dtor).getName().resolveBinding();
|
||||
if (binding instanceof ICPPMethod)
|
||||
result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) binding);
|
||||
result = ArrayUtil.append(result, (ICPPMethod) binding);
|
||||
}
|
||||
}
|
||||
} else if (decl instanceof IASTFunctionDefinition) {
|
||||
|
@ -401,7 +401,7 @@ public class ClassTypeHelper {
|
|||
dtor = ASTQueries.findInnermostDeclarator(dtor);
|
||||
binding = dtor.getName().resolveBinding();
|
||||
if (binding instanceof ICPPMethod) {
|
||||
result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) binding);
|
||||
result = ArrayUtil.append(result, (ICPPMethod) binding);
|
||||
}
|
||||
}
|
||||
} else if (decl instanceof ICPPASTUsingDeclaration) {
|
||||
|
@ -411,14 +411,14 @@ public class ClassTypeHelper {
|
|||
IBinding[] bs = ((ICPPUsingDeclaration) binding).getDelegates();
|
||||
for (IBinding element : bs) {
|
||||
if (element instanceof ICPPMethod)
|
||||
result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) element);
|
||||
result = ArrayUtil.append(result, (ICPPMethod) element);
|
||||
}
|
||||
} else if (binding instanceof ICPPMethod) {
|
||||
result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) binding);
|
||||
result = ArrayUtil.append(result, (ICPPMethod) binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ArrayUtil.trim(ICPPMethod.class, result);
|
||||
return ArrayUtil.trim(result);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -444,7 +444,7 @@ public class ClassTypeHelper {
|
|||
}
|
||||
}
|
||||
|
||||
ICPPClassType[] result = null;
|
||||
ICPPClassType[] result = ICPPClassType.EMPTY_CLASS_ARRAY;
|
||||
|
||||
IASTDeclaration[] decls = host.getCompositeTypeSpecifier().getMembers();
|
||||
for (IASTDeclaration decl : decls) {
|
||||
|
@ -460,10 +460,10 @@ public class ClassTypeHelper {
|
|||
binding = ((ICPPASTElaboratedTypeSpecifier) declSpec).getName().resolveBinding();
|
||||
}
|
||||
if (binding instanceof ICPPClassType)
|
||||
result = ArrayUtil.append(ICPPClassType.class, result, (ICPPClassType) binding);
|
||||
result = ArrayUtil.append(result, (ICPPClassType) binding);
|
||||
}
|
||||
}
|
||||
return ArrayUtil.trim(ICPPClassType.class, result);
|
||||
return ArrayUtil.trim(result);
|
||||
}
|
||||
|
||||
public static IField[] getFields(ICPPClassType ct, IASTNode point) {
|
||||
|
|
|
@ -96,8 +96,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTIfStatement;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerList;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLambdaExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLambdaExpression.CaptureDefault;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVirtSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVirtSpecifier.SpecifierKind;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTName;
|
||||
|
@ -130,6 +128,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeTransformationSpecifier;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUnaryExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDirective;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVirtSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVirtSpecifier.SpecifierKind;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNodeFactory;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUnaryTypeTransformation;
|
||||
|
@ -260,7 +260,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
int endOffset= offset;
|
||||
if (LT(1) == IToken.tCOLONCOLON) {
|
||||
endOffset= consume().getEndOffset();
|
||||
qname= nodeFactory.newQualifiedName();
|
||||
qname= nodeFactory.newQualifiedName(null);
|
||||
qname.setFullyQualified(true);
|
||||
}
|
||||
|
||||
|
@ -346,7 +346,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
|
||||
endOffset= consume().getEndOffset(); // ::
|
||||
if (qname == null) {
|
||||
qname= nodeFactory.newQualifiedName();
|
||||
qname= nodeFactory.newQualifiedName(null);
|
||||
addNameSpecifier(qname, nameSpec);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue