@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
51 lines (50 loc) • 3.07 kB
TypeScript
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
import type { ParsedQueryLine } from '../../query';
import Joi from 'joi';
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
import { type InputClassifierConfig, type InputSources } from './simple-input-classifier';
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
import type { FlowrConfig } from '../../../config';
import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser';
import { executeInputSourcesQuery } from './input-sources-query-executor';
export type InputSourcesQueryConfig = InputClassifierConfig;
/**
* Calculates provenance for all inputs and their transformations
* based on the `provenance` of a given function.
*/
export interface InputSourcesQuery extends BaseQueryFormat {
readonly type: 'input-sources';
/**
* One or more slicing criteria to analyze; each is resolved independently and keyed by its
* criterion string in the result map. Supplying an array allows batching multiple lookups
* into a single round-trip.
* {@link SlicingCriterion.fromId}
*/
readonly criterion: SlicingCriterion | readonly SlicingCriterion[];
readonly config?: InputSourcesQueryConfig;
}
/**
* Which functions belong to which input type is stated with the functions themselves, in the
* {@link DefaultBuiltinConfig|built-in configuration}: a function that states its props and carries none of the
* {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a
* {@link CallProp.Narrows} one bounds its result no matter what flows in.
* Add a function there (or override its props with your own built-in definitions) and it shows up here.
*/
export declare const DefaultInputClassifierConfig: InputClassifierConfig;
export interface InputSourcesQueryResult extends BaseQueryResult {
/** For each query key, a list of classified input sources (each with id and all traces) */
results: Record<string, InputSources>;
}
declare function inputSourcesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'input-sources'>;
export declare const InputSourcesDefinition: {
readonly title: "Input Sources Query";
readonly executor: typeof executeInputSourcesQuery;
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: typeof inputSourcesQueryLineParser;
readonly completer: typeof criteriaQueryCompleter;
readonly syntax: "@input-sources (<criterion>) <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
export {};