UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

43 lines (42 loc) 2.92 kB
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format'; import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline'; import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE, DEFAULT_SLICING_PIPELINE } from '../../../core/steps/pipeline/default-pipelines'; import type { SlicingCriteria } from '../../../slicing/criterion/parse'; import type { ParsedQueryLine } from '../../query'; import Joi from 'joi'; import { executeStaticSliceQuery } from './static-slice-query-executor'; 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 { SliceDirection } from '../../../util/slice-direction'; /** Calculates and returns the static backward or forward slice from the given criteria */ export interface StaticSliceQuery extends BaseQueryFormat { readonly type: 'static-slice'; /** The slicing criteria to use */ readonly criteria: SlicingCriteria; /** do not reconstruct the slice into readable code */ readonly noReconstruction?: boolean; /** Should the magic comments (force-including lines within the slice) be ignored? */ readonly noMagicComments?: boolean; /** The direction to slice in. Defaults to backward slicing if unset. */ readonly direction?: SliceDirection; } export interface StaticSliceQueryResult extends BaseQueryResult { /** * only contains the results of the slice steps to not repeat ourselves, this does not contain the reconstruction * if you set the {@link SliceQuery#noReconstruction|noReconstruction} flag. * * The keys are serialized versions of the used queries (i.e., the result of `JSON.stringify`). * This implies that multiple slice queries with the same query configuration will _not_ be re-executed. */ results: Record<string, Omit<PipelineOutput<typeof DEFAULT_SLICING_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>> | Omit<PipelineOutput<typeof DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>>>; } declare function sliceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'static-slice'>; export declare const StaticSliceQueryDefinition: { readonly executor: typeof executeStaticSliceQuery; readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true; readonly fromLine: typeof sliceQueryLineParser; readonly schema: Joi.ObjectSchema<any>; readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[]; }; export {};