Loading src/main/java/tfm/exec/CFGLog.java +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ public class CFGLog extends GraphLog<CFGGraph, CFGVisitor> { } @Override void generatePNGs() throws IOException { public void generatePNGs() throws IOException { Graphviz.fromString(graph.toGraphvizRepresentation()) .render(Format.PNG) .toFile(new File("./out/cfg.png")); Loading src/main/java/tfm/exec/GraphLog.java +12 −4 Original line number Diff line number Diff line Loading @@ -20,10 +20,18 @@ public abstract class GraphLog<G extends Graph<?>, V extends VoidVisitor<?>> { G graph; V visitor; abstract void visit(Node node); public GraphLog() { } public GraphLog(G graph) { this.graph = graph; } public abstract void visit(Node node); void log() throws IOException { public void log() throws IOException { Logger.log( "****************************\n" + "* GRAPH *\n" + Loading @@ -41,7 +49,7 @@ public abstract class GraphLog<G extends Graph<?>, V extends VoidVisitor<?>> { generatePNGs(); } abstract void generatePNGs() throws IOException; public abstract void generatePNGs() throws IOException; abstract void openVisualRepresentation() throws IOException; public abstract void openVisualRepresentation() throws IOException; } src/main/java/tfm/exec/Main.java +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.body.MethodDeclaration; import tfm.utils.Logger; import tfm.utils.Utils; import java.io.File; import java.io.IOException; Loading @@ -13,7 +14,7 @@ import java.util.Optional; public class Main { public static final String PROGRAM = "src/main/java/tfm/programs/pdg/Example1.java"; public static final String PROGRAM = Utils.PROGRAMS_FOLDER + "pdg/Example2.java"; public static final String METHOD = ""; public static final String GRAPH = GraphLog.PDG; Loading src/main/java/tfm/exec/PDGLog.java +15 −7 Original line number Diff line number Diff line Loading @@ -16,8 +16,16 @@ import java.util.stream.Collectors; public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { public PDGLog() { super(); } public PDGLog(PDGGraph pdgGraph) { super(pdgGraph); } @Override void visit(com.github.javaparser.ast.Node node) { public void visit(com.github.javaparser.ast.Node node) { this.graph = new PDGGraph(); this.visitor = new PDGCFGVisitor(graph); Loading @@ -26,7 +34,7 @@ public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { } @Override void log() throws IOException { public void log() throws IOException { super.log(); Logger.log("Nodes with variable info"); Loading @@ -44,10 +52,10 @@ public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { } @Override void generatePNGs() throws IOException { Graphviz.fromString(visitor.getCfgGraph().toGraphvizRepresentation()) .render(Format.PNG) .toFile(new File("./out/pdg-cfg.png")); public void generatePNGs() throws IOException { // Graphviz.fromString(visitor.getCfgGraph().toGraphvizRepresentation()) // .render(Format.PNG) // .toFile(new File("./out/pdg-cfg.png")); Graphviz.fromString(graph.toGraphvizRepresentation()) .render(Format.PNG) Loading @@ -55,7 +63,7 @@ public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { } @Override void openVisualRepresentation() throws IOException { public void openVisualRepresentation() throws IOException { new ProcessBuilder(Arrays.asList("xdg-open", "./out/pdg-cfg.png")).start(); new ProcessBuilder(Arrays.asList("xdg-open", "./out/pdg.png")).start(); } Loading src/main/java/tfm/exec/SDGLog.java +3 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import java.io.IOException; public class SDGLog extends GraphLog<SDGGraph, SDGVisitor> { @Override void visit(Node node) { public void visit(Node node) { SDGGraph sdgGraph = new SDGGraph(); SDGVisitor sdgVisitor = new SDGVisitor(sdgGraph); Loading @@ -18,12 +18,12 @@ public class SDGLog extends GraphLog<SDGGraph, SDGVisitor> { } @Override void generatePNGs() throws IOException { public void generatePNGs() throws IOException { } @Override void openVisualRepresentation() throws IOException { public void openVisualRepresentation() throws IOException { } } Loading
src/main/java/tfm/exec/CFGLog.java +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ public class CFGLog extends GraphLog<CFGGraph, CFGVisitor> { } @Override void generatePNGs() throws IOException { public void generatePNGs() throws IOException { Graphviz.fromString(graph.toGraphvizRepresentation()) .render(Format.PNG) .toFile(new File("./out/cfg.png")); Loading
src/main/java/tfm/exec/GraphLog.java +12 −4 Original line number Diff line number Diff line Loading @@ -20,10 +20,18 @@ public abstract class GraphLog<G extends Graph<?>, V extends VoidVisitor<?>> { G graph; V visitor; abstract void visit(Node node); public GraphLog() { } public GraphLog(G graph) { this.graph = graph; } public abstract void visit(Node node); void log() throws IOException { public void log() throws IOException { Logger.log( "****************************\n" + "* GRAPH *\n" + Loading @@ -41,7 +49,7 @@ public abstract class GraphLog<G extends Graph<?>, V extends VoidVisitor<?>> { generatePNGs(); } abstract void generatePNGs() throws IOException; public abstract void generatePNGs() throws IOException; abstract void openVisualRepresentation() throws IOException; public abstract void openVisualRepresentation() throws IOException; }
src/main/java/tfm/exec/Main.java +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.body.MethodDeclaration; import tfm.utils.Logger; import tfm.utils.Utils; import java.io.File; import java.io.IOException; Loading @@ -13,7 +14,7 @@ import java.util.Optional; public class Main { public static final String PROGRAM = "src/main/java/tfm/programs/pdg/Example1.java"; public static final String PROGRAM = Utils.PROGRAMS_FOLDER + "pdg/Example2.java"; public static final String METHOD = ""; public static final String GRAPH = GraphLog.PDG; Loading
src/main/java/tfm/exec/PDGLog.java +15 −7 Original line number Diff line number Diff line Loading @@ -16,8 +16,16 @@ import java.util.stream.Collectors; public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { public PDGLog() { super(); } public PDGLog(PDGGraph pdgGraph) { super(pdgGraph); } @Override void visit(com.github.javaparser.ast.Node node) { public void visit(com.github.javaparser.ast.Node node) { this.graph = new PDGGraph(); this.visitor = new PDGCFGVisitor(graph); Loading @@ -26,7 +34,7 @@ public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { } @Override void log() throws IOException { public void log() throws IOException { super.log(); Logger.log("Nodes with variable info"); Loading @@ -44,10 +52,10 @@ public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { } @Override void generatePNGs() throws IOException { Graphviz.fromString(visitor.getCfgGraph().toGraphvizRepresentation()) .render(Format.PNG) .toFile(new File("./out/pdg-cfg.png")); public void generatePNGs() throws IOException { // Graphviz.fromString(visitor.getCfgGraph().toGraphvizRepresentation()) // .render(Format.PNG) // .toFile(new File("./out/pdg-cfg.png")); Graphviz.fromString(graph.toGraphvizRepresentation()) .render(Format.PNG) Loading @@ -55,7 +63,7 @@ public class PDGLog extends GraphLog<PDGGraph, PDGCFGVisitor> { } @Override void openVisualRepresentation() throws IOException { public void openVisualRepresentation() throws IOException { new ProcessBuilder(Arrays.asList("xdg-open", "./out/pdg-cfg.png")).start(); new ProcessBuilder(Arrays.asList("xdg-open", "./out/pdg.png")).start(); } Loading
src/main/java/tfm/exec/SDGLog.java +3 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import java.io.IOException; public class SDGLog extends GraphLog<SDGGraph, SDGVisitor> { @Override void visit(Node node) { public void visit(Node node) { SDGGraph sdgGraph = new SDGGraph(); SDGVisitor sdgVisitor = new SDGVisitor(sdgGraph); Loading @@ -18,12 +18,12 @@ public class SDGLog extends GraphLog<SDGGraph, SDGVisitor> { } @Override void generatePNGs() throws IOException { public void generatePNGs() throws IOException { } @Override void openVisualRepresentation() throws IOException { public void openVisualRepresentation() throws IOException { } }