Edge update so it works for Jgrapht
This commit is contained in:
@@ -4,10 +4,16 @@ import org.jgrapht.graph.DefaultEdge;
|
|||||||
public class CFGEdge extends DefaultEdge {
|
public class CFGEdge extends DefaultEdge {
|
||||||
//path defines if its a True or False or Null (when either T or F resulkt on the same node)
|
//path defines if its a True or False or Null (when either T or F resulkt on the same node)
|
||||||
private boolean path;
|
private boolean path;
|
||||||
|
private CFGNode from;
|
||||||
|
private CFGNode to;
|
||||||
|
|
||||||
public CFGEdge(boolean path) {
|
public CFGEdge() {
|
||||||
this.path = path;
|
this(null, null);
|
||||||
|
}
|
||||||
|
public CFGEdge(CFGNode from, CFGNode to) {
|
||||||
|
this.from = from;
|
||||||
|
this.to = to;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPath(boolean path) { this.path = path; }
|
||||||
}
|
}
|
||||||
@@ -59,12 +59,12 @@ public class LCA_JP1_0_0 {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(ExpressionStmt n, Void arg) {
|
public void visit(ExpressionStmt n, Void arg) {
|
||||||
// CFGNode exprNode = new CFGNode(n.toString())
|
CFGNode exprNode = new CFGNode(n.toString());
|
||||||
// currCFG.addVertex(exprNode)
|
currCFG.addVertex(exprNode);
|
||||||
// //link nodes
|
//link nodes
|
||||||
// currCFG.addEdge(currentBlock, exprNode);
|
super.visit(n, arg);
|
||||||
// currentBlock = exprNode;
|
currCFG.addEdge(currentBlock, exprNode);
|
||||||
// super.visit(n, arg);
|
currentBlock = exprNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user