UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

17 lines 562 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.invertDfg = invertDfg; const graph_1 = require("./graph"); function invertDfg(graph) { const invertedGraph = new graph_1.DataflowGraph(graph.idMap); for (const [, v] of graph.vertices(true)) { invertedGraph.addVertex(v); } for (const [from, targets] of graph.edges()) { for (const [to, { types }] of targets) { invertedGraph.addEdge(to, from, types); } } return invertedGraph; } //# sourceMappingURL=invert-dfg.js.map