'Expand the first element of the frontier.  In particular, if
the first element of the frontier is a subtree whose node type
is equal to ``production``\'s left hand side, then add a child
to that subtree for each element of ``production``\'s right hand
side.  If ``production`` is not specified, then use the first
untried expandable production.  If all expandable productions
have been tried, do nothing.
:return: The production used to expand the frontier, if an
expansion was performed.  If no expansion was performed,
return None.
:rtype: Production or None'

def expand(self, production=None):

    if (len(self._frontier) == 0):
        return None
    if (not isinstance(self._tree[self._frontier[0]], Tree)):
        return None
    if (production is None):
        productions = self.untried_expandable_productions()
    else:
        productions = [production]
    parses = []
    for prod in productions:
        self._tried_e.setdefault(self._freeze(self._tree), []).append(prod)
        for _result in self._expand(self._rtext, self._tree, self._frontier, prod):
            return prod
    return None
