@Test public void exitRule() { BatfishCombinedParser<?, ?> parser = new RecoveryCombinedParser(TEXT, SETTINGS); _thrown.expect(BatfishParseException.class); _thrown.expect(hasStackTrace(containsString("throwExit"))); new BatfishParseTreeWalker(parser) .walk(new TestExitThrowingParseTreeListener(), parser.parse()); }
@Override protected void exitRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { ctx.exitRule(listener); listener.exitEveryRule(ctx); } catch (WillNotCommitException e) { throw e; } catch (Exception e) { throw new BatfishParseException( String.format("Exception while walking parse tree: %s", e.getMessage()), e, new ErrorDetails( Throwables.getStackTraceAsString(e), new ParseExceptionContext(ctx, _parser, _parser.getInput()))); } }
BatfishParseTreeWalker extends ParseTreeWalker { @Override protected void exitRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { ctx.exitRule(listener); listener.exitEveryRule(ctx); } catch (WillNotCommitException e) { throw e; } catch (Exception e) { throw new BatfishParseException( String.format("Exception while walking parse tree: %s", e.getMessage()), e, new ErrorDetails( Throwables.getStackTraceAsString(e), new ParseExceptionContext(ctx, _parser, _parser.getInput()))); } } }
BatfishParseTreeWalker extends ParseTreeWalker { @Override protected void exitRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { ctx.exitRule(listener); listener.exitEveryRule(ctx); } catch (WillNotCommitException e) { throw e; } catch (Exception e) { throw new BatfishParseException( String.format("Exception while walking parse tree: %s", e.getMessage()), e, new ErrorDetails( Throwables.getStackTraceAsString(e), new ParseExceptionContext(ctx, _parser, _parser.getInput()))); } } BatfishParseTreeWalker(BatfishCombinedParser<?, ?> parser); }
BatfishParseTreeWalker extends ParseTreeWalker { @Override protected void exitRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { ctx.exitRule(listener); listener.exitEveryRule(ctx); } catch (WillNotCommitException e) { throw e; } catch (Exception e) { throw new BatfishParseException( String.format("Exception while walking parse tree: %s", e.getMessage()), e, new ErrorDetails( Throwables.getStackTraceAsString(e), new ParseExceptionContext(ctx, _parser, _parser.getInput()))); } } BatfishParseTreeWalker(BatfishCombinedParser<?, ?> parser);  }
BatfishParseTreeWalker extends ParseTreeWalker { @Override protected void exitRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { ctx.exitRule(listener); listener.exitEveryRule(ctx); } catch (WillNotCommitException e) { throw e; } catch (Exception e) { throw new BatfishParseException( String.format("Exception while walking parse tree: %s", e.getMessage()), e, new ErrorDetails( Throwables.getStackTraceAsString(e), new ParseExceptionContext(ctx, _parser, _parser.getInput()))); } } BatfishParseTreeWalker(BatfishCombinedParser<?, ?> parser);   }