UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

48 lines (47 loc) 2.92 kB
import type { BuiltInEvalHandlerArgs } from '../../environments/built-in'; import { type Lift, Top, type Value, type ValueNumber, type ValueVector } from '../values/r-value'; /** * Helper function used by {@link resolveIdToValue}, please use that instead, if * you want to resolve the value of an identifier / node * * This function converts an RNode to its Value, but also recursively resolves * aliases and vectors (in case of node vector). * @returns resolved value or top/bottom */ export declare function resolveNode({ resolve, node, ctx, blocked, environment, graph, idMap }: BuiltInEvalHandlerArgs): Value; /** * Helper function used by {@link resolveIdToValue}, please use that instead, if * you want to resolve the value of an identifier / node * * This function resolves a vector function call `c` to a {@link ValueVector} * by recursively resolving the values of the arguments by calling {@link resolveIdToValue} * @returns ValueVector or Top */ export declare function resolveAsVector({ resolve, environment, node, graph, idMap, ctx, blocked }: BuiltInEvalHandlerArgs): ValueVector | typeof Top; /** * Helper function used by {@link resolveIdToValue}, please use that instead, if * you want to resolve the value of an identifier / node * * This function resolves a binary sequence operator `:` to a {@link ValueVector} of {@link ValueNumber}s * by recursively resolving the values of the arguments by calling {@link resolveIdToValue} * @returns ValueVector of ValueNumbers or Top */ export declare function resolveAsSeq({ node: operator, environment, resolve, ctx, graph, idMap, blocked }: BuiltInEvalHandlerArgs): ValueVector<Lift<ValueNumber[]>> | typeof Top; /** * Helper function used by {@link resolveIdToValue}, please use that instead, if * you want to resolve the value of an identifier / node * * This function resolves a unary plus operator `+` to a {@link ValueNumber} or {@link ValueVector} of ValueNumbers * by recursively resolving the values of the arguments by calling {@link resolveIdToValue} * @returns ValueNumber, ValueVector of ValueNumbers, or Top */ export declare function resolveAsPlus({ node: operator, environment, resolve, ctx, graph, idMap, blocked }: BuiltInEvalHandlerArgs): ValueNumber | ValueVector<Lift<ValueNumber[]>> | typeof Top; /** * Helper function used by {@link resolveIdToValue}, please use that instead, if * you want to resolve the value of an identifier / node * * This function resolves a unary minus operator `-` to a {@link ValueNumber} or {@link ValueVector} of ValueNumbers * by recursively resolving the values of the arguments by calling {@link resolveIdToValue} * @returns ValueNumber, ValueVector of ValueNumbers, or Top */ export declare function resolveAsMinus({ node: operator, environment, resolve, ctx, graph, idMap, blocked }: BuiltInEvalHandlerArgs): ValueNumber | ValueVector<Lift<ValueNumber[]>> | typeof Top;