Package dk.brics.xact.analysis

Examples of dk.brics.xact.analysis.XMLAnalysis


    }

    public static void main(String[] args) throws IOException {
        // init xact
        XMLAnalysis analysis = new XMLAnalysis(null,
                Collections.singletonList(HotspotTest1.class.getName()));
        analysis.loadClasses();

        Set<ValueBox> hotspots = new HashSet<ValueBox>();
        Map<ValueBox, SootMethod> hotspot2method = new HashMap<ValueBox, SootMethod>();
        for (SootClass cl : Scene.v().getApplicationClasses()) {
            for (SootMethod m : cl.getMethods()) {
                if (!m.isConcrete())
                    continue; // ignore abstract methods etc.
                if (!m.isPublic())
                    continue; // only public
                if (!m.getReturnType().equals(RefType.v("dk.brics.xact.XML")))
                    continue; // only methods that return XML (FIXME: Will
                              // exclude more specific types like Element)
                Body body = m.retrieveActiveBody();
                for (Unit unit : body.getUnits()) {
                    if (unit instanceof ReturnStmt) {
                        ReturnStmt stmt = (ReturnStmt) unit;
                        hotspots.add(stmt.getOpBox());
                        hotspot2method.put(stmt.getOpBox(), m);
                    }
                }
            }
        }

        analysis.setConfiguration(new JWIGConfiguration(hotspots));

        // run xact
        TranslationResult result = analysis.buildFlowGraph();

        analysis.transformFlowGraph(result.getGraph());

        final FlowGraph graph = result.getGraph();
        XMLGraphBuilder xmlGraphs = analysis.buildXMLGraphs(graph);

        int counter = 0;
        for (Map.Entry<ValueBox, AnalyzeStm> en : result.getHotspots()
                .entrySet()) {
            ValueBox value = en.getKey();
View Full Code Here


      if (c.startsWith("-dir=")) {
        addClassesFromDir("", new File(c.substring("-dir=".length())), true, packageFilter, classes);
      }
    }
   
    XMLAnalysis an = new XMLAnalysis(System.getProperty("soot-classpath"), classes);
    //an.setDiagnostics(new DumpfileDiagnostics("Analyzer", new File("out")).alwaysDump());
    an.setConfiguration(new JWIGConfiguration());
    an.analyze();
   
  }
View Full Code Here

        log.info("Starting xact analysis");
        // non constant gap names has been reported already - no need to crash
        // and burn on them
        System.setProperty("dk.brics.xact.analysis.ignore-non-constant-string",
                true + "");
        XMLAnalysis analysis = new XMLAnalysis(null, classes);
        analysis.loadClasses();
        analysis.setConfiguration(new JWIGConfiguration(stmt2box.values()));
        TranslationResult result = analysis.buildFlowGraph();

        analysis.transformFlowGraph(result.getGraph());

        final FlowGraph graph = result.getGraph();
        XMLGraphBuilder xmlGraphs = analysis.buildXMLGraphs(graph);
        log.info("xact analysis done");

        Map<ChoiceNode, Set<Plugging>> gap2plug = linkGapsToPluggings(
                pluggings, stmt2box, result, xmlGraphs);
View Full Code Here

TOP

Related Classes of dk.brics.xact.analysis.XMLAnalysis

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.