@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
25 lines (24 loc) • 1.61 kB
TypeScript
import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
import { type ControlFlowInformation } from '../../control-flow/control-flow-graph';
import type { MermaidMarkStyle, MermaidGraphPrinterInfo } from './info';
export interface MermaidCfgGraphPrinterInfo extends MermaidGraphPrinterInfo {
/** The style to apply to mark an entry point marker node */
entryPointStyle?: MermaidMarkStyle['vertex'];
/** The stly eto apply to mark an exit point marker node */
exitPointStyle?: MermaidMarkStyle['vertex'];
/** If true, a simplified basic block will have "Basic Block (id)" prepended */
includeBasicBlockLabel?: boolean;
/** If this threshold is reached (lexemes of a simplified basic block), the remaning character will be replaced by ... */
basicBlockCharacterLimit?: number;
}
export declare const MermaidEntryPointDefaultMarkStyle: MermaidMarkStyle['vertex'];
export declare const MermaidExitPointDefaultMarkStyle: MermaidMarkStyle['vertex'];
/**
* Convert the control flow graph to a mermaid string.
* @see {@link MermaidCfgGraphPrinterInfo} for additional options.
*/
export declare function cfgToMermaid(cfg: ControlFlowInformation, normalizedAst: NormalizedAst, { prefix, simplify, markStyle, entryPointStyle, exitPointStyle, includeOnlyIds, mark, includeBasicBlockLabel, basicBlockCharacterLimit }?: MermaidCfgGraphPrinterInfo): string;
/**
* Use mermaid to visualize the normalized AST.
*/
export declare function cfgToMermaidUrl(cfg: ControlFlowInformation, normalizedAst: NormalizedAst, info?: MermaidCfgGraphPrinterInfo): string;