Go to the documentation of this file.
17 : symbol_table(symbol_table)
37 bool include_interfaces,
38 const std::function<
bool(
const symbolt &)> user_filter)
43 std::vector<irep_idt> classes_to_visit;
44 classes_to_visit.push_back(class_id);
45 while(!classes_to_visit.empty())
47 irep_idt current_class = classes_to_visit.back();
48 classes_to_visit.pop_back();
50 const irep_idt &full_component_identifier=
54 if(symbol && user_filter(*symbol))
59 const auto current_class_symbol_it =
67 return base.
type().get_identifier();
70 if(include_interfaces)
72 classes_to_visit.insert(
73 classes_to_visit.end(), parents.begin(), parents.end());
78 classes_to_visit.push_back(*parents.begin());
130 auto exclude_abstract_methods = [&](
const symbolt &symbol) {
131 return !symbol.type.get_bool(ID_C_abstract);
135 call_resolver(classname, call_basename,
false, exclude_abstract_methods);
140 call_resolver(classname, call_basename,
true, exclude_abstract_methods);
145 resolved_call = call_resolver(classname, call_basename,
true);
147 return resolved_call;
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
optionalt< resolve_inherited_componentt::inherited_componentt > get_inherited_method_implementation(const irep_idt &call_basename, const irep_idt &classname, const symbol_tablet &symbol_table)
Given a class and a component, identify the concrete method it is resolved to.
irep_idt component_identifier
irep_idt get_full_component_identifier() const
Get the full name of this function.
irep_idt class_identifier
Given a class and a component (either field or method), find the closest parent that defines that com...
const std::string & id2string(const irep_idt &d)
#define PRECONDITION(CONDITION)
const basest & bases() const
Get the collection of base classes/structs.
nonstd::optional< T > optionalt
struct_tag_typet & type()
const symbol_tablet & symbol_table
const symbolst & symbols
Read-only field, used to look up symbols given their names.
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
static irep_idt build_full_component_identifier(const irep_idt &class_name, const irep_idt &component_name)
Build a component name as found in a GOTO symbol table equivalent to the name of a concrete component...
ranget< iteratort > make_range(iteratort begin, iteratort end)
resolve_inherited_componentt(const symbol_tablet &symbol_table)
See the operator() method comment.
optionalt< inherited_componentt > operator()(const irep_idt &class_id, const irep_idt &component_name, bool include_interfaces, std::function< bool(const symbolt &)> user_filter=[](const symbolt &) { return true;})
Given a class and a component, identify the concrete field or method it is resolved to.
Base class or struct that a class or struct inherits from.