19 : symbol_table(symbol_table)
35 std::optional<resolve_inherited_componentt::inherited_componentt>
39 bool include_interfaces,
40 const std::function<
bool(
const symbolt &)> user_filter)
45 std::vector<irep_idt> classes_to_visit;
46 classes_to_visit.push_back(class_id);
47 while(!classes_to_visit.empty())
49 irep_idt current_class = classes_to_visit.back();
50 classes_to_visit.pop_back();
52 const irep_idt &full_component_identifier=
56 if(symbol && user_filter(*symbol))
61 const auto current_class_symbol_it =
69 return base.
type().get_identifier();
72 if(include_interfaces)
74 classes_to_visit.insert(
75 classes_to_visit.end(), parents.begin(), parents.end());
80 classes_to_visit.push_back(*parents.begin());
125 std::optional<resolve_inherited_componentt::inherited_componentt>
132 auto exclude_abstract_methods = [&](
const symbolt &symbol) {
133 return !symbol.type.get_bool(ID_C_abstract);
137 call_resolver(classname, call_basename,
false, exclude_abstract_methods);
142 call_resolver(classname, call_basename,
true, exclude_abstract_methods);
147 resolved_call = call_resolver(classname, call_basename,
true);
149 return resolved_call;
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
irep_idt component_identifier
irep_idt get_full_component_identifier() const
Get the full name of this function.
irep_idt class_identifier
resolve_inherited_componentt(const symbol_table_baset &symbol_table)
See the operator() method comment.
std::optional< 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.
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...
const symbol_table_baset & symbol_table
Base class or struct that a class or struct inherits from.
struct_tag_typet & type()
const basest & bases() const
Get the collection of base classes/structs.
The symbol table base class interface.
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
const std::string & id2string(const irep_idt &d)
Ranges: pair of begin and end iterators, which can be initialized from containers,...
ranget< iteratort > make_range(iteratort begin, iteratort end)
std::optional< resolve_inherited_componentt::inherited_componentt > get_inherited_method_implementation(const irep_idt &call_basename, const irep_idt &classname, const symbol_table_baset &symbol_table)
Given a class and a component, identify the concrete method it is resolved to.
Given a class and a component (either field or method), find the closest parent that defines that com...
#define PRECONDITION(CONDITION)
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.