return ret.toString();
}
- public boolean isDone() throws Parser.Failed {
+ public boolean isDone() throws ParseFailed {
if (token != null) return false;
if (token==null && finalResult==null)
- throw new Parser.Failed(error(red("unexpected end of file\n")),
+ throw new ParseFailed(error(red("unexpected end of file\n")),
getLocation());
return true;
}
}
/** perform all shift operations, adding promoted nodes to <tt>next</tt> */
- public void shift(Phase next, Forest result) throws Parser.Failed {
+ public void shift(Phase next, Forest result) throws ParseFailed {
if (prev!=null) prev.hash = null;
this.next = next;
closed = true;
}
if (!good && token!=null)
- throw new Parser.Failed(error(red("unexpected character")+" "+purple(token)+" encountered at "+green(getLocation())+"\n"),
+ throw new ParseFailed(error(red("unexpected character")+" "+purple(token)+" encountered at "+green(getLocation())+"\n"),
getLocation());
if (token==null && finalResult==null)
- throw new Parser.Failed(error(red("unexpected end of file\n")),
+ throw new ParseFailed(error(red("unexpected end of file\n")),
getLocation());
// this massively improves GC performance