'Return the leaves of the tree.
>>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
>>> t.leaves()
[\'the\', \'dog\', \'chased\', \'the\', \'cat\']
:return: a list containing this tree\'s leaves.
The order reflects the order of the
leaves in the tree\'s hierarchical structure.
:rtype: list'

def leaves(self):

    leaves = []
    for child in self:
        if isinstance(child, Tree):
            leaves.extend(child.leaves())
        else:
            leaves.append(child)
    return leaves
