Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, node, validation_function, validation_text) |
def | append (self, item) |
def | __setitem__ (self, index, item) |
def | insert (self, index, item) |
def | extend (self, items) |
def | __delitem__ (self, index) |
def | remove (self, item) |
def | pop (self, index=-1) |
def | reverse (self) |
def | clear (self) |
def | sort (self, reverse=False, key=None) |
Customized list to keep track of the children nodes. It is initialised with a callback function that allows the validation of the inserted children. Since this is a subclass of the standard list, all operations (e.g. append, insert, extend, comparisons, list arithmetic operations) are conserved and make use of the validation. They also trigger an update of all ancestor nodes so that action can be taken in order to keep the tree consistent when necessary (e.g. to update the data-movement clauses on an OpenACC data region). :param node: reference to the node where the list belongs. :type node: :py:class:`psyclone.psyir.nodes.Node` :param validation_function: callback function to the validation method. :type validation_function: \ function(int, :py:class:`psyclone.psyir.nodes.Node`) :param str validation_text: textual representation of the valid children.
def psyclone.psyir.nodes.node.ChildrenList.__delitem__ | ( | self, | |
index | |||
) |
Extends list __delitem__ method with children node validation. :param int index: position where to insert the item.
Definition at line 266 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._del_parent_link(), psyclone.psyir.nodes.node.ChildrenList._node_reference, and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.__setitem__ | ( | self, | |
index, | |||
item | |||
) |
Extends list __setitem__ method with children node validation. :param int index: position where to insert the item. :param item: item to be inserted to the list. :type item: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 216 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._check_is_orphan(), psyclone.psyir.nodes.node.ChildrenList._del_parent_link(), psyclone.psyir.nodes.node.ChildrenList._node_reference, psyclone.psyir.nodes.node.ChildrenList._set_parent_link(), and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.append | ( | self, | |
item | |||
) |
Extends list append method with children node validation. :param item: item to be appened to the list. :type item: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 203 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._check_is_orphan(), psyclone.psyir.nodes.node.ChildrenList._node_reference, psyclone.psyir.nodes.node.ChildrenList._set_parent_link(), and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.clear | ( | self | ) |
Wipes the list.
Definition at line 320 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._del_parent_link(), and psyclone.psyir.nodes.node.ChildrenList._node_reference.
def psyclone.psyir.nodes.node.ChildrenList.extend | ( | self, | |
items | |||
) |
Extends list extend method with children node validation. :param items: list of items to be appened to the list. :type items: list of :py:class:`psyclone.psyir.nodes.Node`
Definition at line 249 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._check_is_orphan(), psyclone.psyir.nodes.node.ChildrenList._node_reference, psyclone.psyir.nodes.node.ChildrenList._set_parent_link(), and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.insert | ( | self, | |
index, | |||
item | |||
) |
Extends list insert method with children node validation. :param int index: position where to insert the item. :param item: item to be inserted to the list. :type item: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 231 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._check_is_orphan(), psyclone.psyir.nodes.node.ChildrenList._node_reference, psyclone.psyir.nodes.node.ChildrenList._set_parent_link(), and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.pop | ( | self, | |
index = -1 |
|||
) |
Extends list pop method with children node validation. :param int index: position of the item that is popped out, if not \ given, the last element is popped out. :returns: the last value or the given index value from the list. :rtype: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 292 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._del_parent_link(), psyclone.psyir.nodes.node.ChildrenList._node_reference, and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.remove | ( | self, | |
item | |||
) |
Extends list remove method with children node validation. :param item: item to be deleted the list. :type item: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 279 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._del_parent_link(), psyclone.psyir.nodes.node.ChildrenList._node_reference, and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.reverse | ( | self | ) |
Extends list reverse method with children node validation.
Definition at line 311 of file node.py.
References psyclone.psyir.nodes.node.ChildrenList._node_reference, and psyclone.psyir.nodes.node.ChildrenList._validate_item().
def psyclone.psyir.nodes.node.ChildrenList.sort | ( | self, | |
reverse = False , |
|||
key = None |
|||
) |