- private Line currentLine = new Line();
- private class Line {
- public StringBuffer line = new StringBuffer();
- }
-
- private class LocWrap implements Location {
- Line myline = Stream.this.currentLine;
- public final int line;
- public final int col;
- public String toString() { return line + ":" + col; }
- public LocWrap(int line, int col) { this.line = line; this.col = col; }
- public String getContext() {
- StringBuffer spaces = new StringBuffer();
- for(int i=0; i<col-1; i++) spaces.append(' ');
- spaces.append('^');
- return " " + myline.line.toString() + "\n " + spaces.toString();
- }
- }
-
- long then = 0;
- public Token next() throws IOException {