| 1 30 31 package jbet; 32 import java.io.*; 33 import java.util.*; 34 35 47 48 public class BranchTarget implements Cloneable { 49 public int key; 50 public int offset; 51 public Instruction instr; 52 public Block block; 53 public String label; 54 55 57 public BranchTarget() { 58 key = 0; 59 offset = 0; 60 instr = null; 61 block = null; 62 } 63 64 public BranchTarget(Instruction ins) { 65 key = 0; 66 offset = 0; 67 instr = ins; 68 block = null; 69 } 70 71 74 public BranchTarget dup() { 75 try { 76 return (BranchTarget) clone(); 77 } catch (Exception e) { 78 return null; 79 } 80 } 81 82 public BranchTarget (BranchTarget in) { 83 key = in.key; 84 offset = in.offset; 85 instr = in.instr; 86 block = in.block; 87 label = in.label; 88 } 89 90 93 public String recString() { 94 if (block != null) 95 return "#B" + block.swval; 96 else if (instr != null) 97 return Integer.toString (instr.pc()); 98 else 99 return "BAD"; 100 } 101 } 102 | Popular Tags |