parser.py: Returning leaf nodes of parse tree