int _row = 0;
int _col = 0;
+ public Token.Location getLocation() { return new CharToken.CartesianLocation(_row, _col); }
public CharToken next() throws IOException {
if (cur==null) return null;
if (s != null) {
char c = s.charAt(spos++);
if (c=='\n') { _row++; _col = 0; }
else _col++;
- return new CharToken(c, _row, _col);
+ return new CharToken(c);
}
s = null;
}
pos = cur.iip+1;
cur = cur.parent;
if (cur==null) return null;
- return CharToken.right(_row, _col);
+ return CharToken.right;
}
Object o = cur.child(pos++);
if (o instanceof String) {
}
cur = (Block)o;
pos = 0;
- return CharToken.left(_row, _col);
+ return CharToken.left;
}
public static Block parse(BufferedReader br) throws Invalid, IOException {