public static void main(String[] args) { CFGViewer viewer = new CFGViewer(); Transform printTransform = new Transform(phaseFullname, viewer); printTransform.setDeclaredOptions( "enabled " + altClassPathOptionName + ' ' + graphTypeOptionName + ' ' + irOptionName + ' ' + multipageOptionName + ' ' + briefLabelOptionName + ' '); printTransform.setDefaultOptions( "enabled " + altClassPathOptionName + ": " + graphTypeOptionName + ':' + defaultGraph + ' ' + irOptionName + ':' + defaultIR + ' ' + multipageOptionName + ":false " + ' ' + briefLabelOptionName + ":false "); PackManager.v().getPack("jtp").add(printTransform); args = viewer.parse_options(args); if (args.length == 0) { usage(); } else { soot.Main.main(args); } }
/** * Add a new transform to the given pack, dealing properly with options specified in the * transformer. */ public static void addTransform( Pack pack, String name, Transformer transformer, String defaultOptions) { Transform t = new Transform(name, transformer); if (transformer instanceof HasPhaseOptions) { HasPhaseOptions options = (HasPhaseOptions) transformer; // Note: First appearance of an option has precendence t.setDefaultOptions( defaultOptions + " " + options.getDefaultOptions() + " " + t.getDefaultOptions()); t.setDeclaredOptions(options.getDeclaredOptions() + " " + t.getDeclaredOptions()); } else { t.setDefaultOptions(defaultOptions + " " + t.getDefaultOptions()); } pack.add(t); }