1 19 20 package jode.flow; 21 import jode.decompiler.TabbedPrintWriter; 22 23 26 public class ContinueBlock extends StructuredBlock { 27 LoopBlock continuesBlock; 28 String continueLabel; 29 30 public ContinueBlock(LoopBlock continuesBlock, boolean needsLabel) { 31 this.continuesBlock = continuesBlock; 32 if (needsLabel) 33 continueLabel = continuesBlock.getLabel(); 34 else 35 continueLabel = null; 36 } 37 38 public void checkConsistent() { 39 super.checkConsistent(); 40 StructuredBlock sb = outer; 41 while (sb != continuesBlock) { 42 if (sb == null) 43 throw new RuntimeException ("Inconsistency"); 44 sb = sb.outer; 45 } 46 } 47 48 51 public boolean isEmpty() { 52 return true; 53 } 54 55 59 public StructuredBlock getNextBlock() { 60 61 return continuesBlock; 62 } 63 64 71 public FlowBlock getNextFlowBlock() { 72 return null; 73 } 74 75 83 public VariableStack mapStackToLocal(VariableStack stack) { 84 continuesBlock.mergeContinueStack(stack); 85 return null; 86 } 87 88 public void dumpInstruction(TabbedPrintWriter writer) 89 throws java.io.IOException 90 { 91 writer.println("continue"+ 92 (continueLabel == null ? "" : " "+continueLabel) + ";"); 93 } 94 95 public boolean needsBraces() { 96 return false; 97 } 98 99 public boolean jumpMayBeChanged() { 100 return true; 101 } 102 } 103 | Popular Tags |