cprover
resolve_inherited_componentt Class Reference

#include <resolve_inherited_component.h>

Collaboration diagram for resolve_inherited_componentt:
[legend]

Classes

class  inherited_componentt
 

Public Member Functions

 resolve_inherited_componentt (const symbol_tablet &symbol_table)
 See the operator() method comment. More...
 
 resolve_inherited_componentt (const symbol_tablet &symbol_table, const class_hierarchyt &class_hierarchy)
 See the operator() method comment. More...
 
inherited_componentt operator() (const irep_idt &class_id, const irep_idt &component_name, bool include_interfaces)
 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 Member Functions

bool does_implementation_exist (const irep_idt &class_name, const irep_idt &component_name, const irep_idt &user_class_name)
 

Private Attributes

class_hierarchyt class_hierarchy
 
const symbol_tabletsymbol_table
 

Detailed Description

Definition at line 21 of file resolve_inherited_component.h.

Constructor & Destructor Documentation

◆ resolve_inherited_componentt() [1/2]

resolve_inherited_componentt::resolve_inherited_componentt ( const symbol_tablet symbol_table)
explicit

See the operator() method comment.

Parameters
symbol_tableThe symbol table to resolve the component against

Definition at line 15 of file resolve_inherited_component.cpp.

References class_hierarchy, and symbol_table.

◆ resolve_inherited_componentt() [2/2]

resolve_inherited_componentt::resolve_inherited_componentt ( const symbol_tablet symbol_table,
const class_hierarchyt class_hierarchy 
)

See the operator() method comment.

Parameters
symbol_tableThe symbol table to resolve the component against
class_hierarchyA prebuilt class_hierachy based on the symbol_table

Definition at line 26 of file resolve_inherited_component.cpp.

References class_hierarchy, class_hierarchyt::class_map, and PRECONDITION.

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.

References id2string(), and PRECONDITION.

Referenced by resolve_inherited_componentt::inherited_componentt::get_full_component_identifier(), remove_virtual_functionst::get_method(), and operator()().

◆ does_implementation_exist()

bool resolve_inherited_componentt::does_implementation_exist ( const irep_idt class_name,
const irep_idt component_name,
const irep_idt user_class_name 
)
private

◆ operator()()

resolve_inherited_componentt::inherited_componentt resolve_inherited_componentt::operator() ( const irep_idt class_id,
const irep_idt component_name,
bool  include_interfaces 
)

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)
Returns
The concrete component that has been resolved

Definition at line 47 of file resolve_inherited_component.cpp.

References build_full_component_identifier(), class_hierarchy, class_hierarchyt::class_map, dstringt::empty(), symbol_table_baset::has_symbol(), PRECONDITION, and symbol_table.

Member Data Documentation

◆ class_hierarchy

class_hierarchyt resolve_inherited_componentt::class_hierarchy
private

Definition at line 73 of file resolve_inherited_component.h.

Referenced by operator()(), and resolve_inherited_componentt().

◆ symbol_table

const symbol_tablet& resolve_inherited_componentt::symbol_table
private

Definition at line 74 of file resolve_inherited_component.h.

Referenced by operator()(), and resolve_inherited_componentt().


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