@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
31 lines (30 loc) • 1.71 kB
TypeScript
import type { QuadSerializationConfiguration } from '../util/quads';
import type { NormalizedAst, ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
import type { DataflowGraph } from '../dataflow/graph/graph';
import type { ControlFlowInformation } from './control-flow-graph';
import type { CfgSimplificationPassName } from './cfg-simplification';
/**
* Given a normalized AST this approximates the control flow graph of the program.
* This few is different from the computation of the dataflow graph and may differ,
* especially because it focuses on intra-procedural analysis.
*
* @param ast - the normalized AST
* @param graph - additional dataflow facts to consider by the control flow extraction
* @param simplifications - a list of simplification passes to apply to the control flow graph
*
* @see {@link extractSimpleCfg} - for a simplified version of this function
*/
export declare function extractCfg<Info = ParentInformation>(ast: NormalizedAst<Info & ParentInformation>, graph?: DataflowGraph, simplifications?: readonly CfgSimplificationPassName[]): ControlFlowInformation;
/**
* Simplified version of {@link extractCfg} that is much quicker, but much simpler!
*/
export declare function extractSimpleCfg<Info = ParentInformation>(ast: NormalizedAst<Info>): ControlFlowInformation<import("./control-flow-graph").CfgSimpleVertex>;
export declare const ResolvedCallSuffix = "-resolved-call-exit";
/**
* Convert a cfg to RDF quads.
*
* @see {@link df2quads}
* @see {@link serialize2quads}
* @see {@link graph2quads}
*/
export declare function cfg2quads(cfg: ControlFlowInformation, config: QuadSerializationConfiguration): string;