mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 13:55:39 +02:00
Cosmetics.
This commit is contained in:
parent
d7e43b1a2c
commit
2afbff2520
7 changed files with 24 additions and 39 deletions
|
@ -46,8 +46,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
||||||
*/
|
*/
|
||||||
public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClassTemplate,
|
public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClassTemplate,
|
||||||
ICPPInternalClassTemplate, ICPPInternalClassTypeMixinHost {
|
ICPPInternalClassTemplate, ICPPInternalClassTypeMixinHost {
|
||||||
|
private ICPPClassTemplatePartialSpecialization[] partialSpecializations;
|
||||||
private ICPPClassTemplatePartialSpecialization[] partialSpecializations = null;
|
|
||||||
private ICPPDeferredClassInstance fDeferredInstance;
|
private ICPPDeferredClassInstance fDeferredInstance;
|
||||||
private boolean addedPartialSpecializationsOfIndex;
|
private boolean addedPartialSpecializationsOfIndex;
|
||||||
|
|
||||||
|
@ -212,9 +211,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* For debug purposes only */
|
||||||
* For debug purposes only
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return ASTTypeUtil.getType(this);
|
return ASTTypeUtil.getType(this);
|
||||||
|
@ -249,7 +246,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinal() {
|
public boolean isFinal() {
|
||||||
ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
|
ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier();
|
||||||
if(typeSpecifier != null){
|
if (typeSpecifier != null) {
|
||||||
return typeSpecifier.isFinal();
|
return typeSpecifier.isFinal();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
|
|
||||||
private IASTName definition;
|
private IASTName definition;
|
||||||
private IASTName[] declarations;
|
private IASTName[] declarations;
|
||||||
private boolean checked = false;
|
private boolean checked;
|
||||||
private ICPPClassType typeInIndex;
|
private ICPPClassType typeInIndex;
|
||||||
|
|
||||||
public CPPClassType(IASTName name, IBinding indexBinding) {
|
public CPPClassType(IASTName name, IBinding indexBinding) {
|
||||||
|
@ -122,10 +122,11 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
while (parent instanceof IASTName)
|
while (parent instanceof IASTName)
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
|
||||||
if (parent instanceof IASTCompositeTypeSpecifier)
|
if (parent instanceof IASTCompositeTypeSpecifier) {
|
||||||
definition = name;
|
definition = name;
|
||||||
else
|
} else {
|
||||||
declarations = new IASTName[] { name };
|
declarations = new IASTName[] { name };
|
||||||
|
}
|
||||||
name.setBinding(this);
|
name.setBinding(this);
|
||||||
if (indexBinding instanceof ICPPClassType && indexBinding instanceof IIndexBinding) {
|
if (indexBinding instanceof ICPPClassType && indexBinding instanceof IIndexBinding) {
|
||||||
typeInIndex= (ICPPClassType) indexBinding;
|
typeInIndex= (ICPPClassType) indexBinding;
|
||||||
|
@ -408,7 +409,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
private IASTName stripQualifier(IASTName name) {
|
private IASTName stripQualifier(IASTName name) {
|
||||||
if (name instanceof ICPPASTQualifiedName) {
|
if (name instanceof ICPPASTQualifiedName) {
|
||||||
IASTName[] ns = ((ICPPASTQualifiedName)name).getNames();
|
IASTName[] ns = ((ICPPASTQualifiedName)name).getNames();
|
||||||
name = ns[ ns.length - 1 ];
|
name = ns[ns.length - 1];
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,6 @@ interface ICPPInternalClassTypeMixinHost extends ICPPClassType, ICPPInternalBind
|
||||||
*/
|
*/
|
||||||
ICPPASTCompositeTypeSpecifier getCompositeTypeSpecifier();
|
ICPPASTCompositeTypeSpecifier getCompositeTypeSpecifier();
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
ICPPClassScope getCompositeScope();
|
ICPPClassScope getCompositeScope();
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,9 @@ import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marker for bindings in the pdom
|
* Interface for bindings in the PDOM.
|
||||||
*/
|
*/
|
||||||
public interface IPDOMBinding extends IPDOMNode, IIndexFragmentBinding {
|
public interface IPDOMBinding extends IPDOMNode, IIndexFragmentBinding {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the database this binding belongs to.
|
* Returns the database this binding belongs to.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* Interface that allows to implement a class-scope.
|
* Interface that allows to implement a class-scope.
|
||||||
*/
|
*/
|
||||||
public interface IPDOMCPPClassType extends ICPPClassType, IPDOMBinding, IIndexType {
|
public interface IPDOMCPPClassType extends ICPPClassType, IPDOMBinding, IIndexType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Visits the children of the class type without using the cache. This method is
|
* Visits the children of the class type without using the cache. This method is
|
||||||
* used to populate the cache.
|
* used to populate the cache.
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.refactoring.utils;
|
package org.eclipse.cdt.internal.ui.refactoring.utils;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,19 +19,16 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
||||||
*/
|
*/
|
||||||
public enum VisibilityEnum {
|
public enum VisibilityEnum {
|
||||||
// The values are ordered by increasing visibility.
|
// The values are ordered by increasing visibility.
|
||||||
v_private("private", ICPPASTVisibilityLabel.v_private, ICPPASTBaseSpecifier.v_private), //$NON-NLS-1$
|
v_private("private", ICPPASTVisibilityLabel.v_private), //$NON-NLS-1$
|
||||||
v_protected("protected", ICPPASTVisibilityLabel.v_protected, ICPPASTBaseSpecifier.v_protected), //$NON-NLS-1$
|
v_protected("protected", ICPPASTVisibilityLabel.v_protected), //$NON-NLS-1$
|
||||||
v_public("public", ICPPASTVisibilityLabel.v_public, ICPPASTBaseSpecifier.v_public); //$NON-NLS-1$
|
v_public("public", ICPPASTVisibilityLabel.v_public); //$NON-NLS-1$
|
||||||
|
|
||||||
private final String stringRepresentation;
|
private final String stringRepresentation;
|
||||||
private final int visibilityLabelValue;
|
private final int visibilityLabelValue;
|
||||||
private final int baseSpecifierValue;
|
|
||||||
|
|
||||||
private VisibilityEnum(String stringRepresentation, int visibilityLabelValue,
|
private VisibilityEnum(String stringRepresentation, int visibilityLabelValue) {
|
||||||
int baseSpecifierValue) {
|
|
||||||
this.stringRepresentation = stringRepresentation;
|
this.stringRepresentation = stringRepresentation;
|
||||||
this.visibilityLabelValue = visibilityLabelValue;
|
this.visibilityLabelValue = visibilityLabelValue;
|
||||||
this.baseSpecifierValue = baseSpecifierValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VisibilityEnum from(ICPPASTVisibilityLabel visibility) {
|
public static VisibilityEnum from(ICPPASTVisibilityLabel visibility) {
|
||||||
|
@ -47,10 +43,6 @@ public enum VisibilityEnum {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBaseSpecifierValue() {
|
|
||||||
return baseSpecifierValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getVisibilityLabelValue() {
|
public int getVisibilityLabelValue() {
|
||||||
return visibilityLabelValue;
|
return visibilityLabelValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue