psyclone.psyir.nodes.array_reference

This module contains the implementation of the ArrayReference node.

Classes

  • ArrayReference: Node representing a reference to an element or elements of an Array.

class psyclone.psyir.nodes.array_reference.ArrayReference(symbol, **kwargs)

Node representing a reference to an element or elements of an Array. The array-index expressions are stored as the children of this node.

Inheritance

Inheritance diagram of ArrayReference
static create(symbol, indices)

Create an ArrayReference instance given a symbol and a list of Node array indices. The special value “:” can be used as an index to create the corresponding PSyIR Range that represents “:”.

Parameters:
Returns:

an ArrayReference instance.

Return type:

psyclone.psyir.nodes.ArrayReference

Raises:

GenerationError – if the arguments to the create method are not of the expected type.

property datatype
Returns:

the datatype of the accessed array element(s).

Return type:

psyclone.psyir.symbols.DataType