@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
26 lines (25 loc) • 1.99 kB
TypeScript
import type { IdentifierDefinition, IdentifierReference } from './identifier';
import type { DataflowGraph } from '../graph/graph';
import type { ControlDependency } from '../info';
import type { REnvironmentInformation } from './environment';
/** copy of the definition with the given cds attached, marking it as maybe */
export declare function withAppliedCds(definition: IdentifierDefinition, defaultCd: readonly ControlDependency[] | undefined): IdentifierDefinition;
/**
* Marks the reference as maybe (i.e., as controlled by a set of {@link IdentifierReference#cds|control dependencies}).
* With `includeDefs`, the cds are also attached (copy-on-write) to the definition the reference
* itself made, see {@link applyCdsToDefinitions}.
*/
export declare function makeReferenceMaybe(ref: IdentifierReference, graph: DataflowGraph, environments: REnvironmentInformation, includeDefs: boolean, defaultCd?: ControlDependency[] | undefined): IdentifierReference;
/**
* Marks all references as maybe (i.e., as controlled by a set of {@link IdentifierReference#cds|control dependencies}).
* @see {@link makeReferenceMaybe}
*/
export declare function makeAllMaybe(references: readonly IdentifierReference[] | undefined, graph: DataflowGraph, environments: REnvironmentInformation, includeDefs: boolean, applyCds?: ControlDependency[] | undefined): IdentifierReference[];
/**
* apply the given cds to all elements in the graph and also transform the given references similar to {@link makeAllMaybe}.
*/
export declare function applyCdsToAllInGraphButConstants(graph: DataflowGraph, references: readonly IdentifierReference[], cds: readonly ControlDependency[]): void;
/**
* apply the given cds to all given references, but not to the graph. This is useful if we want to mark the references as maybe without marking all other nodes in the graph as maybe.
*/
export declare function applyCdToReferences(references: readonly IdentifierReference[], cds: readonly ControlDependency[]): void;