5024502550265027502850295030503150325033
if(index > 0) { syntaxError("unexpected end-of-file",tokens.get(index-1)); } else { // I believe this is actually dead-code, since heckNotEof() // won't be called before at least one token is matched. throw new SyntaxError("unexpected end-of-file", filename, 0,0); } } }
5247524852495250525152525253
return new Attribute.Source(t1.start, t2.end(), 0); } private void syntaxError(String msg, SyntacticElement e) { Attribute.Source loc = e.attribute(Attribute.Source.class); throw new SyntaxError(msg, filename, loc.start, loc.end); }
52515252525352545255525652575258
Attribute.Source loc = e.attribute(Attribute.Source.class); throw new SyntaxError(msg, filename, loc.start, loc.end); } private void syntaxError(String msg, Token t) { throw new SyntaxError(msg, filename, t.start, t.start + t.text.length() - 1); }
502503504505506507508
* --- message to raise. * @param index * --- index position to associate the error with. */ private void syntaxError(String msg, int index) { throw new SyntaxError(msg, filename, index, index); }
353535363537353835393540354135423543
* called from contexts where we are expecting something to follow. */ private void checkNotEof() { skipWhiteSpace(); if (index >= tokens.size()) { throw new SyntaxError("unexpected end-of-file", filename, index - 1, index - 1); } }
3756375737583759376037613762
37603761376237633764376537663767