'reset the parser\'s state; subclasses must rewinds the input stream'

def reset(self):

    if (self._state is None):
        return
    self._state.following = []
    self._state.errorRecovery = False
    self._state.lastErrorIndex = (-1)
    self._state.syntaxErrors = 0
    self._state.backtracking = 0
    if (self._state.ruleMemo is not None):
        self._state.ruleMemo = {}
