1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

More cleanup of template resolution code.

This commit is contained in:
Sergey Prigogin 2008-03-31 03:48:07 +00:00
parent f03642cfb3
commit 398615b6fa
4 changed files with 36 additions and 19 deletions

View file

@ -42,16 +42,6 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
this.scopeBinding = scopeBinding; this.scopeBinding = scopeBinding;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknown#getUnknownScope()
*/
public ICPPScope getUnknownScope() {
if (unknownScope == null) {
unknownScope = new CPPUnknownScope(this, name);
}
return unknownScope;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDeclarations() * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDeclarations()
*/ */
@ -126,14 +116,24 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
return scopeBinding.getUnknownScope(); return scopeBinding.getUnknownScope();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknown#getUnknownScope()
*/
public ICPPScope getUnknownScope() {
if (unknownScope == null) {
unknownScope = new CPPUnknownScope(this, name);
}
return unknownScope;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknown#resolveUnknown(org.eclipse.cdt.core.parser.util.ObjectMap) * @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknown#resolveUnknown(org.eclipse.cdt.core.parser.util.ObjectMap)
*/ */
public IBinding resolveUnknown(ObjectMap argMap) throws DOMException { public IBinding resolveUnknown(ObjectMap argMap) throws DOMException {
IBinding result = this; IBinding result = this;
IType t = (IType) argMap.get(scopeBinding); IType t = (IType) argMap.get(scopeBinding);
if (t == null && scopeBinding instanceof CPPUnknownBinding) { if (t == null && scopeBinding instanceof ICPPInternalUnknownClassType) {
IBinding binding = ((CPPUnknownBinding) scopeBinding).resolveUnknown(argMap); IBinding binding = ((ICPPInternalUnknownClassType) scopeBinding).resolveUnknown(argMap);
if (binding instanceof IType) { if (binding instanceof IType) {
t = (IType) binding; t = (IType) binding;
} }

View file

@ -10,9 +10,6 @@
* Sergey Prigogin (Google) * Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
/*
* Created on May 3, 2005
*/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
@ -31,7 +28,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
* *
* @author aniefer * @author aniefer
*/ */
public class CPPUnknownClass extends CPPUnknownBinding implements ICPPClassType { public class CPPUnknownClass extends CPPUnknownBinding implements ICPPInternalUnknownClassType {
/** /**
* @param name * @param name
@ -117,7 +114,7 @@ public class CPPUnknownClass extends CPPUnknownBinding implements ICPPClassType
return getUnknownScope(); return getUnknownScope();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType) * @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
*/ */
public boolean isSameType(IType type) { public boolean isSameType(IType type) {

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
* *
* @author Sergey Prigogin * @author Sergey Prigogin
*/ */
public interface ICPPInternalUnknownClassInstance extends ICPPClassTemplate, ICPPInternalUnknown, public interface ICPPInternalUnknownClassInstance extends ICPPClassTemplate, ICPPInternalClassTemplate,
ICPPInternalClassTemplate { ICPPInternalUnknownClassType {
public IType[] getArguments(); public IType[] getArguments();
} }

View file

@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 2008 Google, Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sergey Prigogin (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknown;
/*
* @author Sergey Prigogin
*/
public interface ICPPInternalUnknownClassType extends ICPPClassType, ICPPInternalUnknown {
}