mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
More cleanup of template resolution code.
This commit is contained in:
parent
f03642cfb3
commit
398615b6fa
4 changed files with 36 additions and 19 deletions
|
@ -42,16 +42,6 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
|
|||
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)
|
||||
* @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();
|
||||
}
|
||||
|
||||
/* (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)
|
||||
* @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 {
|
||||
IBinding result = this;
|
||||
IType t = (IType) argMap.get(scopeBinding);
|
||||
if (t == null && scopeBinding instanceof CPPUnknownBinding) {
|
||||
IBinding binding = ((CPPUnknownBinding) scopeBinding).resolveUnknown(argMap);
|
||||
if (t == null && scopeBinding instanceof ICPPInternalUnknownClassType) {
|
||||
IBinding binding = ((ICPPInternalUnknownClassType) scopeBinding).resolveUnknown(argMap);
|
||||
if (binding instanceof IType) {
|
||||
t = (IType) binding;
|
||||
}
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
* Created on May 3, 2005
|
||||
*/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
|
@ -31,7 +28,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
|||
*
|
||||
* @author aniefer
|
||||
*/
|
||||
public class CPPUnknownClass extends CPPUnknownBinding implements ICPPClassType {
|
||||
public class CPPUnknownClass extends CPPUnknownBinding implements ICPPInternalUnknownClassType {
|
||||
|
||||
/**
|
||||
* @param name
|
||||
|
@ -117,7 +114,7 @@ public class CPPUnknownClass extends CPPUnknownBinding implements ICPPClassType
|
|||
return getUnknownScope();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
||||
*/
|
||||
public boolean isSameType(IType type) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
|||
*
|
||||
* @author Sergey Prigogin
|
||||
*/
|
||||
public interface ICPPInternalUnknownClassInstance extends ICPPClassTemplate, ICPPInternalUnknown,
|
||||
ICPPInternalClassTemplate {
|
||||
public interface ICPPInternalUnknownClassInstance extends ICPPClassTemplate, ICPPInternalClassTemplate,
|
||||
ICPPInternalUnknownClassType {
|
||||
public IType[] getArguments();
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
Loading…
Add table
Reference in a new issue