svoid tok_selfType(L tok) { int i; mainLoop: while ((i = jfind(tok, "selfType ")) >= 0) { // Now find class name by going backwards. int j = i, level = 1; while (j > 0 && level > 0) { t = tok.get(j); if (t.equals("}")) ++level; if (t.equals("{")) --level; j -= 2; } // search for class name while (j > 0) { t = tok.get(j); if (t.equals("class")) { String className = tok.get(j+2); tok.set(i, className); continue mainLoop; } j -= 2; } tok.set(i, "unknownSelfType"); // avoid endless loop } }