Reference Guide  2.5.0
psyclone.psyir.nodes.scoping_node.ScopingNode Class Reference
Inheritance diagram for psyclone.psyir.nodes.scoping_node.ScopingNode:
Collaboration diagram for psyclone.psyir.nodes.scoping_node.ScopingNode:

Public Member Functions

def __init__ (self, children=None, parent=None, symbol_table=None)
 
def __eq__ (self, other)
 
def symbol_table (self)
 
- Public Member Functions inherited from psyclone.psyir.nodes.node.Node
def __init__ (self, ast=None, children=None, parent=None, annotations=None)
 
def coloured_name (self, colour=True)
 
def node_str (self, colour=True)
 
def __str__ (self)
 
def ast (self)
 
def ast_end (self)
 
def ast (self, ast)
 
def ast_end (self, ast_end)
 
def annotations (self)
 
def dag (self, file_name='dag', file_format='svg')
 
def dag_gen (self, graph)
 
def dag_name (self)
 
def args (self)
 
def backward_dependence (self)
 
def forward_dependence (self)
 
def is_valid_location (self, new_node, position="before")
 
def depth (self)
 
def view (self, depth=0, colour=True, indent=" ", _index=None)
 
def addchild (self, child, index=None)
 
def children (self)
 
def children (self, my_children)
 
def parent (self)
 
def siblings (self)
 
def has_constructor_parent (self)
 
def position (self)
 
def abs_position (self)
 
def root (self)
 
def sameParent (self, node_2)
 
def walk (self, my_type, stop_type=None, depth=None)
 
def get_sibling_lists (self, my_type, stop_type=None)
 
def ancestor (self, my_type, excluding=None, include_self=False, limit=None, shared_with=None)
 
def kernels (self)
 
def following (self, routine=True)
 
def preceding (self, reverse=False, routine=True)
 
def immediately_precedes (self, node_2)
 
def immediately_follows (self, node_1)
 
def coded_kernels (self)
 
def loops (self)
 
def reductions (self, reprod=None)
 
def is_openmp_parallel (self)
 
def lower_to_language_level (self)
 
def reference_accesses (self, var_accesses)
 
def scope (self)
 
def replace_with (self, node, keep_name_in_context=True)
 
def pop_all_children (self)
 
def detach (self)
 
def copy (self)
 
def validate_global_constraints (self)
 
def debug_string (self)
 
def origin_string (self)
 
def update_signal (self)
 
def path_from (self, ancestor)
 

Public Attributes

 symbol_table
 
- Public Attributes inherited from psyclone.psyir.nodes.node.Node
 position
 

Additional Inherited Members

- Static Public Attributes inherited from psyclone.psyir.nodes.node.Node
int START_DEPTH = 0
 
int START_POSITION = 0
 
 valid_annotations = tuple()
 

Detailed Description

 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.

:param children: the PSyIR nodes that are children of this node.
:type children: List[:py:class:`psyclone.psyir.nodes.Node`]
:param parent: the parent node of this node in the PSyIR.
:type parent: Optional[:py:class:`psyclone.psyir.nodes.Node`]
:param symbol_table: attach the given symbol table to the new node.
:type symbol_table: \
        Optional[:py:class:`psyclone.psyir.symbols.SymbolTable`]

Definition at line 44 of file scoping_node.py.

Member Function Documentation

◆ __eq__()

def psyclone.psyir.nodes.scoping_node.ScopingNode.__eq__ (   self,
  other 
)
Checks whether two nodes are equal. Scoping nodes are equal if their
symbol tables are equal.

:param object other: the object to check equality to.

:returns: whether other is equal to self.
:rtype: bool

Reimplemented from psyclone.psyir.nodes.node.Node.

Reimplemented in psyclone.psyir.nodes.routine.Routine, and psyclone.psyir.nodes.container.Container.

Definition at line 75 of file scoping_node.py.

75  def __eq__(self, other):
76  '''
77  Checks whether two nodes are equal. Scoping nodes are equal if their
78  symbol tables are equal.
79 
80  :param object other: the object to check equality to.
81 
82  :returns: whether other is equal to self.
83  :rtype: bool
84  '''
85  is_eq = super().__eq__(other)
86  is_eq = is_eq and self.symbol_table == other.symbol_table
87  return is_eq
88 

References psyclone.domain.lfric.lfric_collection.LFRicCollection._symbol_table, psyclone.dynamo0p3.DynMeshes._symbol_table, psyclone.dynamo0p3.HaloDepth._symbol_table, psyclone.psyGen.HaloExchange._symbol_table, psyclone.psyir.backend.sympy_writer.SymPyWriter._symbol_table, psyclone.psyir.nodes.scoping_node.ScopingNode._symbol_table, psyclone.psyGen.InvokeSchedule.symbol_table(), psyclone.psyir.nodes.scoping_node.ScopingNode.symbol_table, and psyclone.psyir.nodes.node.Node.walk().

Here is the call graph for this function:

◆ symbol_table()

def psyclone.psyir.nodes.scoping_node.ScopingNode.symbol_table (   self)
:returns: table containing symbol information for this scope.
:rtype: :py:class:`psyclone.psyGen.SymbolTable`

Definition at line 124 of file scoping_node.py.

124  def symbol_table(self):
125  '''
126  :returns: table containing symbol information for this scope.
127  :rtype: :py:class:`psyclone.psyGen.SymbolTable`
128  '''
129  return self._symbol_table
130 
131 
132 # For AutoAPI documentation generation

References psyclone.domain.lfric.lfric_collection.LFRicCollection._symbol_table, psyclone.dynamo0p3.DynMeshes._symbol_table, psyclone.dynamo0p3.HaloDepth._symbol_table, psyclone.psyGen.HaloExchange._symbol_table, psyclone.psyir.backend.sympy_writer.SymPyWriter._symbol_table, and psyclone.psyir.nodes.scoping_node.ScopingNode._symbol_table.

Here is the caller graph for this function:

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