psyclone.psyir.nodes.container
This module contains the Container node implementation.
Classes
Container
: Node representing a set of Routine and/or Container nodes, as well
- class psyclone.psyir.nodes.container.Container(name, **kwargs)
Node representing a set of Routine and/or Container nodes, as well as a name and a SymbolTable. This construct can be used to scope symbols of variables, Routine names and Container names. In Fortran a container would naturally represent a module or a submodule.
- Parameters:
name (str) – the name of the container.
parent (
psyclone.psyir.nodes.Node
) – optional parent node of this Container in the PSyIR.symbol_table (
psyclone.psyir.symbols.SymbolTable
or NoneType) – initialise the node with a given symbol table.
Inheritance
- classmethod create(name, symbol_table, children)
Create a Container instance given a name, a symbol table and a list of child nodes.
- Parameters:
name (str) – the name of the Container.
symbol_table (
psyclone.psyir.symbols.SymbolTable
) – the symbol table associated with this Container.children (list of
psyclone.psyir.nodes.Container
orpsyclone.psyir.nodes.Routine
) – a list of PSyIR nodes contained in the Container. These must be Containers or Routines.
- Returns:
an instance of cls.
- Return type:
psyclone.psyir.nodes.Container
or subclass thereof- Raises:
GenerationError – if the arguments to the create method are not of the expected type.
- property name
- Returns:
name of the container.
- Return type:
str
- node_str(colour=True)
Returns the name of this node with appropriate control codes to generate coloured output in a terminal that supports it.
- Parameters:
colour (bool) – whether or not to include colour control codes.
- Returns:
description of this node, possibly coloured.
- Return type:
str