psyclone.psyir.nodes.array_member#
This module contains the implementation of the ArrayMember node.
Classes#
ArrayMember: Node representing an access to the element(s) of an array that is a
- class psyclone.psyir.nodes.array_member.ArrayMember(member_name, parent=None)[source]#
Node representing an access to the element(s) of an array that is a member of a structure. Must have one or more children which give the array-index expressions for the array access.
Inheritance

- static create(member_name, indices)[source]#
Construct an ArrayMember instance describing an array access to a member of a structure.
e.g. for the Fortran grid%subdomains(1,2), subdomains must be an array and we are accessing element (1,2) of it. We would therefore create the ArrayMember for this access by calling:
>>> amem = ArrayMember.create("subdomains", [Literal("1", INTEGER_TYPE), Literal("2", INTEGER_TYPE)])
- Parameters:
member_name (str) – the name of the member of the structure that is being accessed.
indices (list of
psyclone.psyir.nodes.DataNodeorpsyclone.psyir.nodes.Range) – the array-index expressions.
- Raises:
GenerationError – if the supplied indices argument is not a list.