CallGraphNode
Class for call graph nodes.
A call graph node represents a function in the call graph.
Attributes:
Name | Type | Description |
---|---|---|
symbol |
Symbol
|
The symbol of the function that the node represents. |
reasons |
Reasons
|
The raw Reasons for the node. After the call graph is built, this only contains reads_from and writes_to as well as unknown_calls. |
children |
dict[NodeID, CallGraphNode]
|
The set of children of the node, (i.e., the set of nodes that this node calls) |
Source code in src/library_analyzer/processing/api/purity_analysis/model/_call_graph.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
children: dict[NodeID, CallGraphNode] = field(default_factory=dict)
class-attribute
instance-attribute
¶
reasons: Reasons
instance-attribute
¶
symbol: Symbol
instance-attribute
¶
__hash__()
¶
__init__(symbol, reasons, children=dict())
¶
__repr__()
¶
__str__()
¶
add_child(child)
¶
Add a child to the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child |
CallGraphNode
|
The child to add. |
required |
Source code in src/library_analyzer/processing/api/purity_analysis/model/_call_graph.py
delete_child(child_id)
¶
Delete a child from the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_id |
NodeID
|
The NodeID of the child to delete. |
required |
Source code in src/library_analyzer/processing/api/purity_analysis/model/_call_graph.py
get_child(child_id)
¶
Get a child from the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_id |
NodeID
|
The NodeID of the child to get. |
required |
Raises:
Type | Description |
---|---|
KeyError
|
If the child_id is not in the children. |
Source code in src/library_analyzer/processing/api/purity_analysis/model/_call_graph.py
has_child(child_id)
¶
Check if the node has a child with the given NodeID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_id |
NodeID
|
The NodeID of the child to check for. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the node has a child with the given NodeID, False otherwise. |
Source code in src/library_analyzer/processing/api/purity_analysis/model/_call_graph.py
is_inferred()
¶
is_leaf()
¶
Check if the node is a leaf node.
Returns:
Type | Description |
---|---|
bool
|
True if the node is a leaf node, False otherwise. |