1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

tweaks to Devin's stuff that I just previously applied

This commit is contained in:
Andrew Niefer 2005-03-23 16:25:51 +00:00
parent 8da83b1029
commit 88e9c1712a
2 changed files with 14 additions and 20 deletions

View file

@ -27,12 +27,8 @@ import org.eclipse.cdt.core.parser.Keywords;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
import org.eclipse.cdt.internal.core.dom.parser.c.CASTTypeId;
import org.eclipse.cdt.internal.core.dom.parser.c.CExternalFunction;
import org.eclipse.cdt.internal.core.dom.parser.c.CExternalVariable;
import org.eclipse.cdt.internal.core.dom.parser.c.CStructure;
import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTypeId;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVisitor;
/**
@ -203,15 +199,8 @@ public class ASTTypeUtil {
break;
}
} catch (DOMException e) {}
if (type instanceof CStructure) {
result.append(SPACE);
result.append(((CStructure)type).getName());
}
if (type instanceof CPPClassType) {
result.append(SPACE);
result.append(((CPPClassType)type).getName());
}
result.append(SPACE);
result.append(((ICompositeType)type).getName());
} else if (type instanceof ICPPReferenceType) {
result.append(Keywords.cpAMPER);
} else if (type instanceof ICPPTemplateTypeParameter) {
@ -220,6 +209,8 @@ public class ASTTypeUtil {
} catch (DOMException e) {}
} else if (type instanceof IEnumeration) {
result.append(Keywords.ENUM);
result.append(SPACE);
result.append(((IEnumeration)type).getName());
} else if (type instanceof IFunctionType) {
try {
String temp = getType(((IFunctionType)type).getReturnType());
@ -312,11 +303,7 @@ public class ASTTypeUtil {
IType type = null;
try {
if (binding instanceof CExternalFunction) {
type = ((CExternalFunction)binding).getType();
} else if (binding instanceof CExternalVariable) {
type = ((CExternalVariable)binding).getType();
} else if (binding instanceof IEnumerator) {
if (binding instanceof IEnumerator) {
type = ((IEnumerator)binding).getType();
} else if (binding instanceof IFunction) {
type = ((IFunction)binding).getType();

View file

@ -308,8 +308,9 @@ public class TreeObject implements IAdaptable {
return filterFlag;
}
private class ASTPropertySource implements IPropertySource {
private static class ASTPropertySource implements IPropertySource {
private static final String OPEN_PAREN = " ("; //$NON-NLS-1$
private static final String CLOSE_PAREN = ")"; //$NON-NLS-1$
private static final String L_BRACKET_STRING = "["; //$NON-NLS-1$
private static final String R_BRACKET_STRING = "]"; //$NON-NLS-1$
private static final String CLONE_METHOD_NAME = "clone"; //$NON-NLS-1$
@ -467,6 +468,12 @@ public class TreeObject implements IAdaptable {
} else
buffer.append(trimObjectToString(obj.toString()));
if( obj instanceof IBinding ){
buffer.append( OPEN_PAREN );
buffer.append( Integer.toHexString(obj.hashCode()) );
buffer.append( CLOSE_PAREN );
}
return buffer.toString();
}