'Recursively expand and match each elements of ``tree``
specified by ``frontier``, to cover ``remaining_text``.  Return
a list of all parses found.
:return: An iterator of all parses that can be generated by
matching and expanding the elements of ``tree``
specified by ``frontier``.
:rtype: iter(Tree)
:type tree: Tree
:param tree: A partial structure for the text that is
currently being parsed.  The elements of ``tree``
that are specified by ``frontier`` have not yet been
expanded or matched.
:type remaining_text: list(str)
:param remaining_text: The portion of the text that is not yet
covered by ``tree``.
:type frontier: list(tuple(int))
:param frontier: A list of the locations within ``tree`` of
all subtrees that have not yet been expanded, and all
leaves that have not yet been matched.  This list sorted
in left-to-right order of location within the tree.'

def _parse(self, remaining_text, tree, frontier):

    if ((len(remaining_text) == 0) and (len(frontier) == 0)):
        if self._trace:
            self._trace_succeed(tree, frontier)
        (yield tree)
    elif (len(frontier) == 0):
        if self._trace:
            self._trace_backtrack(tree, frontier)
    elif isinstance(tree[frontier[0]], Tree):
        for result in self._expand(remaining_text, tree, frontier):
            (yield result)
    else:
        for result in self._match(remaining_text, tree, frontier):
            (yield result)
