@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
31 lines (30 loc) • 1.3 kB
TypeScript
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
import type { ControlDependency } from './info';
export declare enum KnownHooks {
/** Triggers on the exit of a function, no matter how this exit is enforced. */
OnFnExit = "fn-exit"
}
/**
* Information about a registered hook within the dataflow information.
*/
export interface HookInformation {
/** The type of the hook */
type: KnownHooks;
/** The id of the function definition which is added by the hook */
id: NodeId;
/** Control dependencies under which the hook was registered */
cds?: ControlDependency[];
/** Whether the hook is added on top of existing ones (true) or replaces them (false) */
add?: boolean;
/** Whether the hook is executed after existing ones (true) or before (false) */
after?: boolean;
}
/**
* Compacts a list of hook registrations by removing redundant and dominated ones.
*/
export declare function compactHookStates(hooks: HookInformation[]): HookInformation[];
/**
* Extracts all hooks of the given type from the list of hooks.
* Please consider {@link compactHookStates} to remove redundant or dominated hooks first.
*/
export declare function getHookInformation(hooks: HookInformation[], type: KnownHooks): HookInformation[];