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)[source]#
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

- static create(symbol, indices)[source]#
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:
symbol (
psyclone.psyir.symbols.DataSymbol) – the symbol that this array is associated with.indices (List[Union[
psyclone.psyir.nodes.Node,”:”]]) – a list of Nodes or “:” describing the array indices.
- Returns:
an ArrayReference instance.
- Return type:
- 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: