UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

40 lines (39 loc) 2.77 kB
import type { DataflowInformation } from '../../../../info'; import type { DataflowProcessorInformation } from '../../../../processor'; import type { RNode } from '../../../../../r-bridge/lang-4.x/ast/model/model'; import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { RFunctionArgument } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call'; import type { DataflowGraph, FunctionArgument } from '../../../../graph/graph'; import type { NodeId } from '../../../../../r-bridge/lang-4.x/ast/model/processing/node-id'; import type { REnvironmentInformation } from '../../../../environments/environment'; import type { IdentifierReference } from '../../../../environments/identifier'; import type { RSymbol } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol'; export interface ForceArguments { /** which of the arguments should be forced? this may be all, e.g., if the function itself is unknown on encounter */ readonly forceArgs?: 'all' | readonly boolean[]; } export interface ProcessAllArgumentInput<OtherInfo> extends ForceArguments { readonly functionName: DataflowInformation; readonly args: readonly (RNode<OtherInfo & ParentInformation> | RFunctionArgument<OtherInfo & ParentInformation>)[]; readonly data: DataflowProcessorInformation<OtherInfo & ParentInformation>; readonly finalGraph: DataflowGraph; readonly functionRootId: NodeId; readonly patchData?: (data: DataflowProcessorInformation<OtherInfo & ParentInformation>, i: number) => DataflowProcessorInformation<OtherInfo & ParentInformation>; /** which arguments are to be marked as {@link EdgeType#NonStandardEvaluation|non-standard-evaluation}? */ readonly markAsNSE?: readonly number[]; } export interface ProcessAllArgumentResult { readonly finalEnv: REnvironmentInformation; readonly callArgs: FunctionArgument[]; readonly remainingReadInArgs: IdentifierReference[]; readonly processedArguments: (DataflowInformation | undefined)[]; } export declare function processAllArguments<OtherInfo>({ functionName, args, data, finalGraph, functionRootId, forceArgs, patchData }: ProcessAllArgumentInput<OtherInfo>): ProcessAllArgumentResult; export interface PatchFunctionCallInput<OtherInfo> { readonly nextGraph: DataflowGraph; readonly rootId: NodeId; readonly name: RSymbol<OtherInfo & ParentInformation>; readonly data: DataflowProcessorInformation<OtherInfo & ParentInformation>; readonly argumentProcessResult: readonly (Pick<DataflowInformation, 'entryPoint'> | undefined)[]; } export declare function patchFunctionCall<OtherInfo>({ nextGraph, rootId, name, data, argumentProcessResult }: PatchFunctionCallInput<OtherInfo>): void;