CBMC
scope_treet::scope_nodet Class Reference
+ Inheritance diagram for scope_treet::scope_nodet:
+ Collaboration diagram for scope_treet::scope_nodet:

Public Member Functions

 scope_nodet ()=default
 
 scope_nodet (codet destructor, std::optional< declaration_statet > declaration)
 
std::string dot_attributes (const node_indext &n) const override
 Node with attributes suitable for Graphviz DOT format. More...
 
- Public Member Functions inherited from graph_nodet< empty_edget >
void add_in (node_indext n)
 
void add_out (node_indext n)
 
void erase_in (node_indext n)
 
void erase_out (node_indext n)
 
std::string pretty (const node_indext &idx) const
 
virtual ~graph_nodet ()
 

Public Attributes

std::optional< codetdestructor_value
 
std::optional< declaration_statetdeclaration
 
- Public Attributes inherited from graph_nodet< empty_edget >
edgest in
 
edgest out
 

Additional Inherited Members

- Public Types inherited from graph_nodet< empty_edget >
typedef std::size_t node_indext
 
typedef empty_edget edget
 
typedef std::map< node_indext, edgetedgest
 

Detailed Description

Definition at line 175 of file scope_tree.h.

Constructor & Destructor Documentation

◆ scope_nodet() [1/2]

scope_treet::scope_nodet::scope_nodet ( )
default

◆ scope_nodet() [2/2]

scope_treet::scope_nodet::scope_nodet ( codet  destructor,
std::optional< declaration_statet declaration 
)
explicit

Definition at line 114 of file scope_tree.cpp.

Member Function Documentation

◆ dot_attributes()

std::string scope_treet::scope_nodet::dot_attributes ( const node_indext ) const
inlineoverridevirtual

Node with attributes suitable for Graphviz DOT format.

Derived types may override this function to produce more informative DOT diagrams than the default implementation, which displays only the node index. The return value should be a list of node attributes within square brackets that can be parsed by dot. Here is a sample implementation for a fictional node type with is_evil() and is_pink() functions:

std::stringstream ss;
ss << "[shape=\"" << is_evil() ? "box" : "diamond"
   << "\", color=\"" << is_pink() ? "#e91e63" : "#9c27b0"
   << "\", label=\"this is node " << std::to_string(idx)
   << "\"]";
return ss.str();

Reimplemented from graph_nodet< empty_edget >.

Definition at line 187 of file scope_tree.h.

Member Data Documentation

◆ declaration

std::optional<declaration_statet> scope_treet::scope_nodet::declaration

Definition at line 185 of file scope_tree.h.

◆ destructor_value

std::optional<codet> scope_treet::scope_nodet::destructor_value

Definition at line 184 of file scope_tree.h.


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