CBMC
resolve_inherited_componentt Class Reference

#include <resolve_inherited_component.h>

+ Collaboration diagram for resolve_inherited_componentt:

Classes

class  inherited_componentt
 

Public Member Functions

 resolve_inherited_componentt (const symbol_table_baset &symbol_table)
 See the operator() method comment. More...
 
std::optional< inherited_componenttoperator() (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. More...
 

Static Public Member Functions

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 component_name on class class_name. More...
 

Private Attributes

const symbol_table_basetsymbol_table
 

Detailed Description

Definition at line 24 of file resolve_inherited_component.h.

Constructor & Destructor Documentation

◆ resolve_inherited_componentt()

resolve_inherited_componentt::resolve_inherited_componentt ( const symbol_table_baset symbol_table)
explicit

See the operator() method comment.

Parameters
symbol_tableThe symbol table to resolve the component against

Definition at line 17 of file resolve_inherited_component.cpp.

Member Function Documentation

◆ build_full_component_identifier()

irep_idt resolve_inherited_componentt::build_full_component_identifier ( const irep_idt class_name,
const irep_idt component_name 
)
static

Build a component name as found in a GOTO symbol table equivalent to the name of a concrete component component_name on class class_name.

Parameters
component_nameThe name of the component
class_nameThe class the implementation would be found on.
Returns
A name for looking up in the symbol table for classes class_name's component component_name

Definition at line 94 of file resolve_inherited_component.cpp.

◆ operator()()

std::optional< resolve_inherited_componentt::inherited_componentt > resolve_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.

For example, a reference Child.abc refers to Child's method or field if it exists, or else Parent.abc, and so on regarding Parent's ancestors. If none are found, an empty string will be returned.

Parameters
class_idThe name of the class the function is being called on
component_nameThe base name of the component (i.e. without the class specifier)
include_interfacesIf true, consider inheritance from interfaces (parent types other than the first listed)
user_filterPredicate that should return true for symbols that can be returned. Those for which it returns false will be ignored.
Returns
The concrete component that has been resolved

Definition at line 36 of file resolve_inherited_component.cpp.

Member Data Documentation

◆ symbol_table

const symbol_table_baset& resolve_inherited_componentt::symbol_table
private

Definition at line 62 of file resolve_inherited_component.h.


The documentation for this class was generated from the following files: