diff options
author | Andrew Niefer | 2005-03-23 16:25:51 +0000 |
---|---|---|
committer | Andrew Niefer | 2005-03-23 16:25:51 +0000 |
commit | 88e9c1712acd347f25d8791595c20ac5146a5fbd (patch) | |
tree | aa26349dc0ea7fa4d7b79e4d19068dd1363350b0 /core | |
parent | 8da83b1029e7f4ded362d2ebbb2ec4bb442e4e8f (diff) | |
download | org.eclipse.cdt-88e9c1712acd347f25d8791595c20ac5146a5fbd.tar.gz org.eclipse.cdt-88e9c1712acd347f25d8791595c20ac5146a5fbd.tar.xz org.eclipse.cdt-88e9c1712acd347f25d8791595c20ac5146a5fbd.zip |
tweaks to Devin's stuff that I just previously applied
Diffstat (limited to 'core')
-rw-r--r-- | core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java | 23 | ||||
-rw-r--r-- | core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/TreeObject.java | 11 |
2 files changed, 14 insertions, 20 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java index 7515f268c1f..6ca9aca8bd5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java @@ -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(); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/TreeObject.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/TreeObject.java index d40d9c30029..7954d2fb819 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/TreeObject.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/TreeObject.java @@ -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(); } |