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:

Inheritance

Inheritance diagram of Container
classmethod create(name, symbol_table, children)

Create a Container instance given a name, a symbol table and a list of child nodes.

Parameters:
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