psyclone.psyir.nodes.scoping_node#
This module contains the ScopingNode implementation.
Classes#
ScopingNode: Abstract node that has an associated Symbol Table to keep track of
- class psyclone.psyir.nodes.scoping_node.ScopingNode(children=None, parent=None, symbol_table=None)[source]#
Abstract node that has an associated Symbol Table to keep track of symbols declared in its scope (symbols that can be accessed by this node and any of its descendants). If a pre-existing symbol table is provided, it will be attached to the node (raising an error if the symbol table is already attached to another scope), otherwise a new empty Symbol Table will be created.
- Parameters:
children (List[
psyclone.psyir.nodes.Node]) – the PSyIR nodes that are children of this node.parent (Optional[
psyclone.psyir.nodes.Node]) – the parent node of this node in the PSyIR.symbol_table (Optional[
psyclone.psyir.symbols.SymbolTable]) – attach the given symbol table to the new node.
Inheritance

- reference_accesses()[source]#
- Return type:
- Returns:
a map of all the symbol accessed inside this node, the keys are Signatures (unique identifiers to a symbol and its structure acccessors) and the values are AccessSequence (a sequence of AccessTypes).
- replace_symbols_using(table_or_symbol)[source]#
Update any Symbols referenced by this Node (and its descendants) with those in the supplied table (or just the supplied Symbol instance) if they have matching names. If there is no match for a given Symbol then it is left unchanged.
Since this is a ScopingNode, it is associated with a symbol table. Therefore, if the supplied table is the one for the scope containing this node (if any), the one passed to the child nodes is updated to be the one associated with this node.
- Parameters:
table_or_symbol (
psyclone.psyir.symbols.SymbolTable|psyclone.psyir.symbols.Symbol) – the symbol table from which to get replacement symbols or a single, replacement Symbol.
- property symbol_table#
- Returns:
table containing symbol information for this scope.
- Return type:
psyclone.psyGen.SymbolTable