@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
49 lines (48 loc) • 2.42 kB
TypeScript
import type { REnvironmentInformation } from '../dataflow/environments/environment';
import type { ContainerIndices, ContainerIndicesCollection } from '../dataflow/graph/vertex';
import type { RAccess } from '../r-bridge/lang-4.x/ast/model/nodes/r-access';
import type { ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
/**
* Resolves {@link accessedArg} in the {@link environment} and filters its indices according to {@link accessArg}.
*
* @param accessedArg - The argument to resolve
* @param accessArg - The argument which is used to filter the indices
* @param environment - The environment in which {@link accessedArg} is resolved
* @returns The filtered {@link ContainerIndicesCollection} of the resolved {@link accessedArg}
*/
export declare function resolveSingleIndex(accessedArg: {
lexeme: string;
}, accessArg: {
lexeme: string;
}, environment: REnvironmentInformation): ContainerIndicesCollection;
/**
* Filters the single indices of the {@link indicesCollection} according to the lexeme of the {@link accessArg}.
*
* @param indicesCollection - The {@link ContainerIndicesCollection} to filter
* @param accessArg - The argument which is used to filter {@link indicesCollection}
* @returns The filtered copy of {@link indicesCollection}
*/
export declare function filterIndices(indicesCollection: ContainerIndicesCollection, accessArg: {
lexeme: string;
}): ContainerIndicesCollection;
/**
* Constructs the definition of a nested access.
*
* Example:
* ```r
* person$credentials$username
* ```
* would result in a list with the index `credentials`, which has the subIndex `username`.
*
* @param accessedArg - The top level argument that is accessed
* @param leafIndices - The index at the end of the nested access i.e. `c` in `a$b$c`.
* @returns The constructed nested access
*/
export declare function constructNestedAccess<OtherInfo>(accessedArg: RAccess<OtherInfo & ParentInformation>, leafIndices: ContainerIndices): ContainerIndices[];
/**
* Adds the passed list of {@link leafSubIndices} to the leaf (sub-)indices of {@link indicesCollection}.
*
* @param indicesCollection - Indices where to add the sub indices.
* @param leafSubIndices - Indices that are added to the leaf indices.
*/
export declare function addSubIndicesToLeafIndices(indicesCollection: ContainerIndices[], leafSubIndices: ContainerIndices[]): ContainerIndices[];