psyclone.psyir.nodes.array_constructor#

This module contains the ArrayConstructor node implementation.

Classes#

class psyclone.psyir.nodes.array_constructor.ArrayConstructor(**kwargs)[source]#

Node representing an array constructor.

Inheritance

Inheritance diagram of ArrayConstructor
static create(elems)[source]#

Create an ArrayConstructor instance representing an array with the given elements.

Parameters:

elems (list[DataNode]) – the elements of the array being constructed.

Return type:

ArrayConstructor

Returns:

an ArrayConstructor instance.

Raises:

GenerationError – if the arguments are not of the expected type.

property datatype: DataType | DataTypeSymbol#
Returns:

the type of this array constructor.

node_str(colour=True)[source]#

Construct a text representation of this node, optionally containing colour control codes.

Parameters:

colour (bool) – whether or not to include colour control codes.

Return type:

str

Returns:

description of this PSyIR node.