Newer
Older
import tfm.utils.Logger;
import java.io.IOException;
import java.util.Comparator;
import java.util.stream.Collectors;
public class PDGLog extends GraphLog<PDG> {
private CFGLog cfgLog;
public PDGLog(PDG pdg) {
super(pdg);
if (graph != null && graph.getCfg() != null)
cfgLog = new CFGLog(graph.getCfg());
public void log() throws IOException {
super.log();
Logger.log("Nodes with variable info");
Logger.log(graph.vertexSet().stream()
.sorted(Comparator.comparingInt(GraphNode::getId))
.map(node ->
String.format("GraphNode { id: %s, declared: %s, defined: %s, used: %s }",
node.getId(),
node.getDeclaredVariables(),
node.getDefinedVariables(),
node.getUsedVariables())
).collect(Collectors.joining(System.lineSeparator()))
public void generateImages(String imageName, Format format) throws IOException {
public void openVisualRepresentation() throws IOException {
super.openVisualRepresentation();
if (cfgLog != null)
cfgLog.openVisualRepresentation();