UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

28 lines (27 loc) 1.82 kB
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id'; import type { DataflowGraph } from '../../../dataflow/graph/graph'; import type { DataflowGraphVertexFunctionCall } from '../../../dataflow/graph/vertex'; import { RType } from '../../../r-bridge/lang-4.x/ast/model/type'; import type { RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { LinkTo } from './call-context-query-format'; import type { ControlFlowGraph } from '../../../control-flow/control-flow-graph'; export declare enum CallTargets { /** call targets a function that is not defined locally in the script (e.g., the call targets a library function) */ OnlyGlobal = "global", /** call targets a function that is defined locally or globally, but must include a global function */ MustIncludeGlobal = "must-include-global", /** call targets a function that is defined locally */ OnlyLocal = "local", /** call targets a function that is defined locally or globally, but must include a local function */ MustIncludeLocal = "must-include-local", /** call targets a function that is defined locally or globally */ Any = "any" } export declare function satisfiesCallTargets(id: NodeId, graph: DataflowGraph, callTarget: CallTargets): NodeId[] | 'no'; export declare function getValueOfArgument<Types extends readonly RType[] = readonly RType[]>(graph: DataflowGraph, call: DataflowGraphVertexFunctionCall | undefined, argument: { name?: string; index: number; }, additionalAllowedTypes?: Types): (RNodeWithParent & { type: Types[number]; }) | undefined; export declare function identifyLinkToLastCallRelation(from: NodeId, cfg: ControlFlowGraph, graph: DataflowGraph, { callName, ignoreIf, cascadeIf }: LinkTo<RegExp>): NodeId[];