Lines 14-19
Link Here
|
14 |
|
14 |
|
15 |
import org.eclipse.cdt.core.dom.IPDOMNode; |
15 |
import org.eclipse.cdt.core.dom.IPDOMNode; |
16 |
import org.eclipse.cdt.core.dom.IPDOMVisitor; |
16 |
import org.eclipse.cdt.core.dom.IPDOMVisitor; |
|
|
17 |
import org.eclipse.cdt.core.dom.ast.DOMException; |
17 |
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression; |
18 |
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression; |
18 |
import org.eclipse.cdt.core.dom.ast.IASTIdExpression; |
19 |
import org.eclipse.cdt.core.dom.ast.IASTIdExpression; |
19 |
import org.eclipse.cdt.core.dom.ast.IASTName; |
20 |
import org.eclipse.cdt.core.dom.ast.IASTName; |
Lines 42-47
Link Here
|
42 |
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier; |
43 |
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier; |
43 |
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage; |
44 |
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage; |
44 |
import org.eclipse.cdt.core.model.ILanguage; |
45 |
import org.eclipse.cdt.core.model.ILanguage; |
|
|
46 |
import org.eclipse.cdt.internal.core.Util; |
45 |
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBlockScope; |
47 |
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBlockScope; |
46 |
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitMethod; |
48 |
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitMethod; |
47 |
import org.eclipse.cdt.internal.core.pdom.PDOM; |
49 |
import org.eclipse.cdt.internal.core.pdom.PDOM; |
Lines 115-156
Link Here
|
115 |
return null; |
117 |
return null; |
116 |
|
118 |
|
117 |
PDOMBinding pdomBinding = adaptBinding(binding); |
119 |
PDOMBinding pdomBinding = adaptBinding(binding); |
118 |
if (pdomBinding == null) { |
120 |
try { |
119 |
PDOMNode parent = getAdaptedParent(binding); |
121 |
if (pdomBinding == null) { |
120 |
if (parent != null) { |
122 |
PDOMNode parent = getAdaptedParent(binding); |
121 |
if (binding instanceof ICPPField && parent instanceof PDOMCPPClassType) |
123 |
if (parent != null) { |
122 |
pdomBinding = new PDOMCPPField(pdom, (PDOMCPPClassType)parent, name); |
124 |
if (binding instanceof ICPPField && parent instanceof PDOMCPPClassType) |
123 |
else if (binding instanceof ICPPVariable) { |
125 |
pdomBinding = new PDOMCPPField(pdom, (PDOMCPPClassType)parent, name); |
124 |
if (!(binding.getScope() instanceof CPPBlockScope)) |
126 |
else if (binding instanceof ICPPVariable) { |
125 |
pdomBinding = new PDOMCPPVariable(pdom, parent, name); |
127 |
if (!(binding.getScope() instanceof CPPBlockScope)) |
126 |
} else if (binding instanceof ICPPMethod && parent instanceof PDOMCPPClassType) { |
128 |
pdomBinding = new PDOMCPPVariable(pdom, parent, name); |
127 |
pdomBinding = new PDOMCPPMethod(pdom, parent, name); |
129 |
} else if (binding instanceof ICPPMethod && parent instanceof PDOMCPPClassType) { |
128 |
} else if (binding instanceof CPPImplicitMethod && parent instanceof PDOMCPPClassType) { |
|
|
129 |
if(!name.isReference()) { |
130 |
//because we got the implicit method off of an IASTName that is not a reference, |
131 |
//it is no longer completly implicit and it should be treated as a normal method. |
132 |
pdomBinding = new PDOMCPPMethod(pdom, parent, name); |
130 |
pdomBinding = new PDOMCPPMethod(pdom, parent, name); |
|
|
131 |
} else if (binding instanceof CPPImplicitMethod && parent instanceof PDOMCPPClassType) { |
132 |
if(!name.isReference()) { |
133 |
//because we got the implicit method off of an IASTName that is not a reference, |
134 |
//it is no longer completly implicit and it should be treated as a normal method. |
135 |
pdomBinding = new PDOMCPPMethod(pdom, parent, name); |
136 |
} |
137 |
} else if (binding instanceof ICPPFunction) { |
138 |
pdomBinding = new PDOMCPPFunction(pdom, parent, name); |
139 |
} else if (binding instanceof ICPPClassType) { |
140 |
pdomBinding = new PDOMCPPClassType(pdom, parent, name); |
141 |
} else if (binding instanceof ICPPNamespaceAlias) { |
142 |
pdomBinding = new PDOMCPPNamespaceAlias(pdom, parent, name); |
143 |
} else if (binding instanceof ICPPNamespace) { |
144 |
pdomBinding = new PDOMCPPNamespace(pdom, parent, name); |
145 |
} else if (binding instanceof IEnumeration) { |
146 |
pdomBinding = new PDOMCPPEnumeration(pdom, parent, name); |
147 |
} else if (binding instanceof IEnumerator) { |
148 |
IEnumeration enumeration = (IEnumeration)((IEnumerator)binding).getType(); |
149 |
PDOMBinding pdomEnumeration = adaptBinding(enumeration); |
150 |
if (pdomEnumeration instanceof PDOMCPPEnumeration) |
151 |
pdomBinding = new PDOMCPPEnumerator(pdom, parent, name, |
152 |
(PDOMCPPEnumeration)pdomEnumeration); |
153 |
} else if (binding instanceof ITypedef) { |
154 |
pdomBinding = new PDOMCPPTypedef(pdom, parent, name, (ITypedef)binding); |
133 |
} |
155 |
} |
134 |
} else if (binding instanceof ICPPFunction) { |
|
|
135 |
pdomBinding = new PDOMCPPFunction(pdom, parent, name); |
136 |
} else if (binding instanceof ICPPClassType) { |
137 |
pdomBinding = new PDOMCPPClassType(pdom, parent, name); |
138 |
} else if (binding instanceof ICPPNamespaceAlias) { |
139 |
pdomBinding = new PDOMCPPNamespaceAlias(pdom, parent, name); |
140 |
} else if (binding instanceof ICPPNamespace) { |
141 |
pdomBinding = new PDOMCPPNamespace(pdom, parent, name); |
142 |
} else if (binding instanceof IEnumeration) { |
143 |
pdomBinding = new PDOMCPPEnumeration(pdom, parent, name); |
144 |
} else if (binding instanceof IEnumerator) { |
145 |
IEnumeration enumeration = (IEnumeration)((IEnumerator)binding).getType(); |
146 |
PDOMBinding pdomEnumeration = adaptBinding(enumeration); |
147 |
if (pdomEnumeration instanceof PDOMCPPEnumeration) |
148 |
pdomBinding = new PDOMCPPEnumerator(pdom, parent, name, |
149 |
(PDOMCPPEnumeration)pdomEnumeration); |
150 |
} else if (binding instanceof ITypedef) { |
151 |
pdomBinding = new PDOMCPPTypedef(pdom, parent, name, (ITypedef)binding); |
152 |
} |
156 |
} |
153 |
} |
157 |
} |
|
|
158 |
} catch (DOMException e) { |
159 |
throw new CoreException(Util.createStatus(e)); |
154 |
} |
160 |
} |
155 |
|
161 |
|
156 |
// final processing |
162 |
// final processing |
Lines 314-321
Link Here
|
314 |
return resolveBinding(names[0]); |
320 |
return resolveBinding(names[0]); |
315 |
IASTName lastName = names[names.length - 1]; |
321 |
IASTName lastName = names[names.length - 1]; |
316 |
PDOMBinding nsBinding = adaptBinding(names[names.length - 2].resolveBinding()); |
322 |
PDOMBinding nsBinding = adaptBinding(names[names.length - 2].resolveBinding()); |
317 |
if (nsBinding instanceof IScope) { |
323 |
try { |
318 |
return (PDOMBinding) ((IScope)nsBinding).getBinding(lastName, true); |
324 |
if (nsBinding instanceof IScope) { |
|
|
325 |
return (PDOMBinding) ((IScope)nsBinding).getBinding(lastName, true); |
326 |
} |
327 |
} catch (DOMException e) { |
328 |
throw new CoreException(Util.createStatus(e)); |
319 |
} |
329 |
} |
320 |
} |
330 |
} |
321 |
IASTNode parent = name.getParent(); |
331 |
IASTNode parent = name.getParent(); |