|
Lines 119-125
Link Here
|
| 119 |
return null; |
119 |
return null; |
| 120 |
|
120 |
|
| 121 |
IBinding binding = name.resolveBinding(); |
121 |
IBinding binding = name.resolveBinding(); |
| 122 |
|
122 |
|
| 123 |
if (binding == null || binding instanceof IProblemBinding) |
123 |
if (binding == null || binding instanceof IProblemBinding) |
| 124 |
// Can't tell what it is |
124 |
// Can't tell what it is |
| 125 |
return null; |
125 |
return null; |
|
Lines 132-181
Link Here
|
| 132 |
try { |
132 |
try { |
| 133 |
if (pdomBinding == null) { |
133 |
if (pdomBinding == null) { |
| 134 |
PDOMNode parent = getAdaptedParent(binding); |
134 |
PDOMNode parent = getAdaptedParent(binding); |
| 135 |
if (parent != null) { |
135 |
if (parent == null) |
| 136 |
if (binding instanceof ICPPField && parent instanceof PDOMCPPClassType) |
136 |
return null; |
| 137 |
pdomBinding = new PDOMCPPField(pdom, (PDOMCPPClassType)parent, name); |
137 |
|
| 138 |
else if (binding instanceof ICPPVariable) { |
138 |
if (binding instanceof ICPPField && parent instanceof PDOMCPPClassType) |
| 139 |
if (!(binding.getScope() instanceof CPPBlockScope)) { |
139 |
pdomBinding = new PDOMCPPField(pdom, (PDOMCPPClassType)parent, (ICPPField) binding); |
| 140 |
ICPPVariable var= (ICPPVariable) binding; |
140 |
else if (binding instanceof ICPPVariable && !(binding.getScope() instanceof CPPBlockScope)) { |
| 141 |
if (!var.isStatic()) { // bug 161216 |
141 |
if (!(binding.getScope() instanceof CPPBlockScope)) { |
| 142 |
pdomBinding = new PDOMCPPVariable(pdom, parent, name); |
142 |
ICPPVariable var= (ICPPVariable) binding; |
| 143 |
} |
143 |
if (!var.isStatic()) { // bug 161216 |
| 144 |
} |
144 |
pdomBinding = new PDOMCPPVariable(pdom, parent, var); |
| 145 |
} else if (binding instanceof ICPPMethod && parent instanceof PDOMCPPClassType) { |
|
|
| 146 |
pdomBinding = new PDOMCPPMethod(pdom, parent, name); |
| 147 |
} else if (binding instanceof CPPImplicitMethod && parent instanceof PDOMCPPClassType) { |
| 148 |
if(!name.isReference()) { |
| 149 |
//because we got the implicit method off of an IASTName that is not a reference, |
| 150 |
//it is no longer completly implicit and it should be treated as a normal method. |
| 151 |
pdomBinding = new PDOMCPPMethod(pdom, parent, name); |
| 152 |
} |
145 |
} |
| 153 |
} else if (binding instanceof ICPPFunction) { |
|
|
| 154 |
ICPPFunction func= (ICPPFunction) binding; |
| 155 |
if (!func.isStatic()) { // bug 161216 |
| 156 |
pdomBinding = new PDOMCPPFunction(pdom, parent, name); |
| 157 |
} |
| 158 |
} else if (binding instanceof ICPPClassType) { |
| 159 |
pdomBinding = new PDOMCPPClassType(pdom, parent, name); |
| 160 |
} else if (binding instanceof ICPPNamespaceAlias) { |
| 161 |
pdomBinding = new PDOMCPPNamespaceAlias(pdom, parent, name); |
| 162 |
} else if (binding instanceof ICPPNamespace) { |
| 163 |
pdomBinding = new PDOMCPPNamespace(pdom, parent, name); |
| 164 |
} else if (binding instanceof IEnumeration) { |
| 165 |
pdomBinding = new PDOMCPPEnumeration(pdom, parent, name); |
| 166 |
} else if (binding instanceof IEnumerator) { |
| 167 |
IEnumeration enumeration = (IEnumeration)((IEnumerator)binding).getType(); |
| 168 |
PDOMBinding pdomEnumeration = adaptBinding(enumeration); |
| 169 |
if (pdomEnumeration instanceof PDOMCPPEnumeration) |
| 170 |
pdomBinding = new PDOMCPPEnumerator(pdom, parent, name, |
| 171 |
(PDOMCPPEnumeration)pdomEnumeration); |
| 172 |
} else if (binding instanceof ITypedef) { |
| 173 |
pdomBinding = new PDOMCPPTypedef(pdom, parent, name, (ITypedef)binding); |
| 174 |
} |
146 |
} |
| 175 |
|
147 |
} else if (parent instanceof PDOMCPPClassType && binding instanceof ICPPMethod) { |
| 176 |
if(pdomBinding!=null) { |
148 |
pdomBinding = new PDOMCPPMethod(pdom, parent, (ICPPMethod)binding); |
| 177 |
parent.addChild(pdomBinding); |
149 |
} else if (binding instanceof CPPImplicitMethod && parent instanceof PDOMCPPClassType) { |
|
|
150 |
if(!name.isReference()) { |
| 151 |
//because we got the implicit method off of an IASTName that is not a reference, |
| 152 |
//it is no longer completly implicit and it should be treated as a normal method. |
| 153 |
pdomBinding = new PDOMCPPMethod(pdom, parent, (ICPPMethod)binding); |
| 154 |
} |
| 155 |
} else if (binding instanceof ICPPFunction) { |
| 156 |
ICPPFunction func= (ICPPFunction) binding; |
| 157 |
if (!func.isStatic()) { // bug 161216 |
| 158 |
pdomBinding = new PDOMCPPFunction(pdom, parent, func); |
| 178 |
} |
159 |
} |
|
|
160 |
} else if (binding instanceof ICPPClassType) { |
| 161 |
pdomBinding = new PDOMCPPClassType(pdom, parent, (ICPPClassType) binding); |
| 162 |
} else if (binding instanceof ICPPNamespaceAlias) { |
| 163 |
pdomBinding = new PDOMCPPNamespaceAlias(pdom, parent, (ICPPNamespaceAlias) binding); |
| 164 |
} else if (binding instanceof ICPPNamespace) { |
| 165 |
pdomBinding = new PDOMCPPNamespace(pdom, parent, (ICPPNamespace) binding); |
| 166 |
} else if (binding instanceof IEnumeration) { |
| 167 |
pdomBinding = new PDOMCPPEnumeration(pdom, parent, (IEnumeration) binding); |
| 168 |
} else if (binding instanceof IEnumerator) { |
| 169 |
IEnumeration enumeration = (IEnumeration)((IEnumerator)binding).getType(); |
| 170 |
PDOMBinding pdomEnumeration = adaptBinding(enumeration); |
| 171 |
if (pdomEnumeration instanceof PDOMCPPEnumeration) |
| 172 |
pdomBinding = new PDOMCPPEnumerator(pdom, parent, (IEnumerator) binding, |
| 173 |
(PDOMCPPEnumeration)pdomEnumeration); |
| 174 |
} else if (binding instanceof ITypedef) { |
| 175 |
pdomBinding = new PDOMCPPTypedef(pdom, parent, name, (ITypedef)binding); |
| 176 |
} |
| 177 |
|
| 178 |
if(pdomBinding!=null) { |
| 179 |
parent.addChild(pdomBinding); |
| 179 |
} |
180 |
} |
| 180 |
} |
181 |
} |
| 181 |
} catch(DOMException e) { |
182 |
} catch(DOMException e) { |
|
Lines 460-470
Link Here
|
| 460 |
if (type instanceof ICPPBasicType) { |
461 |
if (type instanceof ICPPBasicType) { |
| 461 |
return new PDOMCPPBasicType(pdom, parent, (ICPPBasicType)type); |
462 |
return new PDOMCPPBasicType(pdom, parent, (ICPPBasicType)type); |
| 462 |
} else if (type instanceof ICPPClassType) { |
463 |
} else if (type instanceof ICPPClassType) { |
| 463 |
// aftodo: please review, the binding may be nested in a namespace bug 162011 |
464 |
FindEquivalentBinding feb = new FindEquivalentBinding(this,(ICPPClassType)type); |
| 464 |
// it might be necessary to create the binding for the class here. |
465 |
getIndex().accept(feb); |
| 465 |
PDOMBinding binding= adaptBinding((ICPPClassType) type); |
466 |
if(feb.getResult()!=null) { |
| 466 |
if (binding != null) { |
467 |
return feb.getResult(); |
| 467 |
return binding; |
|
|
| 468 |
} |
468 |
} |
| 469 |
} |
469 |
} |
| 470 |
return super.addType(parent, type); |
470 |
return super.addType(parent, type); |