@eagleoutice/flowr 2.9.12 → 2.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -23
- package/abstract-interpretation/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/absint-visitor.js +20 -20
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
- package/benchmark/slicer.d.ts +5 -3
- package/benchmark/slicer.js +26 -10
- package/benchmark/stats/print.js +12 -0
- package/benchmark/stats/stats.d.ts +3 -2
- package/benchmark/stats/stats.js +1 -1
- package/benchmark/summarizer/data.d.ts +1 -0
- package/benchmark/summarizer/second-phase/process.js +5 -0
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +1 -0
- package/cli/benchmark-helper-app.d.ts +2 -1
- package/cli/benchmark-helper-app.js +6 -3
- package/cli/common/options.d.ts +8 -0
- package/cli/common/options.js +3 -1
- package/cli/common/scripts-info.d.ts +8 -0
- package/cli/export-quads-app.js +1 -1
- package/cli/flowr.js +3 -3
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/core.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.d.ts +1 -1
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.d.ts +2 -2
- package/cli/repl/server/connection.js +2 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.js +2 -2
- package/cli/repl/server/server.d.ts +2 -2
- package/cli/script-core/statistics-core.d.ts +2 -2
- package/cli/script-core/statistics-helper-core.d.ts +2 -2
- package/cli/script-core/statistics-helper-core.js +1 -1
- package/cli/slicer-app.js +2 -2
- package/cli/statistics-app.js +1 -1
- package/cli/statistics-helper-app.js +1 -1
- package/cli/wiki.js +2 -2
- package/config.d.ts +65 -24
- package/config.js +197 -161
- package/control-flow/extract-cfg.js +7 -10
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +43 -43
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +3 -3
- package/core/print/dataflow-printer.d.ts +0 -14
- package/core/print/dataflow-printer.js +0 -21
- package/core/steps/all/core/20-dataflow.d.ts +3 -3
- package/core/steps/all/core/20-dataflow.js +3 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
- package/core/steps/all/static-slicing/00-slice.js +6 -8
- package/core/steps/pipeline/default-pipelines.d.ts +89 -89
- package/core/steps/pipeline-step.d.ts +2 -2
- package/dataflow/environments/built-in-proc-name.d.ts +83 -0
- package/dataflow/environments/built-in-proc-name.js +88 -0
- package/dataflow/environments/built-in.d.ts +1 -83
- package/dataflow/environments/built-in.js +37 -120
- package/dataflow/environments/default-builtin-config.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.js +75 -75
- package/dataflow/environments/identifier.d.ts +1 -0
- package/dataflow/environments/identifier.js +1 -0
- package/dataflow/eval/resolve/alias-tracking.js +12 -15
- package/dataflow/eval/resolve/resolve.js +2 -2
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -2
- package/dataflow/graph/call-graph.d.ts +49 -19
- package/dataflow/graph/call-graph.js +117 -114
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +132 -0
- package/dataflow/graph/df-helper.js +131 -0
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
- package/dataflow/graph/diff-dataflow-graph.js +3 -28
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +55 -0
- package/dataflow/graph/graph-helper.js +105 -0
- package/dataflow/graph/graph.d.ts +6 -1
- package/dataflow/graph/graph.js +14 -9
- package/dataflow/graph/vertex.d.ts +1 -1
- package/dataflow/info.d.ts +14 -4
- package/dataflow/info.js +28 -16
- package/dataflow/internal/linker.d.ts +14 -10
- package/dataflow/internal/linker.js +29 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +23 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
- package/documentation/doc-readme.js +2 -2
- package/documentation/doc-util/doc-dfg.d.ts +3 -0
- package/documentation/doc-util/doc-dfg.js +5 -7
- package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
- package/documentation/doc-util/doc-normalized-ast.js +0 -23
- package/documentation/doc-util/doc-structure.js +3 -3
- package/documentation/doc-util/doc-types.js +3 -3
- package/documentation/wiki-analyzer.js +7 -5
- package/documentation/wiki-core.js +6 -7
- package/documentation/wiki-dataflow-graph.js +15 -13
- package/documentation/wiki-interface.js +8 -6
- package/documentation/wiki-linter.js +6 -5
- package/documentation/wiki-mk/doc-context.js +3 -4
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/engines.d.ts +2 -2
- package/engines.js +4 -4
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- package/linter/rules/dataframe-access-validation.js +5 -5
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +7 -3
- package/linter/rules/seeded-randomness.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +35 -0
- package/linter/rules/stop-with-call-arg.js +72 -0
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +3 -1
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/context/flowr-analyzer-context.d.ts +6 -6
- package/project/context/flowr-analyzer-context.js +2 -2
- package/project/context/flowr-analyzer-files-context.d.ts +2 -2
- package/project/context/flowr-analyzer-files-context.js +28 -8
- package/project/flowr-analyzer-builder.d.ts +13 -6
- package/project/flowr-analyzer-builder.js +12 -3
- package/project/flowr-analyzer.d.ts +4 -4
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/config-query/config-query-format.d.ts +5 -5
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +2 -2
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/files-query/files-query-format.d.ts +3 -3
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +3 -3
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -2
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +9 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +37 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -4
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -0
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -4
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +27 -19
- package/queries/query.js +2 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +13 -2
- package/r-bridge/lang-4.x/ast/model/model.js +20 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +8 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +13 -0
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +6 -2
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-printer.js +3 -3
- package/search/search-executor/search-enrichers.js +2 -2
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +40 -16
- package/slicing/criterion/parse.js +67 -63
- package/slicing/static/slicer-types.d.ts +2 -3
- package/slicing/static/static-slicer.d.ts +3 -4
- package/slicing/static/static-slicer.js +9 -12
- package/statistics/statistics.d.ts +2 -2
- package/util/diff.d.ts +2 -2
- package/util/mermaid/ast.js +4 -4
- package/util/mermaid/cfg.js +5 -5
- package/util/mermaid/dfg.d.ts +33 -18
- package/util/mermaid/dfg.js +46 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/objects.d.ts +12 -0
- package/util/objects.js +28 -0
- package/util/range.d.ts +8 -0
- package/util/range.js +13 -1
- package/util/slice-direction.d.ts +7 -0
- package/util/slice-direction.js +12 -0
- package/util/summarizer.js +1 -1
- package/util/version.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +0 -6
- package/dataflow/graph/invert-dfg.js +0 -20
- package/dataflow/graph/resolve-graph.d.ts +0 -8
- package/dataflow/graph/resolve-graph.js +0 -59
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SemanticCfgGuidedVisitor = void 0;
|
|
4
4
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
5
5
|
const dfg_cfg_guided_visitor_1 = require("./dfg-cfg-guided-visitor");
|
|
6
|
-
const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
|
|
7
6
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
8
7
|
const edge_1 = require("../dataflow/graph/edge");
|
|
9
8
|
const assert_1 = require("../util/assert");
|
|
10
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
11
9
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
12
10
|
const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
|
|
11
|
+
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
12
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
13
13
|
/**
|
|
14
14
|
* This visitor extends on the {@link DataflowAwareCfgGuidedVisitor} by dispatching visitors for separate function calls as well,
|
|
15
15
|
* providing more information!
|
|
@@ -117,7 +117,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
117
117
|
*/
|
|
118
118
|
visitFunctionCall(vertex) {
|
|
119
119
|
super.visitFunctionCall(vertex);
|
|
120
|
-
if (vertex.origin ===
|
|
120
|
+
if (vertex.origin === built_in_proc_name_1.BuiltInProcName.Unnamed) {
|
|
121
121
|
this.onUnnamedCall({ call: vertex });
|
|
122
122
|
}
|
|
123
123
|
else {
|
|
@@ -160,17 +160,17 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
160
160
|
*/
|
|
161
161
|
onDispatchFunctionCallOrigin(call, origin) {
|
|
162
162
|
switch (origin) {
|
|
163
|
-
case
|
|
163
|
+
case built_in_proc_name_1.BuiltInProcName.Eval:
|
|
164
164
|
return this.onEvalFunctionCall({ call });
|
|
165
|
-
case
|
|
165
|
+
case built_in_proc_name_1.BuiltInProcName.Apply:
|
|
166
166
|
return this.onApplyFunctionCall({ call });
|
|
167
|
-
case
|
|
167
|
+
case built_in_proc_name_1.BuiltInProcName.ExpressionList:
|
|
168
168
|
return this.onExpressionList({ call });
|
|
169
|
-
case
|
|
169
|
+
case built_in_proc_name_1.BuiltInProcName.Source:
|
|
170
170
|
return this.onSourceCall({ call });
|
|
171
|
-
case
|
|
171
|
+
case built_in_proc_name_1.BuiltInProcName.Access:
|
|
172
172
|
return this.onAccessCall({ call });
|
|
173
|
-
case
|
|
173
|
+
case built_in_proc_name_1.BuiltInProcName.IfThenElse: {
|
|
174
174
|
// recover dead arguments from ast
|
|
175
175
|
const ast = this.getNormalizedAst(call.id);
|
|
176
176
|
if (!ast || ast.type !== type_1.RType.IfThenElse) {
|
|
@@ -190,24 +190,24 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
case
|
|
193
|
+
case built_in_proc_name_1.BuiltInProcName.Get:
|
|
194
194
|
return this.onGetCall({ call });
|
|
195
|
-
case
|
|
195
|
+
case built_in_proc_name_1.BuiltInProcName.Rm:
|
|
196
196
|
return this.onRmCall({ call });
|
|
197
|
-
case
|
|
197
|
+
case built_in_proc_name_1.BuiltInProcName.List:
|
|
198
198
|
return this.onListCall({ call });
|
|
199
|
-
case
|
|
199
|
+
case built_in_proc_name_1.BuiltInProcName.Vector:
|
|
200
200
|
return this.onVectorCall({ call });
|
|
201
|
-
case
|
|
202
|
-
case
|
|
203
|
-
case
|
|
201
|
+
case built_in_proc_name_1.BuiltInProcName.Assignment:
|
|
202
|
+
case built_in_proc_name_1.BuiltInProcName.AssignmentLike:
|
|
203
|
+
case built_in_proc_name_1.BuiltInProcName.TableAssignment: {
|
|
204
204
|
const outgoing = this.config.dfg.outgoingEdges(call.id);
|
|
205
205
|
if (outgoing) {
|
|
206
206
|
const target = outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).toArray();
|
|
207
207
|
if (target.length === 1) {
|
|
208
208
|
const targetOut = this.config.dfg.outgoingEdges(target[0][0]);
|
|
209
209
|
if (targetOut) {
|
|
210
|
-
const source =
|
|
210
|
+
const source = targetOut.entries().filter(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy) && t !== call.id).toArray();
|
|
211
211
|
if (source.length === 1) {
|
|
212
212
|
return this.onAssignmentCall({ call, target: target[0][0], source: source[0][0] });
|
|
213
213
|
}
|
|
@@ -216,25 +216,25 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
216
216
|
}
|
|
217
217
|
return this.onAssignmentCall({ call, target: undefined, source: undefined });
|
|
218
218
|
}
|
|
219
|
-
case
|
|
219
|
+
case built_in_proc_name_1.BuiltInProcName.SpecialBinOp:
|
|
220
220
|
if (call.args.length !== 2) {
|
|
221
221
|
return this.onSpecialBinaryOpCall({ call });
|
|
222
222
|
}
|
|
223
223
|
return this.onSpecialBinaryOpCall({ call, lhs: call.args[0], rhs: call.args[1] });
|
|
224
|
-
case
|
|
224
|
+
case built_in_proc_name_1.BuiltInProcName.Pipe:
|
|
225
225
|
if (call.args.length !== 2) {
|
|
226
226
|
return this.onPipeCall({ call });
|
|
227
227
|
}
|
|
228
228
|
return this.onPipeCall({ call, lhs: call.args[0], rhs: call.args[1] });
|
|
229
|
-
case
|
|
229
|
+
case built_in_proc_name_1.BuiltInProcName.Quote:
|
|
230
230
|
return this.onQuoteCall({ call });
|
|
231
|
-
case
|
|
231
|
+
case built_in_proc_name_1.BuiltInProcName.ForLoop:
|
|
232
232
|
return this.onForLoopCall({ call, variable: call.args[0], vector: call.args[1], body: call.args[2] });
|
|
233
|
-
case
|
|
233
|
+
case built_in_proc_name_1.BuiltInProcName.RepeatLoop:
|
|
234
234
|
return this.onRepeatLoopCall({ call, body: call.args[0] });
|
|
235
|
-
case
|
|
235
|
+
case built_in_proc_name_1.BuiltInProcName.WhileLoop:
|
|
236
236
|
return this.onWhileLoopCall({ call, condition: call.args[0], body: call.args[1] });
|
|
237
|
-
case
|
|
237
|
+
case built_in_proc_name_1.BuiltInProcName.Replacement: {
|
|
238
238
|
const outgoing = this.config.dfg.outgoingEdges(call.id);
|
|
239
239
|
if (outgoing) {
|
|
240
240
|
const target = outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).toArray();
|
|
@@ -250,38 +250,38 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
250
250
|
}
|
|
251
251
|
return this.onReplacementCall({ call, target: undefined, source: undefined });
|
|
252
252
|
}
|
|
253
|
-
case
|
|
253
|
+
case built_in_proc_name_1.BuiltInProcName.Library:
|
|
254
254
|
return this.onLibraryCall({ call });
|
|
255
|
-
case
|
|
255
|
+
case built_in_proc_name_1.BuiltInProcName.Try:
|
|
256
256
|
return this.onTryCall({ call });
|
|
257
|
-
case
|
|
257
|
+
case built_in_proc_name_1.BuiltInProcName.Stop:
|
|
258
258
|
return this.onStopCall({ call });
|
|
259
|
-
case
|
|
259
|
+
case built_in_proc_name_1.BuiltInProcName.StopIfNot:
|
|
260
260
|
return this.onStopIfNotCall({ call });
|
|
261
|
-
case
|
|
261
|
+
case built_in_proc_name_1.BuiltInProcName.RegisterHook:
|
|
262
262
|
return this.onRegisterHookCall({ call });
|
|
263
|
-
case
|
|
263
|
+
case built_in_proc_name_1.BuiltInProcName.Local:
|
|
264
264
|
return this.onLocalCall({ call });
|
|
265
|
-
case
|
|
265
|
+
case built_in_proc_name_1.BuiltInProcName.S3Dispatch:
|
|
266
266
|
return this.onS3DispatchCall({ call });
|
|
267
|
-
case
|
|
267
|
+
case built_in_proc_name_1.BuiltInProcName.S3DispatchNext:
|
|
268
268
|
return this.onS3DispatchNextCall({ call });
|
|
269
|
-
case
|
|
269
|
+
case built_in_proc_name_1.BuiltInProcName.S7NewGeneric:
|
|
270
270
|
return this.onS7NewGenericCall({ call });
|
|
271
|
-
case
|
|
271
|
+
case built_in_proc_name_1.BuiltInProcName.S7Dispatch:
|
|
272
272
|
return this.onS7DispatchCall({ call });
|
|
273
|
-
case
|
|
273
|
+
case built_in_proc_name_1.BuiltInProcName.Break:
|
|
274
274
|
return this.onBreakCall({ call });
|
|
275
|
-
case
|
|
275
|
+
case built_in_proc_name_1.BuiltInProcName.Return:
|
|
276
276
|
return this.onReturnCall({ call });
|
|
277
|
-
case
|
|
277
|
+
case built_in_proc_name_1.BuiltInProcName.Unnamed:
|
|
278
278
|
return this.onUnnamedCall({ call });
|
|
279
|
-
case
|
|
279
|
+
case built_in_proc_name_1.BuiltInProcName.Recall:
|
|
280
280
|
return this.onRecallCall({ call });
|
|
281
|
-
case
|
|
282
|
-
case
|
|
283
|
-
case
|
|
284
|
-
case
|
|
281
|
+
case built_in_proc_name_1.BuiltInProcName.Default:
|
|
282
|
+
case built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs:
|
|
283
|
+
case built_in_proc_name_1.BuiltInProcName.Function:
|
|
284
|
+
case built_in_proc_name_1.BuiltInProcName.FunctionDefinition:
|
|
285
285
|
return this.onDefaultFunctionCall({ call });
|
|
286
286
|
default:
|
|
287
287
|
(0, assert_1.assertUnreachable)(origin);
|
|
@@ -296,7 +296,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
296
296
|
* A helper function to request the {@link getOriginInDfg|origins} of the given node.
|
|
297
297
|
*/
|
|
298
298
|
getOrigins(id) {
|
|
299
|
-
return
|
|
299
|
+
return df_helper_1.Dataflow.origin(this.config.dfg, id);
|
|
300
300
|
}
|
|
301
301
|
/**
|
|
302
302
|
* Called for every occurrence of a `NULL` in the program.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in';
|
|
2
1
|
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
3
2
|
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
3
|
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
4
|
import type { ControlFlowInformation } from './control-flow-graph';
|
|
6
5
|
import type { ReadOnlyFlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
6
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
7
7
|
export declare const loopyFunctions: Set<BuiltInProcName>;
|
|
8
8
|
/**
|
|
9
9
|
* Checks whether a loop only loops once
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loopyFunctions = void 0;
|
|
4
4
|
exports.onlyLoopsOnce = onlyLoopsOnce;
|
|
5
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
6
5
|
const alias_tracking_1 = require("../dataflow/eval/resolve/alias-tracking");
|
|
7
6
|
const general_1 = require("../dataflow/eval/values/general");
|
|
8
7
|
const r_value_1 = require("../dataflow/eval/values/r-value");
|
|
@@ -12,7 +11,8 @@ const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-functi
|
|
|
12
11
|
const assert_1 = require("../util/assert");
|
|
13
12
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
14
13
|
const semantic_cfg_guided_visitor_1 = require("./semantic-cfg-guided-visitor");
|
|
15
|
-
|
|
14
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
15
|
+
exports.loopyFunctions = new Set([built_in_proc_name_1.BuiltInProcName.ForLoop, built_in_proc_name_1.BuiltInProcName.WhileLoop, built_in_proc_name_1.BuiltInProcName.RepeatLoop]);
|
|
16
16
|
/**
|
|
17
17
|
* Checks whether a loop only loops once
|
|
18
18
|
* @param loop - nodeid of the loop to analyse
|
|
@@ -30,7 +30,7 @@ function onlyLoopsOnce(loop, dataflow, controlflow, ast, ctx) {
|
|
|
30
30
|
(0, assert_1.guard)(vertex.tag === vertex_1.VertexType.FunctionCall, 'invalid vertex type for onlyLoopsOnce');
|
|
31
31
|
(0, assert_1.guard)(vertex.origin !== 'unnamed' && exports.loopyFunctions.has(vertex.origin[0]), 'onlyLoopsOnce can only be called with loops');
|
|
32
32
|
// 1. In case of for loop, check if vector has only one element
|
|
33
|
-
if (vertex.origin[0] ===
|
|
33
|
+
if (vertex.origin[0] === built_in_proc_name_1.BuiltInProcName.ForLoop) {
|
|
34
34
|
if (vertex.args.length < 2) {
|
|
35
35
|
return undefined;
|
|
36
36
|
}
|
|
@@ -2,20 +2,6 @@ import type { DataflowInformation } from '../../dataflow/info';
|
|
|
2
2
|
import type { QuadSerializationConfiguration } from '../../util/quads';
|
|
3
3
|
/** Should work with larger things as well */
|
|
4
4
|
export declare function dataflowGraphToJson(df: DataflowInformation): string;
|
|
5
|
-
/**
|
|
6
|
-
* Convert the dataflow graph to a mermaid string.
|
|
7
|
-
* @see {@link graphToMermaid}
|
|
8
|
-
* @see {@link dataflowGraphToMermaidUrl}
|
|
9
|
-
* @see {@link dataflowGraphToJson}
|
|
10
|
-
*/
|
|
11
|
-
export declare function dataflowGraphToMermaid(df: DataflowInformation): string;
|
|
12
|
-
/**
|
|
13
|
-
* Convert the dataflow graph to a mermaid URL.
|
|
14
|
-
* @see {@link graphToMermaidUrl}
|
|
15
|
-
* @see {@link dataflowGraphToMermaid}
|
|
16
|
-
* @see {@link dataflowGraphToJson}
|
|
17
|
-
*/
|
|
18
|
-
export declare function dataflowGraphToMermaidUrl(df: DataflowInformation): string;
|
|
19
5
|
/**
|
|
20
6
|
* Transforms the dataflow graph into a quad serialization.
|
|
21
7
|
* @see {@link df2quads}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dataflowGraphToJson = dataflowGraphToJson;
|
|
4
|
-
exports.dataflowGraphToMermaid = dataflowGraphToMermaid;
|
|
5
|
-
exports.dataflowGraphToMermaidUrl = dataflowGraphToMermaidUrl;
|
|
6
4
|
exports.dataflowGraphToQuads = dataflowGraphToQuads;
|
|
7
5
|
const json_1 = require("../../util/json");
|
|
8
6
|
const quads_1 = require("../../dataflow/graph/quads");
|
|
9
|
-
const dfg_1 = require("../../util/mermaid/dfg");
|
|
10
7
|
function mayObjectJson(d) {
|
|
11
8
|
if (typeof d === 'object') {
|
|
12
9
|
return objectJson(d);
|
|
@@ -52,24 +49,6 @@ function objectJson(df) {
|
|
|
52
49
|
function dataflowGraphToJson(df) {
|
|
53
50
|
return objectJson(df);
|
|
54
51
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Convert the dataflow graph to a mermaid string.
|
|
57
|
-
* @see {@link graphToMermaid}
|
|
58
|
-
* @see {@link dataflowGraphToMermaidUrl}
|
|
59
|
-
* @see {@link dataflowGraphToJson}
|
|
60
|
-
*/
|
|
61
|
-
function dataflowGraphToMermaid(df) {
|
|
62
|
-
return (0, dfg_1.graphToMermaid)({ graph: df.graph }).string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Convert the dataflow graph to a mermaid URL.
|
|
66
|
-
* @see {@link graphToMermaidUrl}
|
|
67
|
-
* @see {@link dataflowGraphToMermaid}
|
|
68
|
-
* @see {@link dataflowGraphToJson}
|
|
69
|
-
*/
|
|
70
|
-
function dataflowGraphToMermaidUrl(df) {
|
|
71
|
-
return (0, dfg_1.graphToMermaidUrl)(df.graph);
|
|
72
|
-
}
|
|
73
52
|
/**
|
|
74
53
|
* Transforms the dataflow graph into a quad serialization.
|
|
75
54
|
* @see {@link df2quads}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { internalPrinter } from '../../../print/print';
|
|
2
2
|
import { PipelineStepStage } from '../../pipeline-step';
|
|
3
|
-
import { dataflowGraphToJson,
|
|
3
|
+
import { dataflowGraphToJson, dataflowGraphToQuads } from '../../../print/dataflow-printer';
|
|
4
4
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
5
|
import type { KnownParserType, Parser } from '../../../../r-bridge/parser';
|
|
6
6
|
import type { FlowrAnalyzerContext } from '../../../../project/context/flowr-analyzer-context';
|
|
@@ -23,8 +23,8 @@ export declare const STATIC_DATAFLOW: {
|
|
|
23
23
|
readonly 0: typeof internalPrinter;
|
|
24
24
|
readonly 2: typeof dataflowGraphToJson;
|
|
25
25
|
readonly 5: typeof dataflowGraphToQuads;
|
|
26
|
-
readonly 3:
|
|
27
|
-
readonly 4:
|
|
26
|
+
readonly 3: (this: void, graph: import("../../../../dataflow/graph/graph").DataflowGraph | import("../../../../dataflow/info").DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<import("../../../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId>, simplified?: boolean) => string;
|
|
27
|
+
readonly 4: (this: void, graph: import("../../../../dataflow/graph/graph").DataflowGraph | import("../../../../dataflow/info").DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<import("../../../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId>, simplified?: boolean) => string;
|
|
28
28
|
};
|
|
29
29
|
readonly dependencies: readonly ["normalize"];
|
|
30
30
|
};
|
|
@@ -4,6 +4,7 @@ exports.STATIC_DATAFLOW = void 0;
|
|
|
4
4
|
const print_1 = require("../../../print/print");
|
|
5
5
|
const dataflow_printer_1 = require("../../../print/dataflow-printer");
|
|
6
6
|
const extractor_1 = require("../../../../dataflow/extractor");
|
|
7
|
+
const df_helper_1 = require("../../../../dataflow/graph/df-helper");
|
|
7
8
|
const staticDataflowCommon = {
|
|
8
9
|
name: 'dataflow',
|
|
9
10
|
description: 'Construct the dataflow graph',
|
|
@@ -12,8 +13,8 @@ const staticDataflowCommon = {
|
|
|
12
13
|
[0 /* StepOutputFormat.Internal */]: print_1.internalPrinter,
|
|
13
14
|
[2 /* StepOutputFormat.Json */]: dataflow_printer_1.dataflowGraphToJson,
|
|
14
15
|
[5 /* StepOutputFormat.RdfQuads */]: dataflow_printer_1.dataflowGraphToQuads,
|
|
15
|
-
[3 /* StepOutputFormat.Mermaid */]:
|
|
16
|
-
[4 /* StepOutputFormat.MermaidUrl */]:
|
|
16
|
+
[3 /* StepOutputFormat.Mermaid */]: df_helper_1.Dataflow.visualize.mermaid.raw,
|
|
17
|
+
[4 /* StepOutputFormat.MermaidUrl */]: df_helper_1.Dataflow.visualize.mermaid.url
|
|
17
18
|
},
|
|
18
19
|
dependencies: ['normalize'],
|
|
19
20
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { internalPrinter } from '../../../print/print';
|
|
2
2
|
import { PipelineStepStage } from '../../pipeline-step';
|
|
3
3
|
import type { DataflowInformation } from '../../../../dataflow/info';
|
|
4
|
-
import
|
|
4
|
+
import { SlicingCriteria } from '../../../../slicing/criterion/parse';
|
|
5
5
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
6
|
import type { ReadOnlyFlowrAnalyzerContext } from '../../../../project/context/flowr-analyzer-context';
|
|
7
|
+
import { SliceDirection } from '../../../../util/slice-direction';
|
|
7
8
|
export interface SliceRequiredInput {
|
|
8
9
|
/** The slicing criterion is only of interest if you actually want to slice the R code */
|
|
9
10
|
readonly criterion: SlicingCriteria;
|
|
@@ -14,10 +15,6 @@ export interface SliceRequiredInput {
|
|
|
14
15
|
/** The context of the analysis */
|
|
15
16
|
readonly context?: ReadOnlyFlowrAnalyzerContext;
|
|
16
17
|
}
|
|
17
|
-
export declare enum SliceDirection {
|
|
18
|
-
Backward = "backward",
|
|
19
|
-
Forward = "forward"
|
|
20
|
-
}
|
|
21
18
|
declare function processor(results: {
|
|
22
19
|
dataflow?: DataflowInformation;
|
|
23
20
|
normalize?: NormalizedAst;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STATIC_SLICE =
|
|
3
|
+
exports.STATIC_SLICE = void 0;
|
|
4
4
|
const print_1 = require("../../../print/print");
|
|
5
|
+
const parse_1 = require("../../../../slicing/criterion/parse");
|
|
5
6
|
const static_slicer_1 = require("../../../../slicing/static/static-slicer");
|
|
6
|
-
|
|
7
|
-
(function (SliceDirection) {
|
|
8
|
-
SliceDirection["Backward"] = "backward";
|
|
9
|
-
SliceDirection["Forward"] = "forward";
|
|
10
|
-
})(SliceDirection || (exports.SliceDirection = SliceDirection = {}));
|
|
7
|
+
const slice_direction_1 = require("../../../../util/slice-direction");
|
|
11
8
|
function processor(results, input) {
|
|
12
|
-
const direction = input.direction ?? SliceDirection.Backward;
|
|
9
|
+
const direction = input.direction ?? slice_direction_1.SliceDirection.Backward;
|
|
13
10
|
const threshold = input.threshold ?? input.context?.config.solver.slicer?.threshold;
|
|
14
|
-
|
|
11
|
+
const n = results.normalize;
|
|
12
|
+
return (0, static_slicer_1.staticSlice)(input.context, results.dataflow, n, parse_1.SlicingCriteria.convertAll(input.criterion, n.idMap), direction, threshold);
|
|
15
13
|
}
|
|
16
14
|
exports.STATIC_SLICE = {
|
|
17
15
|
name: 'slice',
|