@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
18 lines (17 loc) • 932 B
TypeScript
import { type ParentInformation, type RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
import type { KnownParser } from '../../r-bridge/parser';
import type { RProject } from '../../r-bridge/lang-4.x/ast/model/nodes/r-project';
/**
* Visualizes the normalized AST using mermaid syntax.
* This is mainly intended for documentation purposes.
*/
export declare function printNormalizedAst(ast: RProject<ParentInformation> | RNodeWithParent, prefix?: string): string;
export interface PrintNormalizedAstOptions {
readonly showCode?: boolean;
readonly prefix?: string;
}
/**
* Generates and prints the normalized AST for the given code, along with optional metadata and the original code.
* This is intended for documentation purposes.
*/
export declare function printNormalizedAstForCode(parser: KnownParser, code: string, { showCode, prefix }?: PrintNormalizedAstOptions): Promise<string>;