TextBuffer (int indent, BytecodeMappingTracer tracer) { TextBuffer buf = new TextBuffer(); buf.append(ExprProcessor.listToJava(varDefinitions, indent, tracer)); buf.append(first.toJava(indent, tracer)); if (isLabeled()) { buf.appendIndent(indent).append("label").append(Integer.toString(id)).append(":").appendLineSeparator(); tracer.incrementCurrentSourceLine(); } buf.appendIndent(indent).append(headexprent.get(0).toJava(indent, tracer)).append(" {").appendLineSeparator(); tracer.incrementCurrentSourceLine(); if (ifstat == null) { boolean semicolon = false; if (ifedge.explicit) { semicolon = true; if (ifedge.getType() == EdgeType.BREAK) { // break buf.appendIndent(indent + 1).append("break"); } else { // continue buf.appendIndent(indent + 1).append("continue"); } if (ifedge.labeled) { buf.append(" label").append(Integer.toString(ifedge.closure.id)); } } if(semicolon) { buf.append(";").appendLineSeparator(); tracer.incrementCurrentSourceLine(); } } else { buf.append(ExprProcessor.jmpWrapper(ifstat, indent + 1, true, tracer)); } boolean elseif = false; if (elsestat != null) { if (elsestat.type == StatementType.IF && elsestat.varDefinitions.isEmpty() && elsestat.getFirst().getExprents().isEmpty() && !elsestat.isLabeled() && (elsestat.getSuccessorEdges(EdgeType.DIRECT_ALL).isEmpty() || !elsestat.getSuccessorEdges(EdgeType.DIRECT_ALL).get(0).explicit)) { // else if buf.appendIndent(indent).append("} else "); TextBuffer content = ExprProcessor.jmpWrapper(elsestat, indent, false, tracer); content.setStart(TextUtil.getIndentString(indent).length()); buf.append(content); elseif = true; } else { BytecodeMappingTracer else_tracer = new BytecodeMappingTracer(tracer.getCurrentSourceLine() + 1); TextBuffer content = ExprProcessor.jmpWrapper(elsestat, indent + 1, false, else_tracer); if (content.length() > 0) { buf.appendIndent(indent).append("} else {").appendLineSeparator(); tracer.setCurrentSourceLine(else_tracer.getCurrentSourceLine()); tracer.addTracer(else_tracer); buf.append(content); } } } if (!elseif) { buf.appendIndent(indent).append("}").appendLineSeparator(); tracer.incrementCurrentSourceLine(); }