UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

53 lines (52 loc) 3.51 kB
import { type DataflowProcessorInformation } from '../../../../../processor'; import { DataflowInformation } from '../../../../../info'; import { type FlowrLaxSourcingOptions, InferWorkingDirectory } from '../../../../../../config'; import { type RParseRequest } from '../../../../../../r-bridge/retriever'; import { type IdGenerator, 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 { 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'; import type { NoInfo } from '../../../../../../r-bridge/lang-4.x/ast/model/model'; import type { ReadOnlyFlowrAnalyzerContext } from '../../../../../../project/context/flowr-analyzer-context'; import type { RProjectFile } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-project'; /** * Infers working directories based on the given option and reference chain */ export declare function inferWdFromScript(option: InferWorkingDirectory, referenceChain: readonly (string | undefined)[]): string[]; /** * Return the basename of a path in a platform-agnostic way * @see {@link platformDirname} - for the dirname counterpart */ export declare function platformBasename(p: string): string; /** * Return the dirname of a path in a platform-agnostic way */ export declare function platformDirname(p: string): string; /** * Tries to find sourced by a source request and returns the first path that exists * @param resolveSource - options for lax file sourcing * @param seed - the path originally requested in the `source` call * @param data - more information on the loading context */ export declare function findSource(resolveSource: FlowrLaxSourcingOptions | undefined, seed: string, data: { referenceChain: readonly (string | undefined)[]; ctx: ReadOnlyFlowrAnalyzerContext; }): string[] | undefined; /** * Processes a named function call (i.e., not an anonymous function) */ export declare function processSourceCall<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: { /** should this produce an explicit source function call in the graph? */ includeFunctionCall?: boolean; /** should this function call be followed, even when the configuration disables it? */ forceFollow?: boolean; }): DataflowInformation; /** * Processes a source request with the given dataflow processor information and existing dataflow information * Otherwise, this can be an {@link RProjectFile} representing a standalone source file */ export declare function sourceRequest<OtherInfo>(rootId: NodeId, request: RParseRequest | RProjectFile<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, information: DataflowInformation, makeMaybe: boolean, getId?: IdGenerator<NoInfo>): DataflowInformation; /** * Processes a standalone source file (i.e., not from a source function call) */ export declare function standaloneSourceFile<OtherInfo>(idx: number, file: RProjectFile<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, information: DataflowInformation): DataflowInformation;