UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

28 lines (27 loc) 2.12 kB
import type { REnvironmentInformation } from './environment'; import { Ternary } from '../../util/logic'; import type { Identifier, IdentifierDefinition } from './identifier'; import { ReferenceType } from './identifier'; import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id'; import type { DataflowGraph } from '../graph/graph'; import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate'; /** * Resolves a given identifier name to a list of its possible definition location using R scoping and resolving rules. * * @param name - The name of the identifier to resolve * @param environment - The current environment used for name resolution * @param target - The target (meta) type of the identifier to resolve * * @returns A list of possible identifier definitions (one if the definition location is exactly and always known), or `undefined` * if the identifier is undefined in the current scope/with the current environment information. */ export declare function resolveByName(name: Identifier, environment: REnvironmentInformation, target?: ReferenceType): IdentifierDefinition[] | undefined; export declare function resolvesToBuiltInConstant(name: Identifier | undefined, environment: REnvironmentInformation, wantedValue: unknown): Ternary; export declare function resolveToConstants(name: Identifier | undefined, environment: REnvironmentInformation): unknown[] | undefined; export declare function getAliases(sourceIds: readonly NodeId[], dataflow: DataflowGraph, environment: REnvironmentInformation): NodeId[] | undefined; export declare function resolveToValues(identifier: Identifier | undefined, environment: REnvironmentInformation, idMap?: AstIdMap): unknown[] | undefined; /** * Convenience function using the variable resolver as specified within the configuration file * In the future we may want to have this set once at the start of the analysis */ export declare function resolveValueOfVariable(identifier: Identifier | undefined, environment: REnvironmentInformation, idMap?: AstIdMap): unknown[] | undefined;