@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
28 lines (27 loc) • 2.2 kB
TypeScript
import { type DataflowProcessorInformation } from '../../../../../processor';
import { type DataflowInformation } from '../../../../../info';
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
import { type RFunctionArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
import { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
import { DataflowGraph } from '../../../../../graph/graph';
import { type REnvironmentInformation } from '../../../../../environments/environment';
import type { ReadOnlyFlowrAnalyzerContext } from '../../../../../../project/context/flowr-analyzer-context';
/**
* Process a function definition, i.e., `function(a, b) { ... }`
*/
export declare function processFunctionDefinition<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
/**
* Retrieve the active environment when entering a function definition or call
* @param callerEnvironment - environment at the call site / function definition site
* @param baseEnvironment - base environment within the function definition / call
* @param ctx - analyzer context
* @returns active environment within the function definition / call
*/
export declare function retrieveActiveEnvironment(callerEnvironment: REnvironmentInformation | undefined, baseEnvironment: REnvironmentInformation, ctx: ReadOnlyFlowrAnalyzerContext): REnvironmentInformation;
/**
* Update the closure links of all nested function calls, this is probably to be done once at the end of the script
* @param graph - dataflow graph to collect the function calls from and to update the closure links for
* @param outEnvironment - active environment on resolving closures (i.e., exit of the function definition)
*/
export declare function updateNestedFunctionCalls(graph: DataflowGraph, outEnvironment: REnvironmentInformation): void;