'Return self if leaf, otherwise the leaf node that succeeds this
node in the parse tree.'

def get_next_leaf(self):

    node = self
    while (not isinstance(node, Leaf)):
        assert node.children
        node = node.children[0]
    return node
