KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > MainDriver


1 /* Usage: java MainDriver appClass
2  */

3
4 /* import necessary soot packages */
5 import soot.*;
6
7 public class MainDriver {
8   public static void main(String JavaDoc[] args) {
9
10     /* check the arguments */
11     if (args.length == 0) {
12       System.err.println("Usage: java MainDriver [options] classname");
13       System.exit(0);
14     }
15     
16     /* add a phase to transformer pack by call Pack.add */
17     Pack jtp = PackManager.v().getPack("jtp");
18     jtp.add(new Transform("jtp.instrumenter",
19               new InvokeStaticInstrumenter()));
20
21     /* Give control to Soot to process all options,
22      * InvokeStaticInstrumenter.internalTransform will get called.
23      */

24     soot.Main.main(args);
25   }
26 }
27
28
29
Popular Tags