Commit a815ec9f authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Replace Config by graph-specific classes

Renamed graphs to remove redundant `Graph` at end of class names.
parent f7f50af2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -131,9 +131,9 @@ public PDGGraph getSlice(File program, SlicingCriterion slicingCriterion) {

    Node astRoot = JavaParser.parse(programFile);

    PDGGraph pdgGraph = Graphs.PDG.fromASTNode(astRoot);
    PDGGraph pdg = Graphs.PDG.fromASTNode(astRoot);

    return pdgGraph.slice(slicingCriterion);
    return pdg.slice(slicingCriterion);
}

```
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ import tfm.arcs.data.VoidArcData;
import tfm.nodes.GraphNode;

/**
 * An edge of the {@link tfm.graphs.CFGGraph}, representing the direct
 * An edge of the {@link tfm.graphs.CFG}, representing the direct
 * flow of control. It connects two instructions if, when the source
 * is executed, one of the possible next instructions is the destination.
 */
@@ -44,7 +44,7 @@ public class ControlFlowArc extends Arc<VoidArcData> {
    }

    /**
     * Represents a non-executable control flow arc, used within the {@link tfm.exec.Config#ACFG}.
     * Represents a non-executable control flow arc, used within the {@link tfm.graphs.CFG.ACFG ACFG}.
     * Initially it had the following meaning: connecting a statement with
     * the following one as if the source was a {@code nop} command (no operation).
     * <br/>
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ import tfm.arcs.data.ArcData;
import tfm.nodes.GraphNode;

/**
 * An arc used in the {@link tfm.graphs.PDGGraph} and {@link tfm.graphs.SDGGraph}
 * An arc used in the {@link tfm.graphs.PDG} and {@link tfm.graphs.SDG}
 * used to represent control dependence between two nodes. The traditional definition of
 * control dependence is: a node {@code a} is <it>control dependent</it> on node
 * {@code b} if and only if {@code b} alters the number of times {@code a} is executed.
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import java.util.Arrays;
import java.util.List;

/**
 * An arc used in the {@link tfm.graphs.PDGGraph} and {@link tfm.graphs.SDGGraph},
 * An arc used in the {@link tfm.graphs.PDG} and {@link tfm.graphs.SDG},
 * representing the declaration of some data linked to its usage (of that value).
 * There is data dependency between two nodes if and only if (1) the source <it>may</it>
 * declare a variable, (2) the destination <it>may</it> use it, and (3) there is a
+4 −11
Original line number Diff line number Diff line
package tfm.exec;

import com.github.javaparser.ast.Node;
import guru.nidi.graphviz.engine.Format;
import guru.nidi.graphviz.engine.Graphviz;
import tfm.graphs.CFGGraph;
import tfm.utils.FileUtil;
import tfm.graphs.CFG;
import tfm.visitors.cfg.CFGBuilder;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

public class CFGLog extends GraphLog<CFGGraph> {
public class CFGLog extends GraphLog<CFG> {

    public CFGLog() {
        super();
    }

    public CFGLog(CFGGraph graph) {
    public CFGLog(CFG graph) {
        super(graph);
    }

    @Override
    public void visit(Node node) {
        this.graph = new CFGGraph();
        this.graph = new CFG();
        node.accept(new CFGBuilder(graph), null);
    }
}
Loading