@eagleoutice/flowr 2.9.13 → 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 +22 -10
- 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 +1 -1
- package/benchmark/slicer.js +7 -5
- package/cli/repl/commands/repl-dataflow.js +5 -5
- 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.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/config.d.ts +8 -8
- package/control-flow/extract-cfg.js +2 -2
- 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/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/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 +6 -1
- 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 +3 -3
- 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 +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +3 -3
- 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-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-core.js +5 -4
- package/documentation/wiki-dataflow-graph.js +14 -12
- package/documentation/wiki-interface.js +3 -3
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- 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 +1 -1
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/flowr-analyzer-builder.d.ts +3 -0
- package/project/flowr-analyzer.d.ts +1 -1
- 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/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/does-call-query/does-call-query-executor.js +2 -2
- 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-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/location-map-query/location-map-query-executor.js +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/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 +2 -2
- 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 +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +9 -1
- package/queries/query.js +2 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +6 -0
- package/r-bridge/lang-4.x/ast/model/model.js +7 -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/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/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/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/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
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
|
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
27
|
-
flowR repl using flowR v2.9.
|
|
27
|
+
flowR repl using flowR v2.9.13, R grammar v14 (tree-sitter engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ It offers a wide variety of features, for example:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
Query: linter (
|
|
36
|
+
Query: linter (2 ms)
|
|
37
37
|
╰ Deprecated Functions (deprecated-functions):
|
|
38
38
|
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
|
|
39
39
|
╰ File Path Validity (file-path-validity):
|
|
@@ -45,7 +45,7 @@ It offers a wide variety of features, for example:
|
|
|
45
45
|
╰ Absolute Paths (absolute-file-paths):
|
|
46
46
|
╰ certain:
|
|
47
47
|
╰ Path `/root/x.txt` at 1.1-23
|
|
48
|
-
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
48
|
+
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0
|
|
49
49
|
╰ Unused Definitions (unused-definitions):
|
|
50
50
|
╰ Metadata: totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0
|
|
51
51
|
╰ Naming Convention (naming-convention):
|
|
@@ -58,7 +58,9 @@ It offers a wide variety of features, for example:
|
|
|
58
58
|
╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
60
60
|
╰ Metadata: numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0
|
|
61
|
-
|
|
61
|
+
╰ Stop without call.=False argument (stop-call):
|
|
62
|
+
╰ Metadata: consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0
|
|
63
|
+
All queries together required ≈2 ms (1ms accuracy, total 2 ms)
|
|
62
64
|
```
|
|
63
65
|
|
|
64
66
|
|
|
@@ -105,11 +107,13 @@ It offers a wide variety of features, for example:
|
|
|
105
107
|
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
106
108
|
╰ **Useless Loops** (useless-loop):\
|
|
107
109
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
110
|
+
╰ **Stop without call.=False argument** (stop-call):\
|
|
111
|
+
╰ _Metadata_: <code>consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
108
112
|
_All queries together required ≈2 ms (1ms accuracy, total 2 ms)_
|
|
109
113
|
|
|
110
114
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
111
115
|
|
|
112
|
-
The analysis required _2.
|
|
116
|
+
The analysis required _2.3 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
113
117
|
|
|
114
118
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
115
119
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -236,6 +240,14 @@ It offers a wide variety of features, for example:
|
|
|
236
240
|
"searchTimeMs": 0,
|
|
237
241
|
"processTimeMs": 0
|
|
238
242
|
}
|
|
243
|
+
},
|
|
244
|
+
"stop-call": {
|
|
245
|
+
"results": [],
|
|
246
|
+
".meta": {
|
|
247
|
+
"consideredNodes": 0,
|
|
248
|
+
"searchTimeMs": 0,
|
|
249
|
+
"processTimeMs": 0
|
|
250
|
+
}
|
|
239
251
|
}
|
|
240
252
|
},
|
|
241
253
|
".meta": {
|
|
@@ -308,7 +320,7 @@ It offers a wide variety of features, for example:
|
|
|
308
320
|
|
|
309
321
|
```shell
|
|
310
322
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
311
|
-
flowR repl using flowR v2.9.
|
|
323
|
+
flowR repl using flowR v2.9.13, R grammar v14 (tree-sitter engine)
|
|
312
324
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
313
325
|
```
|
|
314
326
|
|
|
@@ -322,7 +334,7 @@ It offers a wide variety of features, for example:
|
|
|
322
334
|
N <- 10
|
|
323
335
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
324
336
|
sum
|
|
325
|
-
All queries together required ≈
|
|
337
|
+
All queries together required ≈1 ms (1ms accuracy, total 2 ms)
|
|
326
338
|
```
|
|
327
339
|
|
|
328
340
|
|
|
@@ -356,7 +368,7 @@ It offers a wide variety of features, for example:
|
|
|
356
368
|
|
|
357
369
|
|
|
358
370
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
359
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
371
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">101.1 ms</span></i> (as of Feb 28, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
360
372
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
361
373
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph#perspectives-cg).
|
|
362
374
|
|
|
@@ -392,7 +404,7 @@ It offers a wide variety of features, for example:
|
|
|
392
404
|
|
|
393
405
|
```shell
|
|
394
406
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
395
|
-
flowR repl using flowR v2.9.
|
|
407
|
+
flowR repl using flowR v2.9.13, R grammar v14 (tree-sitter engine)
|
|
396
408
|
R> :dataflow* test/testfiles/example.R
|
|
397
409
|
```
|
|
398
410
|
|
|
@@ -700,7 +712,7 @@ It offers a wide variety of features, for example:
|
|
|
700
712
|
```
|
|
701
713
|
|
|
702
714
|
|
|
703
|
-
(The analysis required _1.
|
|
715
|
+
(The analysis required _1.6 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
704
716
|
|
|
705
717
|
|
|
706
718
|
|
|
@@ -2,7 +2,6 @@ import type { ControlFlowInformation } from '../control-flow/control-flow-graph'
|
|
|
2
2
|
import { CfgVertex } from '../control-flow/control-flow-graph';
|
|
3
3
|
import type { SemanticCfgGuidedVisitorConfiguration } from '../control-flow/semantic-cfg-guided-visitor';
|
|
4
4
|
import { SemanticCfgGuidedVisitor } from '../control-flow/semantic-cfg-guided-visitor';
|
|
5
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in';
|
|
6
5
|
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
7
6
|
import { type DataflowGraphVertexFunctionCall, type DataflowGraphVertexVariableDefinition } from '../dataflow/graph/vertex';
|
|
8
7
|
import type { NoInfo, RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
@@ -11,6 +10,7 @@ import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
|
11
10
|
import { type AnyAbstractDomain } from './domains/abstract-domain';
|
|
12
11
|
import type { StateAbstractDomain } from './domains/state-abstract-domain';
|
|
13
12
|
import { MutableStateAbstractDomain } from './domains/state-abstract-domain';
|
|
13
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
14
14
|
export type AbsintVisitorConfiguration = Omit<SemanticCfgGuidedVisitorConfiguration<NoInfo, ControlFlowInformation, NormalizedAst>, 'defaultVisitingOrder' | 'defaultVisitingType'>;
|
|
15
15
|
/**
|
|
16
16
|
* A control flow graph visitor to perform abstract interpretation.
|
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AbstractInterpretationVisitor = void 0;
|
|
4
4
|
const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
5
5
|
const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
|
|
6
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
7
6
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
8
|
-
const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
|
|
9
7
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
10
8
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
11
9
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
12
10
|
const assert_1 = require("../util/assert");
|
|
13
11
|
const abstract_domain_1 = require("./domains/abstract-domain");
|
|
14
12
|
const state_abstract_domain_1 = require("./domains/state-abstract-domain");
|
|
13
|
+
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
14
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
15
15
|
/**
|
|
16
16
|
* A control flow graph visitor to perform abstract interpretation.
|
|
17
17
|
*
|
|
@@ -86,7 +86,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
86
86
|
else if (node.type === type_1.RType.ExpressionList && node.children.length > 0) {
|
|
87
87
|
return this.getAbstractValue(node.children.at(-1), state);
|
|
88
88
|
}
|
|
89
|
-
else if (origins.includes(
|
|
89
|
+
else if (origins.includes(built_in_proc_name_1.BuiltInProcName.Pipe)) {
|
|
90
90
|
if (node.type === type_1.RType.Pipe || node.type === type_1.RType.BinaryOp) {
|
|
91
91
|
return this.getAbstractValue(node.rhs, state);
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
94
94
|
return this.getAbstractValue(call.args[1].nodeId, state);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
else if (origins.includes(
|
|
97
|
+
else if (origins.includes(built_in_proc_name_1.BuiltInProcName.IfThenElse)) {
|
|
98
98
|
let values = [];
|
|
99
99
|
if (node.type === type_1.RType.IfThenElse && node.otherwise !== undefined) {
|
|
100
100
|
values = [node.then, node.otherwise].map(entry => this.getAbstractValue(entry, state));
|
|
@@ -203,20 +203,20 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
203
203
|
onDispatchFunctionCallOrigin(call, origin) {
|
|
204
204
|
super.onDispatchFunctionCallOrigin(call, origin);
|
|
205
205
|
switch (origin) {
|
|
206
|
-
case
|
|
207
|
-
case
|
|
208
|
-
case
|
|
209
|
-
case
|
|
210
|
-
case
|
|
211
|
-
case
|
|
212
|
-
case
|
|
213
|
-
case
|
|
214
|
-
case
|
|
215
|
-
case
|
|
216
|
-
case
|
|
217
|
-
case
|
|
218
|
-
case
|
|
219
|
-
case
|
|
206
|
+
case built_in_proc_name_1.BuiltInProcName.ExpressionList:
|
|
207
|
+
case built_in_proc_name_1.BuiltInProcName.IfThenElse:
|
|
208
|
+
case built_in_proc_name_1.BuiltInProcName.ForLoop:
|
|
209
|
+
case built_in_proc_name_1.BuiltInProcName.WhileLoop:
|
|
210
|
+
case built_in_proc_name_1.BuiltInProcName.RepeatLoop:
|
|
211
|
+
case built_in_proc_name_1.BuiltInProcName.FunctionDefinition:
|
|
212
|
+
case built_in_proc_name_1.BuiltInProcName.Assignment:
|
|
213
|
+
case built_in_proc_name_1.BuiltInProcName.AssignmentLike:
|
|
214
|
+
case built_in_proc_name_1.BuiltInProcName.TableAssignment:
|
|
215
|
+
case built_in_proc_name_1.BuiltInProcName.Replacement:
|
|
216
|
+
case built_in_proc_name_1.BuiltInProcName.Access:
|
|
217
|
+
case built_in_proc_name_1.BuiltInProcName.Pipe:
|
|
218
|
+
case built_in_proc_name_1.BuiltInProcName.Break:
|
|
219
|
+
case built_in_proc_name_1.BuiltInProcName.Return:
|
|
220
220
|
return;
|
|
221
221
|
default:
|
|
222
222
|
return this.onFunctionCall({ call });
|
|
@@ -273,7 +273,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
273
273
|
}
|
|
274
274
|
/** Gets each variable origin that has already been visited and whose assignment has already been processed */
|
|
275
275
|
getVariableOrigins(nodeId) {
|
|
276
|
-
return
|
|
276
|
+
return df_helper_1.Dataflow.origin(this.config.dfg, nodeId)
|
|
277
277
|
?.filter(origin => origin.type === 0 /* OriginType.ReadVariableOrigin */)
|
|
278
278
|
.map(origin => origin.id)
|
|
279
279
|
.filter(origin => this.trace.has(origin) && !this.unassigned.has(origin)) ?? [];
|
|
@@ -293,7 +293,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
293
293
|
return false;
|
|
294
294
|
}
|
|
295
295
|
const origin = dataflowVertex.origin;
|
|
296
|
-
return origin.includes(
|
|
296
|
+
return origin.includes(built_in_proc_name_1.BuiltInProcName.ForLoop) || origin.includes(built_in_proc_name_1.BuiltInProcName.WhileLoop) || origin.includes(built_in_proc_name_1.BuiltInProcName.RepeatLoop);
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
299
299
|
* Checks whether a control flow graph vertex should be skipped during visitation.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapDataFrameReplacementFunction = mapDataFrameReplacementFunction;
|
|
4
4
|
const config_1 = require("../../../config");
|
|
5
|
-
const built_in_1 = require("../../../dataflow/environments/built-in");
|
|
6
5
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
6
|
const make_argument_1 = require("../../../dataflow/internal/process/functions/call/argument/make-argument");
|
|
8
7
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
@@ -12,6 +11,7 @@ const semantics_1 = require("../semantics");
|
|
|
12
11
|
const access_mapper_1 = require("./access-mapper");
|
|
13
12
|
const arguments_1 = require("./arguments");
|
|
14
13
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
14
|
+
const built_in_proc_name_1 = require("../../../dataflow/environments/built-in-proc-name");
|
|
15
15
|
/** Mapper for mapping the supported data frame replacement functions to mapper functions */
|
|
16
16
|
const DataFrameReplacementFunctionMapper = {
|
|
17
17
|
'colnames': mapDataFrameColNamesAssignment,
|
|
@@ -59,7 +59,7 @@ function isDataFrameReplacement(functionName) {
|
|
|
59
59
|
}
|
|
60
60
|
function hasParentReplacement(node, dfg) {
|
|
61
61
|
const parentVertex = node.info.parent ? dfg.getVertex(node.info.parent) : undefined;
|
|
62
|
-
return (0, vertex_1.isFunctionCallVertex)(parentVertex) && parentVertex.origin.includes(
|
|
62
|
+
return (0, vertex_1.isFunctionCallVertex)(parentVertex) && parentVertex.origin.includes(built_in_proc_name_1.BuiltInProcName.Replacement);
|
|
63
63
|
}
|
|
64
64
|
function mapDataFrameContentAssignment(access, expression, inference) {
|
|
65
65
|
const dataFrame = access.accessed;
|
package/benchmark/slicer.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { SliceResult } from '../slicing/static/slicer-types';
|
|
|
8
8
|
import type { ReconstructionResult } from '../reconstruct/reconstruct';
|
|
9
9
|
import type { PerSliceStats, SlicerStats, SlicerStatsDfShape } from './stats/stats';
|
|
10
10
|
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
11
|
-
import
|
|
11
|
+
import { SlicingCriteria } from '../slicing/criterion/parse';
|
|
12
12
|
import { type RParseRequestFromFile, type RParseRequestFromText } from '../r-bridge/retriever';
|
|
13
13
|
import { type SlicingCriteriaFilter } from '../slicing/criterion/collect-all';
|
|
14
14
|
import type { AutoSelectPredicate } from '../reconstruct/auto-select/auto-select-defaults';
|
package/benchmark/slicer.js
CHANGED
|
@@ -13,6 +13,7 @@ const seedrandom_1 = __importDefault(require("seedrandom"));
|
|
|
13
13
|
const log_1 = require("../util/log");
|
|
14
14
|
const assert_1 = require("../util/assert");
|
|
15
15
|
const strings_1 = require("../util/text/strings");
|
|
16
|
+
const parse_1 = require("../slicing/criterion/parse");
|
|
16
17
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
17
18
|
const retriever_1 = require("../r-bridge/retriever");
|
|
18
19
|
const collect_all_1 = require("../slicing/criterion/collect-all");
|
|
@@ -199,15 +200,16 @@ class BenchmarkSlicer {
|
|
|
199
200
|
this.executor.updateRequest({ criterion: slicingCriteria });
|
|
200
201
|
const totalStopwatch = measurements.start('total');
|
|
201
202
|
const slicedOutput = await this.measureSliceStep('slice', measurements, 'static slicing');
|
|
202
|
-
|
|
203
|
+
const decodedCriteria = parse_1.SlicingCriteria.decodeAll(slicingCriteria, this.normalizedAst.idMap);
|
|
204
|
+
stats.slicingCriteria = Array.from(decodedCriteria);
|
|
203
205
|
stats.reconstructedCode = await this.measureSliceStep('reconstruct', measurements, 'reconstruct code');
|
|
204
206
|
totalStopwatch.stop();
|
|
205
207
|
exports.benchmarkLogger.debug(`Produced code for ${JSON.stringify(slicingCriteria)}: ${stats.reconstructedCode.code}`);
|
|
206
208
|
const results = this.executor.getResults(false);
|
|
207
209
|
if (exports.benchmarkLogger.settings.minLevel >= 3 /* LogLevel.Info */) {
|
|
208
|
-
exports.benchmarkLogger.info(`mapped slicing criteria: ${slicedOutput.
|
|
209
|
-
const node = results.normalize.idMap.get(
|
|
210
|
-
return `\n- id: ${
|
|
210
|
+
exports.benchmarkLogger.info(`mapped slicing criteria: ${slicedOutput.slicedFor.map(id => {
|
|
211
|
+
const node = results.normalize.idMap.get(id);
|
|
212
|
+
return `\n- id: ${id}, location: ${JSON.stringify(node?.location)}, lexeme: ${JSON.stringify(node?.lexeme)}`;
|
|
211
213
|
}).join('')}`);
|
|
212
214
|
}
|
|
213
215
|
// if it is not in the dataflow graph it was kept to be safe and should not count to the included nodes
|
|
@@ -235,7 +237,7 @@ class BenchmarkSlicer {
|
|
|
235
237
|
this.guardActive();
|
|
236
238
|
const g = this.dataflow?.graph;
|
|
237
239
|
(0, assert_1.guard)(g !== undefined, 'dataflow should be defined for call graph extraction');
|
|
238
|
-
this.callGraph = this.measureSimpleStep('extract call graph', () =>
|
|
240
|
+
this.callGraph = this.measureSimpleStep('extract call graph', () => call_graph_1.CallGraph.compute(g));
|
|
239
241
|
}
|
|
240
242
|
/**
|
|
241
243
|
* Infer the shape of data frames using abstract interpretation with {@link inferDataFrameShapes}
|
|
@@ -35,11 +35,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.dataflowSimpleStarCommand = exports.dataflowSimplifiedCommand = exports.dataflowSilentCommand = exports.dataflowAsciiCommand = exports.dataflowStarCommand = exports.dataflowCommand = void 0;
|
|
37
37
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
38
|
-
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
39
38
|
const ansi_1 = require("../../../util/text/ansi");
|
|
40
39
|
const core_1 = require("../core");
|
|
41
40
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
42
41
|
const dfg_ascii_1 = require("../../../util/simple-df/dfg-ascii");
|
|
42
|
+
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
43
43
|
function formatInfo(out, type, meta) {
|
|
44
44
|
return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${meta['.meta'].timing + 'ms'}).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
45
45
|
}
|
|
@@ -52,7 +52,7 @@ exports.dataflowCommand = {
|
|
|
52
52
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
53
53
|
fn: async ({ output, analyzer }) => {
|
|
54
54
|
const result = await analyzer.dataflow();
|
|
55
|
-
const mermaid =
|
|
55
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.convert({ graph: result.graph, includeEnvironments: false }).string;
|
|
56
56
|
output.stdout(mermaid);
|
|
57
57
|
try {
|
|
58
58
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -72,7 +72,7 @@ exports.dataflowStarCommand = {
|
|
|
72
72
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
73
73
|
fn: async ({ output, analyzer }) => {
|
|
74
74
|
const result = await analyzer.dataflow();
|
|
75
|
-
const mermaid =
|
|
75
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false);
|
|
76
76
|
output.stdout(mermaid);
|
|
77
77
|
try {
|
|
78
78
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -126,7 +126,7 @@ exports.dataflowSimplifiedCommand = {
|
|
|
126
126
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
127
127
|
fn: async ({ output, analyzer }) => {
|
|
128
128
|
const result = await analyzer.dataflow();
|
|
129
|
-
const mermaid =
|
|
129
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.convert({ graph: result.graph, includeEnvironments: false, simplified: true }).string;
|
|
130
130
|
output.stdout(mermaid);
|
|
131
131
|
try {
|
|
132
132
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -145,7 +145,7 @@ exports.dataflowSimpleStarCommand = {
|
|
|
145
145
|
argsParser: (args) => (0, core_1.handleString)(args),
|
|
146
146
|
fn: async ({ output, analyzer }) => {
|
|
147
147
|
const result = await analyzer.dataflow();
|
|
148
|
-
const mermaid =
|
|
148
|
+
const mermaid = df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false, undefined, true);
|
|
149
149
|
output.stdout(mermaid);
|
|
150
150
|
try {
|
|
151
151
|
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SliceDirection } from '../../../core/steps/all/static-slicing/00-slice';
|
|
2
1
|
import type { SingleSlicingCriterion, SlicingCriteria } from '../../../slicing/criterion/parse';
|
|
2
|
+
import { SliceDirection } from '../../../util/slice-direction';
|
|
3
3
|
/**
|
|
4
4
|
* Checks whether the given argument represents a slicing direction with an `f` suffix.
|
|
5
5
|
*/
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.sliceDirectionParser = sliceDirectionParser;
|
|
4
4
|
exports.sliceCriterionParser = sliceCriterionParser;
|
|
5
5
|
exports.sliceCriteriaParser = sliceCriteriaParser;
|
|
6
|
-
const
|
|
6
|
+
const slice_direction_1 = require("../../../util/slice-direction");
|
|
7
7
|
/**
|
|
8
8
|
* Checks whether the given argument represents a slicing direction with an `f` suffix.
|
|
9
9
|
*/
|
|
10
10
|
function sliceDirectionParser(argument) {
|
|
11
11
|
const endBracket = argument.indexOf(')');
|
|
12
|
-
return argument[endBracket + 1] === 'f' ?
|
|
12
|
+
return argument[endBracket + 1] === 'f' ? slice_direction_1.SliceDirection.Forward : slice_direction_1.SliceDirection.Backward;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Parses a single slicing criterion from the given argument.
|
|
@@ -58,8 +58,8 @@ const tmp = __importStar(require("tmp"));
|
|
|
58
58
|
const fs_1 = __importDefault(require("fs"));
|
|
59
59
|
const message_query_1 = require("./messages/message-query");
|
|
60
60
|
const compact_1 = require("./compact");
|
|
61
|
-
const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
|
|
62
61
|
const flowr_analyzer_builder_1 = require("../../../project/flowr-analyzer-builder");
|
|
62
|
+
const slice_direction_1 = require("../../../util/slice-direction");
|
|
63
63
|
/**
|
|
64
64
|
* Each connection handles a single client, answering to its requests.
|
|
65
65
|
* There is no need to construct this class manually, {@link FlowRServer} will do it for you.
|
|
@@ -235,7 +235,7 @@ class FlowRServerConnection {
|
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
const request = requestResult.message;
|
|
238
|
-
this.logger.info(`[${request.filetoken}] Received ${request.direction ??
|
|
238
|
+
this.logger.info(`[${request.filetoken}] Received ${request.direction ?? slice_direction_1.SliceDirection.Backward} slice request with criteria ${JSON.stringify(request.criterion)}`);
|
|
239
239
|
const fileInformation = this.fileMap.get(request.filetoken);
|
|
240
240
|
if (!fileInformation) {
|
|
241
241
|
(0, send_1.sendMessage)(this.socket, {
|
|
@@ -2,7 +2,7 @@ import type { IdMessageBase, MessageDefinition } from './all-messages';
|
|
|
2
2
|
import type { SlicingCriteria } from '../../../../slicing/criterion/parse';
|
|
3
3
|
import type { PipelineOutput } from '../../../../core/steps/pipeline/pipeline';
|
|
4
4
|
import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICING_PIPELINE } from '../../../../core/steps/pipeline/default-pipelines';
|
|
5
|
-
import { SliceDirection } from '../../../../
|
|
5
|
+
import { SliceDirection } from '../../../../util/slice-direction';
|
|
6
6
|
/**
|
|
7
7
|
* Can only be sent after you have sent the {@link FileAnalysisRequestMessage}.
|
|
8
8
|
* Using the same `filetoken` as in the {@link FileAnalysisRequestMessage} you
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.responseSliceMessage = exports.requestSliceMessage = void 0;
|
|
37
37
|
const Joi = __importStar(require("joi"));
|
|
38
|
-
const
|
|
38
|
+
const slice_direction_1 = require("../../../../util/slice-direction");
|
|
39
39
|
exports.requestSliceMessage = {
|
|
40
40
|
type: 'request-slice',
|
|
41
41
|
schema: Joi.object({
|
|
@@ -43,7 +43,7 @@ exports.requestSliceMessage = {
|
|
|
43
43
|
id: Joi.string().optional().description('The id of the message, if you passed one in the request.'),
|
|
44
44
|
filetoken: Joi.string().required().description('The filetoken of the file to slice must be the same as with the analysis request.'),
|
|
45
45
|
criterion: Joi.array().items(Joi.string()).min(0).required().required().description('The slicing criteria to use.'),
|
|
46
|
-
direction: Joi.string().valid(...Object.values(
|
|
46
|
+
direction: Joi.string().valid(...Object.values(slice_direction_1.SliceDirection)).description('The direction to slice in. Defaults to backward slicing if unset.')
|
|
47
47
|
})
|
|
48
48
|
};
|
|
49
49
|
exports.responseSliceMessage = {
|
package/config.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ export declare const FlowrConfig: {
|
|
|
231
231
|
* The default configuration for flowR, used when no config file is found or when a config file is missing some options.
|
|
232
232
|
* You can use this as a base for your own config and only specify the options you want to change.
|
|
233
233
|
*/
|
|
234
|
-
readonly default: () => FlowrConfig;
|
|
234
|
+
readonly default: (this: void) => FlowrConfig;
|
|
235
235
|
/**
|
|
236
236
|
* The Joi schema for validating a config file, use this to validate your config file before using it. You can also use this to generate documentation for the config file format.
|
|
237
237
|
*/
|
|
@@ -239,26 +239,26 @@ export declare const FlowrConfig: {
|
|
|
239
239
|
/**
|
|
240
240
|
* Parses the given JSON string as a flowR config file, returning the resulting config object if the parsing and validation were successful, or `undefined` if there was an error.
|
|
241
241
|
*/
|
|
242
|
-
readonly parse: (jsonString: string) => FlowrConfig | undefined;
|
|
242
|
+
readonly parse: (this: void, jsonString: string) => FlowrConfig | undefined;
|
|
243
243
|
/**
|
|
244
244
|
* Creates a new flowr config that has the updated values.
|
|
245
245
|
*/
|
|
246
|
-
readonly amend: (config: FlowrConfig, amendmentFunc: (config: DeepWritable<FlowrConfig>) => FlowrConfig | void) => FlowrConfig;
|
|
246
|
+
readonly amend: (this: void, config: FlowrConfig, amendmentFunc: (config: DeepWritable<FlowrConfig>) => FlowrConfig | void) => FlowrConfig;
|
|
247
247
|
/**
|
|
248
248
|
* Clones the given flowr config object.
|
|
249
249
|
*/
|
|
250
|
-
readonly clone: (config: FlowrConfig) => FlowrConfig;
|
|
250
|
+
readonly clone: (this: void, config: FlowrConfig) => FlowrConfig;
|
|
251
251
|
/**
|
|
252
252
|
* Loads the flowr config from the given file or the default locations.
|
|
253
253
|
* Please note that you can also use this without a path parameter to
|
|
254
254
|
* infer the config from flowR's default locations.
|
|
255
255
|
* This is mostly useful for user-facing features.
|
|
256
256
|
*/
|
|
257
|
-
readonly fromFile: (configFile?: string, configWorkingDirectory?: string) => FlowrConfig;
|
|
257
|
+
readonly fromFile: (this: void, configFile?: string, configWorkingDirectory?: string) => FlowrConfig;
|
|
258
258
|
/**
|
|
259
259
|
* Gets the configuration for the given engine type from the config.
|
|
260
260
|
*/
|
|
261
|
-
readonly getForEngine: <T extends EngineConfig["type"]>(config: FlowrConfig, engine: T) => (EngineConfig & {
|
|
261
|
+
readonly getForEngine: <T extends EngineConfig["type"]>(this: void, config: FlowrConfig, engine: T) => (EngineConfig & {
|
|
262
262
|
type: T;
|
|
263
263
|
}) | undefined;
|
|
264
264
|
/**
|
|
@@ -272,10 +272,10 @@ export declare const FlowrConfig: {
|
|
|
272
272
|
* console.log(newConfig.solver.variables); // Output: "builtin"
|
|
273
273
|
* ```
|
|
274
274
|
*/
|
|
275
|
-
readonly setInConfig: <Path extends ValidFlowrConfigPaths>(config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => FlowrConfig;
|
|
275
|
+
readonly setInConfig: <Path extends ValidFlowrConfigPaths>(this: void, config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => FlowrConfig;
|
|
276
276
|
/**
|
|
277
277
|
* Modifies the given config object in place by setting the given value at the given key, where the key is a dot-separated path to the value in the config object.
|
|
278
278
|
* @see {@link setInConfig} for a version that returns a new config object instead of modifying the given one in place.
|
|
279
279
|
*/
|
|
280
|
-
readonly setInConfigInPlace: <Path extends ValidFlowrConfigPaths>(config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => void;
|
|
280
|
+
readonly setInConfigInPlace: <Path extends ValidFlowrConfigPaths>(this: void, config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => void;
|
|
281
281
|
};
|
|
@@ -13,9 +13,9 @@ const vertex_1 = require("../dataflow/graph/vertex");
|
|
|
13
13
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
14
14
|
const cfg_simplification_1 = require("./cfg-simplification");
|
|
15
15
|
const assert_1 = require("../util/assert");
|
|
16
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
17
16
|
const stateful_fold_1 = require("../r-bridge/lang-4.x/ast/model/processing/stateful-fold");
|
|
18
17
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
18
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
19
19
|
const cfgFolds = {
|
|
20
20
|
down: (n, down) => {
|
|
21
21
|
if (r_function_definition_1.RFunctionDefinition.is(n)) {
|
|
@@ -382,7 +382,7 @@ function cfgFunctionCall(call, name, args, down) {
|
|
|
382
382
|
}
|
|
383
383
|
exports.ResolvedCallSuffix = control_flow_graph_1.CfgVertex.toExitId('-resolved-call');
|
|
384
384
|
const OriginToFoldTypeMap = {
|
|
385
|
-
[
|
|
385
|
+
[built_in_proc_name_1.BuiltInProcName.IfThenElse]: (folds, call, args, down) => {
|
|
386
386
|
// arguments are in order!
|
|
387
387
|
return folds.foldIfThenElse(call, // we will have to this more sophisticated if we rewrite the dfg based generation
|
|
388
388
|
args[0] === r_function_call_1.EmptyArgument ? (0, control_flow_graph_1.emptyControlFlowInformation)() : args[0], args[1] === r_function_call_1.EmptyArgument ? (0, control_flow_graph_1.emptyControlFlowInformation)() : args[1], args[2] === r_function_call_1.EmptyArgument ? (0, control_flow_graph_1.emptyControlFlowInformation)() : args[2], down);
|
|
@@ -11,10 +11,10 @@ import type { RLogical } from '../r-bridge/lang-4.x/ast/model/nodes/r-logical';
|
|
|
11
11
|
import type { DataflowGraph, FunctionArgument } from '../dataflow/graph/graph';
|
|
12
12
|
import type { NoInfo, RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
13
13
|
import type { RSymbol } from '../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
14
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in';
|
|
15
14
|
import type { RExpressionList } from '../r-bridge/lang-4.x/ast/model/nodes/r-expression-list';
|
|
16
15
|
import type { ReadOnlyFlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
17
16
|
import { RNull } from '../r-bridge/lang-4.x/convert-values';
|
|
17
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
18
18
|
export interface SemanticCfgGuidedVisitorConfiguration<OtherInfo = NoInfo, ControlFlow extends ControlFlowInformation = ControlFlowInformation, Ast extends NormalizedAst<OtherInfo> = NormalizedAst<OtherInfo>, Dfg extends DataflowGraph = DataflowGraph> extends DataflowCfgGuidedVisitorConfiguration<ControlFlow, Dfg>, SyntaxCfgGuidedVisitorConfiguration<OtherInfo, ControlFlow, Ast> {
|
|
19
19
|
readonly ctx: ReadOnlyFlowrAnalyzerContext;
|
|
20
20
|
}
|