psyclone.psyir.nodes.structure_member

This module contains the implementation of the StructureMember node.

Classes

  • StructureMember: Node representing a membership expression of the parent’s Reference that

class psyclone.psyir.nodes.structure_member.StructureMember(member_name, parent=None)

Node representing a membership expression of the parent’s Reference that resolves into another structure.

Inheritance

Inheritance diagram of StructureMember
static create(member_name, inner_member)

Given the name of a structure member of a structure and a Member node describing the access to a component of it, construct a StructureMember.

e.g. if we had the following Fortran access: grid%subdomain%xstart then ‘subdomain’ must itself be of structure type and we are accessing the ‘xstart’ component of it. We would therefore create the StructureMember for this by calling:

>>> smem = StructureMember.create("subdomain", Member("xstart"))
Parameters:
  • member_name (str) – name of the structure member.

  • inner_member (sub-class of psyclone.psyir.nodes.Member) – a Member describing the access to a component of the named structure member.

get_signature_and_indices()
Returns:

the Signature of this structure member, and a list of the indices used for each component (empty list for this component, since the access is not an array - but other components might have indices).

Return type:

tuple(psyclone.core.Signature, list of list of indices)

property member
Returns:

the member of the structure that is being accessed.

Return type:

(sub-class of) psyclone.psyir.nodes.Member

Raises:

InternalError – if the first child of this node is not an instance of Member.