@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
37 lines (36 loc) • 2.36 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 { PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
/** e.g. new_generic(name, dispatch_args, fun=NULL) */
interface S7GenericDispatchConfig {
args: {
name: string;
dispatchArg: string | undefined;
fun: string;
};
}
/**
* Process an S7 new generic dispatch call like `new_generic` or `setGeneric`.
*/
export declare function processS7NewGeneric<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: S7GenericDispatchConfig): DataflowInformation;
/**
* Process a call that **returns a function**: S7/S4 constructor factories (`make_constructor`, `new_class`,
* `setClass`) and generic function factories (`Negate`, `Vectorize`, `partial`, …). We model the result as a
* synthetic function definition so the assigned symbol is recognized as a **function** rather than a plain
* constant.
*/
export declare function processMakeConstructor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config?: {
readonly mode?: readonly ('s7' | 's3' | 's4')[];
readonly wrapIndex?: number;
readonly wrapName?: string;
}): DataflowInformation;
/**
* Node-id suffix of the `fun = function(...) S7_dispatch()` argument flowR synthesizes for S7 calls that do not
* carry one (`new_class`, `new_generic`, ...). It stands for no argument in the source, so consumers that reason
* about how the *code* calls a function (e.g. matching a call against a package's signature history) must skip it.
*/
export declare const S7SyntheticFunArgSuffix = "-s7-new-generic-fun-arg";
export {};