1 30 31 35 36 package jbet.cmd; 37 import jbet.*; 38 import java.io.*; 39 import java.util.*; 40 41 public class listdags implements Command 42 { 43 public int helplevel() { return 3; } 44 public String shorthelp() { return "list basic blocks as DAGS"; } 45 public String longhelp() { 46 return 47 "jbet listdags <class>.<method>\t\tList basic blocks, in DAG representation\n"; } 48 49 public void run (Lexer lexer) throws Exception 50 { 51 loop: 52 while(true) { 53 switch(lexer.read().type) { 54 case Token.END_OF_OPTS: break loop; 55 default: lexer.unexpected(lexer.justread()); 56 } 57 } 58 59 Object thing = lexer.getThing(Jbet.default_class); 60 MethodInfo mi; 61 if (thing instanceof MethodInfo) 62 mi = (MethodInfo) thing; 63 else { 64 Jbet.output.println("listdags: not a method"); 65 return; 66 } 67 lexer.term(); 68 69 DagSnippit dags = DagSnippit.graphify (mi); 70 71 dags.method = new DagMethodInfo (new DagClassInfo (mi.cr), mi); 72 73 dags.printinfo(Jbet.output); 74 } 75 } 76 | Popular Tags |