Exemplo n.º 1
0
 /**
  * Construct a flow graph for the <code>Expr</code> provided, and call <code>dataflow(FlowGraph)
  * </code>. Is also responsible for calling <code>post(FlowGraph, Term)</code> after <code>
  * dataflow(FlowGraph)</code> has been called. There is no need to push a CFG onto the stack, as
  * dataflow is not performed on entry in this analysis.
  */
 protected void dataflow(Expr root) throws SemanticException {
   // Build the control flow graph.
   FlowGraph g = new FlowGraph(root, forward);
   CFGBuilder v = createCFGBuilder(ts, g);
   v.visitGraph();
   dataflow(g);
   post(g, root);
 }
Exemplo n.º 2
0
  public List acceptCFG(CFGBuilder v, List succs) {
    v.visitCFGList(inits, (cond != null ? cond.entry() : body.entry()));

    if (cond != null) {
      if (condIsConstantTrue()) {
        v.visitCFG(cond, body.entry());
      } else {
        v.visitCFG(cond, FlowGraph.EDGE_KEY_TRUE, body.entry(), FlowGraph.EDGE_KEY_FALSE, this);
      }
    }

    v.push(this).visitCFG(body, continueTarget());
    v.visitCFGList(iters, (cond != null ? cond.entry() : body.entry()));

    return succs;
  }
Exemplo n.º 3
0
 public List acceptCFG(CFGBuilder v, List succs) {
   v.visitCFG(expr, this);
   return succs;
 }