1 2 package org.quilt.cl; 3 4 import java.util.HashMap ; 5 import java.util.Map ; 6 import org.apache.bcel.generic.InstructionList; 7 import org.quilt.graph.*; 8 9 15 public class ControlFlowGraph extends Directed { 16 17 18 protected Map startHandles = null; 19 20 protected Map endHandles = null; 21 23 protected Map gotoFixMeUps = null; 24 25 protected InstructionList ilist = null; 26 27 28 public Map getStartHandles() { 29 return startHandles; 30 } 31 32 public Map getEndHandles() { 33 return endHandles; 34 } 35 37 public Map getGotoFixMeUps() { 38 return gotoFixMeUps; 39 } 40 42 public InstructionList getInstructionList() { 43 return ilist; 44 } 45 46 47 public ControlFlowGraph () { 48 super(); 49 startHandles = new HashMap (); 50 endHandles = new HashMap (); 51 gotoFixMeUps = new HashMap (); 52 ilist = new InstructionList(); 53 } 54 59 protected ControlFlowGraph( ControlFlowGraph parent) { 60 super(parent); 61 startHandles = parent.startHandles; 62 endHandles = parent.endHandles; 63 gotoFixMeUps = parent.gotoFixMeUps; 64 ilist = parent.ilist; 65 } 66 75 public Directed subgraph (final Edge e, final int n) { 76 return super.connectSubgraph( new ControlFlowGraph(this), e, n); 77 } 78 79 86 public CodeVertex insertCodeVertex (Edge e) { 87 return (CodeVertex) super.insertVertex ( new CodeVertex(this), e); 88 } 89 90 97 public CodeVertex insertCodeVertex (CodeVertex v, Edge e) { 98 return (CodeVertex) super.insertVertex (v, e); 99 } 100 } 101 | Popular Tags |