Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2008-03-31 03:48:07 +0000
committerSergey Prigogin2008-03-31 03:48:07 +0000
commit398615b6fa8d91180716895774a047a4ff7a524b (patch)
treeb2ed1f31dd6d5e5a2b2a5b30be18aa839e505506 /core/org.eclipse.cdt.core
parentf03642cfb3f2673e96610756dd0e36269fb34aa2 (diff)
downloadorg.eclipse.cdt-398615b6fa8d91180716895774a047a4ff7a524b.tar.gz
org.eclipse.cdt-398615b6fa8d91180716895774a047a4ff7a524b.tar.xz
org.eclipse.cdt-398615b6fa8d91180716895774a047a4ff7a524b.zip
More cleanup of template resolution code.
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassInstance.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassType.java20
4 files changed, 36 insertions, 19 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java
index d0e60ff473e..ceba6e6b979 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java
@@ -43,16 +43,6 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
}
/* (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()
*/
public IASTNode[] getDeclarations() {
@@ -127,13 +117,23 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
}
/* (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;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
index ab8890cae99..ced7737bc7c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
@@ -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) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassInstance.java
index 0565031bcf7..1e126e2a9f9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassInstance.java
@@ -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();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassType.java
new file mode 100644
index 00000000000..8f723ec4e20
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalUnknownClassType.java
@@ -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 {
+}

Back to the top