/** reset the parser's state */ public void reset() { if ( getInputStream()!=null ) getInputStream().seek(0); _errHandler.reset(this); _ctx = null; _syntaxErrors = 0; setTrace(false); _precedenceStack.clear(); _precedenceStack.push(0); ATNSimulator interpreter = getInterpreter(); if (interpreter != null) { interpreter.reset(); } }