1 19 20 package jode.flow; 21 import jode.decompiler.TabbedPrintWriter; 22 import jode.expr.Expression; 23 24 27 public class ReturnBlock extends InstructionContainer { 28 31 VariableStack stack; 32 33 public ReturnBlock() { 34 super(null); 35 } 36 37 public ReturnBlock(Expression instr) { 38 super(instr, new Jump(FlowBlock.END_OF_METHOD)); 39 } 40 41 47 public VariableStack mapStackToLocal(VariableStack stack) { 48 VariableStack newStack = stack; 49 if (instr != null) { 50 int params = instr.getFreeOperandCount(); 51 if (params > 0) { 52 this.stack = stack.peek(params); 53 newStack = stack.pop(params); 54 } 55 } 56 if (jump != null) 57 jump.stackMap = newStack; 58 return null; 59 } 60 61 public void removePush() { 62 if (stack != null) 63 instr = stack.mergeIntoExpression(instr); 64 } 65 66 70 public boolean needsBraces() { 71 return declare != null && !declare.isEmpty(); 72 } 73 74 public void dumpInstruction(TabbedPrintWriter writer) 75 throws java.io.IOException 76 { 77 writer.print("return"); 78 if (instr != null) { 79 writer.print(" "); 80 instr.dumpExpression(writer.IMPL_PAREN, writer); 81 } 82 writer.println(";"); 83 } 84 } 85 | Popular Tags |