'Return the parser to its state before the most recent
shift or reduce operation.  Calling ``undo`` repeatedly return
the parser to successively earlier states.  If no shift or
reduce operations have been performed, ``undo`` will make no
changes.
:return: true if an operation was successfully undone.
:rtype: bool'

def undo(self):

    if (len(self._history) == 0):
        return False
    (self._stack, self._remaining_text) = self._history.pop()
    return True
