@Test public void enterRule() { BatfishCombinedParser<?, ?> parser = new RecoveryCombinedParser(TEXT, SETTINGS); _thrown.expect(BatfishParseException.class); _thrown.expect(hasStackTrace(containsString("throwEnter"))); new BatfishParseTreeWalker(parser) .walk(new TestEnterThrowingParseTreeListener(), parser.parse()); }
@Override protected void enterRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { listener.enterEveryRule(ctx); ctx.enterRule(listener); } 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 enterRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { listener.enterEveryRule(ctx); ctx.enterRule(listener); } 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 enterRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { listener.enterEveryRule(ctx); ctx.enterRule(listener); } 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 enterRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { listener.enterEveryRule(ctx); ctx.enterRule(listener); } 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 enterRule(ParseTreeListener listener, RuleNode r) { ParserRuleContext ctx = (ParserRuleContext) r.getRuleContext(); try { listener.enterEveryRule(ctx); ctx.enterRule(listener); } 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);   }