1 30 31 35 36 package jbet.cmd; 37 import jbet.*; 38 import java.io.*; 39 import java.util.*; 40 41 public class fixpclines implements Command 42 { 43 public int helplevel() { return 3; } 44 public String shorthelp() { return "change line numbers to pcs"; } 45 public String longhelp() { 46 return 47 "jbet fixpclines <classes>\nChange all line number records in <classes> to be instruction counters\n"; } 48 49 public void run (Lexer lexer) throws Exception 50 { 51 Vector classes = new Vector(); 52 lexer.match (Token.END_OF_OPTS); 53 lexer.getClassNames(classes); 54 lexer.term(); 55 56 for (Iterator i = classes.iterator(); i.hasNext(); ) { 57 ClassInfo cr = Jbet.loader.getClass (i.next().toString()); 58 59 cr.sourceFile = "pc"; 60 cr.setDirty(); 61 62 for (int j = 0; j < cr.numMethods(); j++) { 63 MethodInfo mi = cr.methodAt (j); 64 65 if (mi.code != null) { 66 mi.code.lnVector = new Vector(); 67 mi.code.addLinesAsPCs(cr.constantPool()); 68 69 } 70 } 71 } 72 } 73 } 74 | Popular Tags |