use of org.eclipse.cdt.core.dom.ast.IProblemBinding in project Cpp4CIA by thanhminhmr.
the class AstBuilder method createUnknownNode.
@Nonnull
private CppNode createUnknownNode(@Nonnull CppNode parentNode, @Nonnull IBinding binding, @Nonnull String name, boolean createUseDependency) {
if (binding instanceof IProblemBinding)
return createIntegralNode(name);
final IBinding topBinding = binding instanceof ICPPSpecialization ? Objects.requireNonNullElse(((ICPPSpecialization) binding).getSpecializedBinding(), binding) : binding;
final CppNode existNode = bindingNodeMap.get(topBinding);
if (existNode != null) {
if (createUseDependency)
parentNode.addDependencyTo(existNode, DependencyType.USE);
return existNode;
}
final IntegralNode newNode = new IntegralNode(name);
parentNode.addChild(newNode);
if (createUseDependency)
parentNode.addDependencyTo(newNode, DependencyType.USE);
bindingNodeMap.put(topBinding, newNode);
unknownNodes.add(newNode);
return newNode;
}
Aggregations