1 19 20 package jode.flow; 21 import jode.decompiler.TabbedPrintWriter; 22 23 26 public class EmptyBlock extends StructuredBlock { 27 public EmptyBlock() { 28 } 29 30 public EmptyBlock(Jump jump) { 31 setJump(jump); 32 } 33 34 37 public boolean isEmpty() { 38 return true; 39 } 40 41 45 public StructuredBlock appendBlock(StructuredBlock block) { 46 if (outer instanceof ConditionalBlock) { 47 IfThenElseBlock ifBlock = 48 new IfThenElseBlock(((ConditionalBlock)outer). 49 getInstruction()); 50 ifBlock.moveDefinitions(outer, this); 51 ifBlock.replace(outer); 52 ifBlock.moveJump(outer.jump); 53 ifBlock.setThenBlock(this); 54 } 55 block.replace(this); 56 return block; 57 } 58 59 63 public StructuredBlock prependBlock(StructuredBlock block) { 64 65 block = appendBlock(block); 66 block.moveJump(this.jump); 67 return block; 68 } 69 70 public void dumpInstruction(TabbedPrintWriter writer) 71 throws java.io.IOException 72 { 73 76 if (jump == null) 77 writer.println("/* empty */"); 78 } 79 } 80 | Popular Tags |