@specs-feup/clava
Version:
A C/C++ source-to-source compiler written in Typescript
52 lines • 2 kB
TypeScript
import Graph from "@specs-feup/lara/api/lara/graphs/Graph.js";
import cytoscape from "cytoscape";
import { Statement } from "../../Joinpoints.js";
export default class ControlFlowGraph extends Graph {
/**
* Maps stmts to graph nodes
*/
private nodes;
/**
* The start node of the CFG
*/
private start;
/**
* The end node of the CFG
*/
private end;
constructor(graph: cytoscape.Core, nodes: Map<string, cytoscape.NodeSingular>, startNode: cytoscape.NodeSingular, endNode: cytoscape.NodeSingular);
/**
* Builds the control flow graph
*
* @param deterministicIds - If true, uses deterministic ids for the graph ids (e.g. id_0, id_1...). Otherwise, uses $jp.astId whenever possible
* @param options - An object containing configuration options for the cfg
* @returns A new instance of the ControlFlowGraph class
*/
static build($jp: Statement, deterministicIds?: boolean, options?: {
/**
* If true, statements of each instruction list must be split
*/
splitInstList: boolean;
/**
* If true, the nodes that correspond to goto statements will be excluded from the resulting graph
*/
removeGotoNodes: boolean;
/**
* If true, the nodes that correspond to label statements will be excluded from the resulting graph
*/
removeLabelNodes: boolean;
/**
* If true, the temporary scope statements will be kept in the resulting graph
*/
keepTemporaryScopeStmts: boolean;
}): ControlFlowGraph;
/**
* Returns the graph node where the given statement belongs.
*
* @param $stmt - A statement join point, or a string with the astId of the join point
*/
getNode($stmt: Statement | string): cytoscape.NodeSingular | undefined;
get startNode(): cytoscape.NodeSingular;
get endNode(): cytoscape.NodeSingular;
}
//# sourceMappingURL=ControlFlowGraph.d.ts.map