Loading src/main/java/tfm/exec/CFGLog.java +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import com.github.javaparser.ast.Node; import guru.nidi.graphviz.engine.Format; import guru.nidi.graphviz.engine.Graphviz; import tfm.graphs.CFGGraph; import tfm.visitors.CFGVisitor; import tfm.visitors.cfg.CFGBuilder; import java.io.File; import java.io.IOException; Loading @@ -24,7 +24,7 @@ public class CFGLog extends GraphLog<CFGGraph> { public void visit(Node node) { this.graph = new CFGGraph(); node.accept(new CFGVisitor(graph), null); node.accept(new CFGBuilder(graph), null); } @Override Loading src/main/java/tfm/exec/PDGLog.java +2 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import guru.nidi.graphviz.engine.Graphviz; import tfm.graphs.PDGGraph; import tfm.nodes.GraphNode; import tfm.utils.Logger; import tfm.visitors.PDGCFGVisitor; import tfm.visitors.pdg.PDGBuilder; import java.io.File; import java.io.IOException; Loading @@ -27,7 +27,7 @@ public class PDGLog extends GraphLog<PDGGraph> { public void visit(com.github.javaparser.ast.Node node) { this.graph = new PDGGraph(); node.accept(new PDGCFGVisitor(graph), this.graph.getRootNode()); node.accept(new PDGBuilder(graph), this.graph.getRootNode()); } @Override Loading src/main/java/tfm/exec/SDGLog.java +3 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package tfm.exec; import com.github.javaparser.ast.Node; import tfm.graphs.SDGGraph; import tfm.visitors.SDGVisitor; import tfm.visitors.sdg.SDGBuilder; import java.io.IOException; Loading @@ -12,9 +12,9 @@ public class SDGLog extends GraphLog<SDGGraph> { public void visit(Node node) { this.graph = new SDGGraph(); SDGVisitor sdgVisitor = new SDGVisitor(this.graph); SDGBuilder sdgBuilder = new SDGBuilder(this.graph); node.accept(sdgVisitor, null); node.accept(sdgBuilder, null); } @Override Loading src/main/java/tfm/graphbuilding/GraphOptions.java 0 → 100644 +63 −0 Original line number Diff line number Diff line package tfm.graphbuilding; import com.github.javaparser.ast.Node; import tfm.graphs.CFGGraph; import tfm.graphs.Graph; import tfm.graphs.PDGGraph; import tfm.graphs.SDGGraph; import tfm.visitors.cfg.CFGBuilder; import tfm.visitors.pdg.PDGBuilder; import tfm.visitors.sdg.SDGBuilder; public abstract class GraphOptions<G extends Graph> { public abstract G empty(); public G fromASTNode(Node node) { G emptyGraph = empty(); buildGraphWithSpecificVisitor(emptyGraph, node); return emptyGraph; } protected abstract void buildGraphWithSpecificVisitor(G emptyGraph, Node node); } class CFGOptions extends GraphOptions<CFGGraph> { @Override public CFGGraph empty() { return new CFGGraph(); } @Override protected void buildGraphWithSpecificVisitor(CFGGraph emptyGraph, Node node) { node.accept(new CFGBuilder(emptyGraph), null); } } class PDGOptions extends GraphOptions<PDGGraph> { @Override public PDGGraph empty() { return new PDGGraph(); } @Override protected void buildGraphWithSpecificVisitor(PDGGraph emptyGraph, Node node) { node.accept(new PDGBuilder(emptyGraph), emptyGraph.getRootNode()); } } class SDGOptions extends GraphOptions<SDGGraph> { @Override public SDGGraph empty() { return new SDGGraph(); } @Override protected void buildGraphWithSpecificVisitor(SDGGraph emptyGraph, Node node) { node.accept(new SDGBuilder(emptyGraph), null); } } No newline at end of file src/main/java/tfm/graphbuilding/Graphs.java 0 → 100644 +13 −0 Original line number Diff line number Diff line package tfm.graphbuilding; import tfm.graphs.CFGGraph; import tfm.graphs.PDGGraph; import tfm.graphs.SDGGraph; public class Graphs { public static final GraphOptions<CFGGraph> CFG = new CFGOptions(); public static final GraphOptions<PDGGraph> PDG = new PDGOptions(); public static final GraphOptions<SDGGraph> SDG = new SDGOptions(); } No newline at end of file Loading
src/main/java/tfm/exec/CFGLog.java +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import com.github.javaparser.ast.Node; import guru.nidi.graphviz.engine.Format; import guru.nidi.graphviz.engine.Graphviz; import tfm.graphs.CFGGraph; import tfm.visitors.CFGVisitor; import tfm.visitors.cfg.CFGBuilder; import java.io.File; import java.io.IOException; Loading @@ -24,7 +24,7 @@ public class CFGLog extends GraphLog<CFGGraph> { public void visit(Node node) { this.graph = new CFGGraph(); node.accept(new CFGVisitor(graph), null); node.accept(new CFGBuilder(graph), null); } @Override Loading
src/main/java/tfm/exec/PDGLog.java +2 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import guru.nidi.graphviz.engine.Graphviz; import tfm.graphs.PDGGraph; import tfm.nodes.GraphNode; import tfm.utils.Logger; import tfm.visitors.PDGCFGVisitor; import tfm.visitors.pdg.PDGBuilder; import java.io.File; import java.io.IOException; Loading @@ -27,7 +27,7 @@ public class PDGLog extends GraphLog<PDGGraph> { public void visit(com.github.javaparser.ast.Node node) { this.graph = new PDGGraph(); node.accept(new PDGCFGVisitor(graph), this.graph.getRootNode()); node.accept(new PDGBuilder(graph), this.graph.getRootNode()); } @Override Loading
src/main/java/tfm/exec/SDGLog.java +3 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package tfm.exec; import com.github.javaparser.ast.Node; import tfm.graphs.SDGGraph; import tfm.visitors.SDGVisitor; import tfm.visitors.sdg.SDGBuilder; import java.io.IOException; Loading @@ -12,9 +12,9 @@ public class SDGLog extends GraphLog<SDGGraph> { public void visit(Node node) { this.graph = new SDGGraph(); SDGVisitor sdgVisitor = new SDGVisitor(this.graph); SDGBuilder sdgBuilder = new SDGBuilder(this.graph); node.accept(sdgVisitor, null); node.accept(sdgBuilder, null); } @Override Loading
src/main/java/tfm/graphbuilding/GraphOptions.java 0 → 100644 +63 −0 Original line number Diff line number Diff line package tfm.graphbuilding; import com.github.javaparser.ast.Node; import tfm.graphs.CFGGraph; import tfm.graphs.Graph; import tfm.graphs.PDGGraph; import tfm.graphs.SDGGraph; import tfm.visitors.cfg.CFGBuilder; import tfm.visitors.pdg.PDGBuilder; import tfm.visitors.sdg.SDGBuilder; public abstract class GraphOptions<G extends Graph> { public abstract G empty(); public G fromASTNode(Node node) { G emptyGraph = empty(); buildGraphWithSpecificVisitor(emptyGraph, node); return emptyGraph; } protected abstract void buildGraphWithSpecificVisitor(G emptyGraph, Node node); } class CFGOptions extends GraphOptions<CFGGraph> { @Override public CFGGraph empty() { return new CFGGraph(); } @Override protected void buildGraphWithSpecificVisitor(CFGGraph emptyGraph, Node node) { node.accept(new CFGBuilder(emptyGraph), null); } } class PDGOptions extends GraphOptions<PDGGraph> { @Override public PDGGraph empty() { return new PDGGraph(); } @Override protected void buildGraphWithSpecificVisitor(PDGGraph emptyGraph, Node node) { node.accept(new PDGBuilder(emptyGraph), emptyGraph.getRootNode()); } } class SDGOptions extends GraphOptions<SDGGraph> { @Override public SDGGraph empty() { return new SDGGraph(); } @Override protected void buildGraphWithSpecificVisitor(SDGGraph emptyGraph, Node node) { node.accept(new SDGBuilder(emptyGraph), null); } } No newline at end of file
src/main/java/tfm/graphbuilding/Graphs.java 0 → 100644 +13 −0 Original line number Diff line number Diff line package tfm.graphbuilding; import tfm.graphs.CFGGraph; import tfm.graphs.PDGGraph; import tfm.graphs.SDGGraph; public class Graphs { public static final GraphOptions<CFGGraph> CFG = new CFGOptions(); public static final GraphOptions<PDGGraph> PDG = new PDGOptions(); public static final GraphOptions<SDGGraph> SDG = new SDGOptions(); } No newline at end of file