protected void parseLegalDocStrWithoutTree(String s, Object... additionalErrInfo) { try { parseLegalDoc(new Document(s), additionalErrInfo, parser.getGrammarVersion(), false); } catch (MisconfigurationException e) { throw new RuntimeException(e); } }
protected static SimpleNode parseLegalDoc( IDocument doc, Object[] additionalErrInfo, PyParser parser) { try { return parseLegalDoc(doc, additionalErrInfo, parser.getGrammarVersion(), true); } catch (MisconfigurationException e) { throw new RuntimeException(e); } }
protected Throwable parseILegalDoc(IDocument doc, boolean generateTree) { Tuple<ISimpleNode, Throwable> objects; try { objects = PyParser.reparseDocument(new ParserInfo(doc, parser.getGrammarVersion(), generateTree)); } catch (MisconfigurationException e) { throw new RuntimeException(e); } Throwable err = objects.o2; if (err == null) { fail("Expected a ParseException and the doc was successfully parsed."); } if (!(err instanceof ParseException) && !(err instanceof TokenMgrError)) { fail("Expected a ParseException and received:" + err.getClass()); } return err; }