private ParseTreeNode parse() throws ParseException {
ParseTreeNode input;
if (ContentType.JS == type) {
JsLexer lexer = new JsLexer(cp);
JsTokenQueue tq = new JsTokenQueue(lexer, is);
if (tq.isEmpty()) { return null; }
Parser p = new Parser(tq, mq);
input = p.parse();
tq.expectEmpty();
} else if (ContentType.HTML == type) {
DomParser p = new DomParser(new HtmlLexer(cp), false, is, mq);
//if (p.getTokenQueue().isEmpty()) { return null; }
input = Dom.transplant(p.parseDocument());
p.getTokenQueue().expectEmpty();