UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

40 lines (39 loc) 2.17 kB
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 { ReplOutput } from '../../../cli/repl/commands/repl-main'; import type { FlowrConfig } from '../../../config'; import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser'; import { executeProvenanceQuery } from './provenance-query-executor'; /** Calculates the provenance starting from a given criterion */ export interface ProvenanceQuery extends BaseQueryFormat { readonly type: 'provenance'; /** The slicing criterion to use as a start*/ readonly criterion: SlicingCriterion; /** Whether to stop on fdef boundaries */ readonly restrictFdef?: boolean; } export interface ProvenanceQueryResult extends BaseQueryResult { /** * Maps the requested criteria to the returned ids */ results: Record<string, NodeId[]>; } /** * Checks whether the given argument represents a fdef boundary with an `f` suffix. */ export declare function fdefBoundaryParser(argument: string): boolean; declare function provenanceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'provenance'>; export declare const ProvenanceQueryDefinition: { readonly title: "Provenance Query"; readonly executor: typeof executeProvenanceQuery; 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 provenanceQueryLineParser; readonly completer: typeof criteriaQueryCompleter; readonly syntax: "@provenance (<criterion>)[f] <code | file://path>"; readonly schema: Joi.ObjectSchema<any>; readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[]; }; export {};