'Yields parent nodes of type `type`.
:param nodetys: The types of nodes to yield. Default to list
containing base type.
:param startnode: Start node.'

def _get_parent_nodes(self, startnode, nodetys=[phpast.Node]):

    parent = getattr(startnode, '_parent_node', None)
    while parent:
        if (type(parent) in nodetys):
            (yield parent)
        parent = getattr(parent, '_parent_node', None)
