@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
83 lines • 6.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TREE_SITTER_PARSE_PIPELINE = exports.DEFAULT_PARSE_PIPELINE = exports.TREE_SITTER_NORMALIZE_PIPELINE = exports.DEFAULT_NORMALIZE_PIPELINE = exports.TREE_SITTER_DATAFLOW_PIPELINE = exports.DEFAULT_DATAFLOW_PIPELINE = exports.TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE = exports.TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE = exports.TREE_SITTER_SLICING_PIPELINE = exports.DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE = exports.DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE = exports.DEFAULT_SLICING_PIPELINE = void 0;
exports.createParsePipeline = createParsePipeline;
exports.createSlicePipeline = createSlicePipeline;
exports.createNormalizePipeline = createNormalizePipeline;
exports.createDataflowPipeline = createDataflowPipeline;
const pipeline_1 = require("./pipeline");
const _00_parse_1 = require("../all/core/00-parse");
const _10_normalize_1 = require("../all/core/10-normalize");
const _20_dataflow_1 = require("../all/core/20-dataflow");
const _00_slice_1 = require("../all/static-slicing/00-slice");
const _10_reconstruct_1 = require("../all/static-slicing/10-reconstruct");
const _01_parse_tree_sitter_1 = require("../all/core/01-parse-tree-sitter");
const _11_normalize_tree_sitter_1 = require("../all/core/11-normalize-tree-sitter");
const pipeline_executor_1 = require("../../pipeline-executor");
exports.DEFAULT_SLICING_PIPELINE = (0, pipeline_1.createPipeline)(_00_parse_1.PARSE_WITH_R_SHELL_STEP, _10_normalize_1.NORMALIZE, _20_dataflow_1.STATIC_DATAFLOW, _00_slice_1.STATIC_SLICE, _10_reconstruct_1.NAIVE_RECONSTRUCT);
exports.DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE = exports.DEFAULT_SLICING_PIPELINE;
exports.DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE = (0, pipeline_1.createPipeline)(_00_parse_1.PARSE_WITH_R_SHELL_STEP, _10_normalize_1.NORMALIZE, _20_dataflow_1.STATIC_DATAFLOW, _00_slice_1.STATIC_SLICE);
exports.TREE_SITTER_SLICING_PIPELINE = (0, pipeline_1.createPipeline)(_01_parse_tree_sitter_1.PARSE_WITH_TREE_SITTER_STEP, _11_normalize_tree_sitter_1.NORMALIZE_TREE_SITTER, _20_dataflow_1.STATIC_DATAFLOW, _00_slice_1.STATIC_SLICE, _10_reconstruct_1.NAIVE_RECONSTRUCT);
exports.TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE = exports.TREE_SITTER_SLICING_PIPELINE;
exports.TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE = (0, pipeline_1.createPipeline)(_01_parse_tree_sitter_1.PARSE_WITH_TREE_SITTER_STEP, _11_normalize_tree_sitter_1.NORMALIZE_TREE_SITTER, _20_dataflow_1.STATIC_DATAFLOW, _00_slice_1.STATIC_SLICE);
/**
* The default pipeline for working with flowR, including the dataflow step.
* See the {@link DEFAULT_NORMALIZE_PIPELINE} for the pipeline without the dataflow step
* and the {@link DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE} for the pipeline with slicing and reconstructing steps
*/
exports.DEFAULT_DATAFLOW_PIPELINE = (0, pipeline_1.createPipeline)(_00_parse_1.PARSE_WITH_R_SHELL_STEP, _10_normalize_1.NORMALIZE, _20_dataflow_1.STATIC_DATAFLOW);
exports.TREE_SITTER_DATAFLOW_PIPELINE = (0, pipeline_1.createPipeline)(_01_parse_tree_sitter_1.PARSE_WITH_TREE_SITTER_STEP, _11_normalize_tree_sitter_1.NORMALIZE_TREE_SITTER, _20_dataflow_1.STATIC_DATAFLOW);
/** The pipeline to use when you want to parse and normalize your R file, see {@link DEFAULT_DATAFLOW_PIPELINE} for the additional `dataflow` step */
exports.DEFAULT_NORMALIZE_PIPELINE = (0, pipeline_1.createPipeline)(_00_parse_1.PARSE_WITH_R_SHELL_STEP, _10_normalize_1.NORMALIZE);
exports.TREE_SITTER_NORMALIZE_PIPELINE = (0, pipeline_1.createPipeline)(_01_parse_tree_sitter_1.PARSE_WITH_TREE_SITTER_STEP, _11_normalize_tree_sitter_1.NORMALIZE_TREE_SITTER);
exports.DEFAULT_PARSE_PIPELINE = (0, pipeline_1.createPipeline)(_00_parse_1.PARSE_WITH_R_SHELL_STEP);
exports.TREE_SITTER_PARSE_PIPELINE = (0, pipeline_1.createPipeline)(_01_parse_tree_sitter_1.PARSE_WITH_TREE_SITTER_STEP);
/**
* **Please use {@link FlowrAnalyzer} instead of this directly unless you really know what you are doing.**
* Returns either a {@link DEFAULT_PARSE_PIPELINE} or a {@link TREE_SITTER_PARSE_PIPELINE} depending on the parser used.
* @see {@link createNormalizePipeline}, {@link createDataflowPipeline}, {@link createSlicePipeline}
*/
function createParsePipeline(parser, inputs) {
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_PARSE_PIPELINE : exports.DEFAULT_PARSE_PIPELINE;
return new pipeline_executor_1.PipelineExecutor(base, {
parser: parser,
...inputs
});
}
/**
* **Please use {@link FlowrAnalyzer} instead of this directly unless you really know what you are doing.**
* Returns either a {@link DEFAULT_SLICING_PIPELINE} or a {@link TREE_SITTER_SLICING_PIPELINE} depending on the parser used.
* @see {@link createParsePipeline}, {@link createNormalizePipeline}, {@link createDataflowPipeline}
*/
function createSlicePipeline(parser, inputs) {
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_SLICING_PIPELINE : exports.DEFAULT_SLICING_PIPELINE;
return new pipeline_executor_1.PipelineExecutor(base, {
parser: parser,
...inputs
});
}
/**
* **Please use {@link FlowrAnalyzer} instead of this directly unless you really know what you are doing.**
* Returns either a {@link DEFAULT_NORMALIZE_PIPELINE} or a {@link TREE_SITTER_NORMALIZE_PIPELINE} depending on the parser used.
* @see {@link createParsePipeline}, {@link createDataflowPipeline}, {@link createSlicePipeline}
*/
function createNormalizePipeline(parser, inputs) {
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_NORMALIZE_PIPELINE : exports.DEFAULT_NORMALIZE_PIPELINE;
return new pipeline_executor_1.PipelineExecutor(base, {
parser: parser,
...inputs
});
}
/**
* **Please use {@link FlowrAnalyzer} instead of this directly unless you really know what you are doing.**
* Returns either a {@link DEFAULT_DATAFLOW_PIPELINE} or a {@link TREE_SITTER_DATAFLOW_PIPELINE} depending on the parser used.
* @see {@link createParsePipeline}, {@link createNormalizePipeline}, {@link createSlicePipeline}
*/
function createDataflowPipeline(parser, inputs) {
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_DATAFLOW_PIPELINE : exports.DEFAULT_DATAFLOW_PIPELINE;
return new pipeline_executor_1.PipelineExecutor(base, {
parser: parser,
...inputs
});
}
//# sourceMappingURL=default-pipelines.js.map