'Match the first element of the frontier.  In particular, if
the first element of the frontier has the same type as the
next text token, then substitute the text token into the tree.
:return: The token matched, if a match operation was
performed.  If no match was performed, return None
:rtype: str or None'

def match(self):

    tok = self._rtext[0]
    self._tried_m.setdefault(self._freeze(self._tree), []).append(tok)
    if (len(self._frontier) == 0):
        return None
    if isinstance(self._tree[self._frontier[0]], Tree):
        return None
    for _result in self._match(self._rtext, self._tree, self._frontier):
        return self._history[(-1)][0][0]
    return None
