+
+ public void debugBodyToString(StringBuffer sb) {
+ StringBuffer sb0 = new StringBuffer();
+ super.debugBodyToString(sb0);
+ StringTokenizer st = new StringTokenizer(sb0.toString(), "\n");
+ String[] lines = new String[st.countTokens()];
+ for(int i=0; i<lines.length; i++) lines[i] = st.nextToken();
+ for(int j=0; j<ofs[0]; j++) {
+ String s = " /* " + lines[j].trim();
+ while(s.length() < 50) s += " ";
+ s += " */";
+ sb.append(s);
+ sb.append("\n");
+ }
+
+ bindingMap = new IdentityHashMap();
+ nextVar = 0;
+
+ for(int i=0; i<numOps; i++) {
+ String s = " /* " + lines[ofs[i]].trim();
+ while(s.length() < 50) s += " ";
+ s += " */ ";
+ s += ops[i].toString();
+ sb.append(s);
+ sb.append(";\n");
+ for(int j=ofs[i]+1; j<(i==numOps-1?size():ofs[i+1]); j++) {
+ s = " /* " + lines[j].trim();
+ while(s.length() < 50) s += " ";
+ s += " */";
+ sb.append(s);
+ sb.append("\n");
+ }
+ }
+ }
+
+ private Map bindingMap;
+ private int nextVar;
+ String exprToString(Expr e) {
+ if(e instanceof Constant) return e._toString();
+ String s = (String)bindingMap.get(e);
+ if(s != null) return s;
+ String prefix;
+ if(e.getType() == Type.VOID) return e._toString();
+ else if(e.getType() == Type.DOUBLE || e.getType() == Type.FLOAT) prefix = "f";
+ else if(e.getType().isPrimitive()) prefix = "i";
+ else if(e.getType().isArray()) prefix = "a";
+ else prefix = "o";
+ s = prefix + (nextVar++);
+ bindingMap.put(e,s);
+ return "(" + s + " = " + e._toString() + ")";
+ }
+