API reference
python:astx:astx.symbol_table.Scope
class Scope
Scope(scope_node_class: type[ScopeNodeBase] = ScopeNode)
Source: packages/astx/src/astx/symbol_table.py:78
Organize the ASTx objects according to the scope.
Attributes
-
nodes — Type: dict[int, ScopeNodeBase]
-
current — Type: Optional[ScopeNodeBase]
-
previous — Type: Optional[ScopeNodeBase]
-
scope_node_class — Type: type[ScopeNodeBase]
Methods
-
__init__ — Initialize the scope.
-
add — Add a new node in the scope.
-
destroy — Destroy the current scope.
-
get_first — Get the first node in the scope.
-
get_last — Get the latest node in the scope.
-
set_default_parent — Set default parent for the current scope.