throw new SyntaxError( "No more tokens.  Expecting " + this.terminals.get(expecting) );
}
if (current.getId() != expecting) {
Formatter formatter = new Formatter(new StringBuilder(), Locale.US);
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
<BUG>formatter.format("Unexpected symbol when parsing %s.  Expected %s, got %s.", stack[2].getMethodName(), this.terminals.get(expecting), current != null ? current.getTerminalStr() : "<end of stream>");
throw new SyntaxError(formatter.toString());</BUG>
}
Terminal next = advance();
if ( next != null && !this.terminals.isValid(next.getId()) ) {

throw new SyntaxError( "No more tokens.  Expecting " + this.terminals.get(expecting) );
}
if (current.getId() != expecting) {
Formatter formatter = new Formatter(new StringBuilder(), Locale.US);
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
formatter.format("Unexpected symbol when parsing %s.  Expected %s, got %s.", stack[2].getMethodName(), this.terminals.get(expecting), current != null ? current : "<end of stream>");
throw new SyntaxError(formatter.toString());
}
Terminal next = advance();
if ( next != null && !this.terminals.isValid(next.getId()) ) {
