class documentation
Definition-use chain (DUC). This class provides methods to query the definitions and references for a name in a lexical scope.
| Method | __init__ |
Constructs a def-use chain. |
| Method | ast |
Retrieves the AST node for a reference from this DUC. |
| Method | container |
Undocumented |
| Method | get |
Retrieves the definitions for a variable in a lexical scope. |
| Method | get |
Retrieves all the definitions and references for a lexical scope. |
| Method | get |
Retrieves the references for a variable in a lexical scope. |
| Method | get |
Retrieves all the definitions in a lexical scope. |
| Method | get |
Iterates the names of all the lexical scopes. Returns: An iterator of the lexical scope names. |
| Method | get |
Retrieves all the references in a lexical scope. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | cfgs |
Undocumented |
| Instance Variable | const |
Undocumented |
| Instance Variable | ssa |
Undocumented |
| Method | _ast |
Undocumented |
def ast_node_for_reference(self, reference:
Reference, scope: str = MODULE_SCOPE) -> ast.stmt:
(source)
¶
def container_relationships(self, scope:
str = MODULE_SCOPE) -> Iterator[ ContainerRelationship]:
(source)
¶
Undocumented
Retrieves the definitions for a variable in a lexical scope.
Returns: A iterator of definitions.
| Parameters | |
scope:str | The name of the scope (defaults to "mod", the scope of the |
| module) | |
| Returns | |
Iterator[ | Undocumented |
def get_all_definitions_and_references(self, scope:
str = MODULE_SCOPE) -> Tuple[ Iterator[ Definition], Iterator[ Reference]]:
(source)
¶
Retrieves all the definitions and references for a lexical scope.
| Parameters | |
scope:str | The name of the scope (defaults to "mod", the scope of the |
| module) | |
| Returns | |
Tuple[ | A tuple of (definitions, references). definitions is an iterator
of all the definitions (AST nodes) in the lexical scope scope, and
references is a iterator of all the references (AST nodes) in the
scope. |
Retrieves all the definitions in a lexical scope.
Returns: An iterator of definitions.
| Parameters | |
name:str | The name of the variable (string). |
scope:str | The name of the scope (defaults to "mod", the scope of the |
| module) | |
| Returns | |
Iterator[ | Undocumented |