while(trimmed.charAt(trimmed.length() - 1) == '\\') {
String s2 = in.readLine().trim();
if (s2.startsWith("//")) s2 = s2.substring(2).trim();
- trimmed += s2;
+ trimmed = trimmed.substring(0, trimmed.length() - 1) + " " + s2;
out.println(); // preserve line numbers
}
StringTokenizer st = new StringTokenizer(trimmed, " ");
if (expEnd - expStart <= 1) { err.add(new Error("badly formed #switch statement")); continue PROCESS; }
String expr = trimmed.substring(expStart, expEnd);
- out.println("final String ccSwitch"+enumSwitch+" = (String)("+expr+");"+
- "switch(ccSwitch"+enumSwitch+".length()) {");
+ out.println("final String ccSwitch"+enumSwitch+" = (String)("+expr+");");
+ out.println("SUCCESS:do { switch(ccSwitch"+enumSwitch+".length()) {");
Hashtable[] byLength = new Hashtable[255];
String key = null;
buildTrie("", byLength[i]);
out.println("}; break; }");
}
- if (Default != null) out.println("default: { " + Default + " }");
out.println("} //switch");
+ if (Default != null) out.println(Default);
+ out.println("} while(false); //OUTER");
enumSwitch++;
} else {
String code = (String)cases.get(keys.elementAt(i));
code = code.substring(0, code.length() - 1);
String key = (String)keys.elementAt(i);
- out.println("if (\""+key+"\".equals(ccSwitch"+enumSwitch+")) { " + code + " } break; ");
+ out.println("if (\""+key+"\".equals(ccSwitch"+enumSwitch+")) { if (true) do { " + code + " } while(false); break SUCCESS; } break; ");
}
}
}