+
+ // PushBack Stuff ////////////////////////////////////////////////////////////
+
+ int pushBackDepth = 0;
+ int[] pushBackInts = new int[10];
+ Object[] pushBackObjects = new Object[10];
+
+ public void pushBackToken(int op, Object obj) {
+ if (pushBackDepth >= pushBackInts.length - 1) {
+ int[] newInts = new int[pushBackInts.length * 2];
+ System.arraycopy(pushBackInts, 0, newInts, 0, pushBackInts.length);
+ pushBackInts = newInts;
+ Object[] newObjects = new Object[pushBackObjects.length * 2];
+ System.arraycopy(pushBackObjects, 0, newObjects, 0, pushBackObjects.length);
+ pushBackObjects = newObjects;
+ }
+ pushBackInts[pushBackDepth] = op;
+ pushBackObjects[pushBackDepth] = obj;
+ pushBackDepth++;
+ }
+
+ public void pushBackToken() { pushBackToken(op, number != null ? (Object)number : (Object)string); }
+
+ public int peekToken() throws IOException {
+ int ret = getToken();
+ pushBackToken();
+ return ret;
+ }
+
+ public int getToken() throws IOException {
+ number = null;
+ string = null;
+ if (pushBackDepth > 0) {
+ pushBackDepth--;
+ op = pushBackInts[pushBackDepth];
+ if (pushBackObjects[pushBackDepth] != null) {
+ number = pushBackObjects[pushBackDepth] instanceof Number ? (Number)pushBackObjects[pushBackDepth] : null;
+ string = pushBackObjects[pushBackDepth] instanceof String ? (String)pushBackObjects[pushBackDepth] : null;
+ }
+ } else {
+ do {
+ op = _getToken();
+ if (op == EOL) { line++; col = 0; }
+ } while (op == EOL);
+ }
+ return op;
+ }
+