Package dk.brics.string.flow

Examples of dk.brics.string.flow.FlowGraph


        this.aa = aa;
        this.ass = ass;
        this.corruptAutomaton = corruptAutomaton;
        dv = new DefinesVisitor();
        dva = new DefinesVisitor(aa);
        g = new FlowGraph();
        map = new HashMap<Statement, Map<Variable, Node>>();
        fieldNodes = new HashMap<Field, AssignmentNode>();
        trans_map = new HashMap<Statement, Node>();

        for (Method m : app.getMethods()) {
View Full Code Here


        //
        //  Create flow graph
        //
        log.info("Generating flow graph...");
        Intermediate2FlowGraph tr = new Intermediate2FlowGraph(app);
        FlowGraph g = tr.convert(alias, reachingDefinitions, assertions);
       
        // Notify diagnostics of flow graph
        diagnostics.flowGraphCompleted(g);
       
        Map<Statement, Node> m2 = tr.getTranslationMap();
        if (log.isDebugEnabled()) {
            log.debug("Statement -> Node:");
            for (Map.Entry<Statement, Node> me : m2.entrySet()) {
                log.debug("  " + me.getKey() + " -> " + me.getValue());
            }
        }
        log.info("Simplifying flow graph...");
        Map<Node, Node> m3 = g.simplify();
        Set<Node> nodes = new HashSet<Node>();
        for (Statement ss : hotspot_statements) {
            Node beforeSimplifyNode = m2.get(ss);
            Node n = m3.get(beforeSimplifyNode);
            if (n != null) {
                nodes.add(n);
            }
        }
        for (StringStatement ss : jt.getToStringHotspotMap().values()) {
            Node n = m3.get(m2.get(ss));
            if (n != null) {
                nodes.add(n);
            }
        }
        for (Node n : m3.keySet()) { // TODO: inefficient, use entrySet iterator instead
            Node n2 = m3.get(n);
            if (n.isTaint() && n2 != null) {
                n2.setTaint(true);
            }
        }
        if (log.isDebugEnabled()) {
            log.debug(g.toDot(nodes));
        }
        log.info("Transforming into grammar...");
        FlowGraph2Grammar f2g = new FlowGraph2Grammar(g);
        Grammar r = f2g.convert();
        Set<Nonterminal> hs_nt = new HashSet<Nonterminal>();
View Full Code Here

TOP

Related Classes of dk.brics.string.flow.FlowGraph

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.