1 30 31 42 43 44 package jbet; 45 import java.io.*; 46 47 48 class LineNumRec { 49 BranchTarget start = new BranchTarget(); int lineNumber; 51 52 LineNumRec dup() { 53 try { 54 return (LineNumRec) clone(); 55 } catch (CloneNotSupportedException e) { 56 return null; 57 } 58 } 59 60 LineNumRec() {} 61 62 LineNumRec (Instruction i, int n) { 63 start.instr = i; 64 lineNumber = n; 65 } 66 67 LineNumRec (DataInputStream dataIn) throws IOException { 68 start.offset = dataIn.readUnsignedShort(); 69 lineNumber = dataIn.readUnsignedShort(); 70 } 71 72 String recString() { 73 return "LineNumRec: startPC(" + start.instr.pc() + ") lineNumber(" + 74 lineNumber + ")"; 75 } 76 77 void writeFile (DataOutputStream dataOut) throws IOException { 78 dataOut.writeShort (start.offset); 79 dataOut.writeShort (lineNumber); 80 } 81 82 83 } 84 85 | Popular Tags |