@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
30 lines (29 loc) • 1.62 kB
TypeScript
import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
import type { KnownParser } from '../../r-bridge/parser';
import type { DataflowInformation } from '../../dataflow/info';
import type { ControlFlowInformation } from '../../control-flow/control-flow-graph';
import { type CfgSimplificationPassName } from '../../control-flow/cfg-simplification';
type GetCfgReturn = {
info: ControlFlowInformation;
ast: NormalizedAst;
dataflow?: DataflowInformation;
};
export declare function getCfg(parser: KnownParser, code: string, simplifications?: readonly CfgSimplificationPassName[], useDfg?: true): Promise<Required<GetCfgReturn>>;
export declare function getCfg(parser: KnownParser, code: string, simplifications?: readonly CfgSimplificationPassName[], useDfg?: boolean): Promise<GetCfgReturn>;
/**
* Serializes the given control flow graph to a mermaid diagram.
*/
export declare function printCfg(cfg: ControlFlowInformation, ast: NormalizedAst, prefix?: string, simplify?: boolean): string;
export interface PrintCfgOptions {
readonly showCode?: boolean;
readonly openCode?: boolean;
readonly prefix?: string;
readonly simplifications?: readonly CfgSimplificationPassName[];
readonly simplify?: boolean;
readonly useDfg?: boolean;
}
/**
* Generates and prints the control flow graph for the given code, along with optional metadata and the original code.
*/
export declare function printCfgCode(parser: KnownParser, code: string, { showCode, openCode, prefix, simplifications, simplify, useDfg }?: PrintCfgOptions): Promise<string>;
export {};