39 ''' This module contains the implementation of the Member node.'''
48 Node representing a membership expression of a structure.
49 As such it is a leaf in the PSyIR tree.
51 :param str member_name: the name of the member of the structure that is \
53 :param parent: the parent of this node in the PSyIR tree.
54 :type parent: :py:class:`psyclone.psyir.nodes.StructureReference` or \
55 :py:class:`psyclone.psyir.nodes.Member`
57 :raises TypeError: if the supplied parent is of the wrong type.
61 _children_valid_format =
"<LeafNode>"
65 def __init__(self, member_name, parent=None):
75 not isinstance(parent, (StructureReference, StructureMember))):
77 f
"The parent of a {type(self).__name__} must be either a "
78 f
"(ArrayOf)Structure(s)Reference or (ArrayOf)Structure(s)"
79 f
"Member but found '{type(parent).__name__}'.")
81 super().__init__(parent=parent)
87 Members are assumed to be equivalent if they have the same
88 component name associated with them, and are the same type.
90 :param object other: the object to check equality to.
92 :returns: whether other is equal to self.
95 is_eq = super().
__eq__(other)
96 is_eq = is_eq
and self.
namenamename == other.name
102 :returns: the name of this member.
108 ''' Create a text description of this node in the schedule, optionally
109 including control codes for colour.
111 :param bool colour: whether or not to include colour control codes.
113 :return: text description of this node.
123 ''':returns: whether this member is an array.
130 ''':returns: the Signature of this member access, and a list \
131 of list of the indices used for each component, which is empty \
132 in this case since it is not an array access.
133 :rtype: tuple(:py:class:`psyclone.core.Signature`, list of \
def get_signature_and_indices(self)
def node_str(self, colour=True)
def node_str(self, colour=True)
def coloured_name(self, colour=True)