UNPKG

@syntest/cfg

Version:
43 lines 1.54 kB
import { Edge } from "./Edge"; import { Node } from "./Node"; import { NodeType } from "./NodeType"; /** * Represents a control flow graph. */ export declare class ControlFlowGraph { private readonly _entry; private readonly _successExit; private readonly _errorExit; private readonly _nodes; private readonly _edges; private readonly _incomingEdges; private readonly _outgoingEdges; constructor(entry: Node, successExit: Node, errorExit: Node, nodes: Map<string, Node>, edges: Edge[]); get entry(): Node; get successExit(): Node; get errorExit(): Node; get nodes(): Map<string, Node>; get edges(): Edge[]; getParents(targetNodeId: string): Node[]; getChildren(targetNodeId: string): Node[]; getIncomingEdges(nodeId: string): ReadonlyArray<Edge>; getOutgoingEdges(nodeId: string): ReadonlyArray<Edge>; /** * Builds the incoming edges map of the graph * @returns */ private getIncomingEdgesMap; /** * Builds the outgoing edges map of the graph * @returns */ private getOutgoingEdgesMap; getNodesByPredicates(...predicates: ((n: Node) => boolean)[]): Node[]; getNodeByPredicate(predicate: (n: Node) => boolean): Node; getNodeById(nodeId: string): Node; getNodesByIds(nodeIds: string[]): Node[]; getNodesByType(type: NodeType): Node[]; getNodesByLineNumbers(lineNumbers: Set<number>): Node[]; getNodeOfTypeByLine(lineNumber: number, type: NodeType): Node; } //# sourceMappingURL=ControlFlowGraph.d.ts.map