@eagleoutice/flowr 2.14.1 → 2.14.2
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 +154 -87
- package/abstract-interpretation/absint-visitor.d.ts +91 -25
- package/abstract-interpretation/absint-visitor.js +235 -74
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/arguments.js +1 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +107 -254
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -5
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
- package/abstract-interpretation/data-frame/resolve-args.js +6 -4
- package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -9
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -0
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -0
- package/abstract-interpretation/domains/partial-product-domain.js +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +3 -2
- package/abstract-interpretation/domains/set-range-domain.js +3 -2
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +3 -2
- package/abstract-interpretation/domains/set-upper-bound-domain.js +3 -2
- package/benchmark/calibration.d.ts +11 -6
- package/benchmark/calibration.js +19 -8
- package/benchmark/slicer.d.ts +7 -1
- package/benchmark/slicer.js +38 -34
- package/benchmark/stats/count-comments.d.ts +16 -0
- package/benchmark/stats/count-comments.js +30 -0
- package/benchmark/stats/print.js +2 -0
- package/benchmark/stats/size-of.d.ts +7 -3
- package/benchmark/stats/size-of.js +7 -3
- package/benchmark/stats/stats.d.ts +7 -0
- package/benchmark/summarizer/first-phase/process.js +2 -19
- package/benchmark/summarizer/second-phase/graph.js +13 -3
- package/benchmark/summarizer/second-phase/process.js +2 -0
- package/cli/repl/commands/repl-dataflow.js +70 -27
- package/cli/repl/core.d.ts +1 -1
- package/cli/repl/core.js +1 -1
- package/cli/repl/parser/slice-query-parser.js +2 -1
- package/cli/repl/server/connection.d.ts +4 -0
- package/cli/repl/server/connection.js +19 -16
- package/cli/repl/server/messages/message-analysis.d.ts +1 -1
- package/config.d.ts +6 -0
- package/config.js +8 -4
- package/control-flow/basic-cfg-guided-visitor.d.ts +7 -2
- package/control-flow/basic-cfg-guided-visitor.js +37 -24
- package/control-flow/cfg-dead-code.js +44 -33
- package/control-flow/cfg-properties.js +2 -2
- package/control-flow/cfg-simplification.js +6 -5
- package/control-flow/cfg-to-basic-blocks.js +11 -13
- package/control-flow/control-flow-graph.d.ts +179 -189
- package/control-flow/control-flow-graph.js +400 -263
- package/control-flow/dfg-cfg-guided-visitor.d.ts +21 -3
- package/control-flow/dfg-cfg-guided-visitor.js +17 -13
- package/control-flow/diff-cfg.js +6 -14
- package/control-flow/happens-before.js +5 -4
- package/control-flow/semantic-cfg-guided-visitor.d.ts +44 -101
- package/control-flow/semantic-cfg-guided-visitor.js +6 -26
- package/control-flow/simple-visitor.js +14 -15
- package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -1
- package/control-flow/useless-loop.js +18 -14
- package/core/steps/all/core/20-dataflow.d.ts +1 -3
- package/core/steps/pipeline/default-pipelines.d.ts +141 -157
- package/dataflow/cluster.js +7 -0
- package/dataflow/environments/apply-kill.d.ts +6 -0
- package/dataflow/environments/apply-kill.js +63 -31
- package/dataflow/environments/built-in-props.d.ts +5 -1
- package/dataflow/environments/built-in-props.js +4 -0
- package/dataflow/environments/built-in.d.ts +6 -3
- package/dataflow/environments/built-in.js +8 -5
- package/dataflow/environments/clone.d.ts +3 -3
- package/dataflow/environments/clone.js +5 -5
- package/dataflow/environments/default-builtin-config.d.ts +112 -7
- package/dataflow/environments/default-builtin-config.js +82 -34
- package/dataflow/environments/environment.d.ts +5 -5
- package/dataflow/environments/environment.js +5 -5
- package/dataflow/environments/identifier.d.ts +11 -1
- package/dataflow/environments/identifier.js +4 -1
- package/dataflow/environments/resolve-by-name.d.ts +7 -0
- package/dataflow/environments/resolve-by-name.js +12 -0
- package/dataflow/environments/resolve-helper.d.ts +3 -1
- package/dataflow/environments/resolve-helper.js +2 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +2 -2
- package/dataflow/eval/resolve/alias-tracking.js +2 -2
- package/dataflow/eval/resolve/match-arguments.js +7 -5
- package/dataflow/eval/resolve/node-value.d.ts +3 -1
- package/dataflow/eval/resolve/node-value.js +12 -0
- package/dataflow/eval/resolve/resolve-argument.js +5 -4
- package/dataflow/eval/resolve/resolve-operators.js +9 -6
- package/dataflow/eval/resolve/resolve-strings.js +2 -2
- package/dataflow/eval/resolve/resolve-working-directory.js +4 -3
- package/dataflow/eval/resolve/resolve.js +3 -2
- package/dataflow/eval/values/general.js +8 -5
- package/dataflow/extractor.d.ts +1 -4
- package/dataflow/extractor.js +11 -10
- package/dataflow/fn/exceptions-of-function.d.ts +3 -1
- package/dataflow/fn/strict-function.js +7 -5
- package/dataflow/graph/call-graph.js +2 -2
- package/dataflow/graph/df-helper.d.ts +8 -1
- package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
- package/dataflow/graph/diff-dataflow-graph.js +19 -2
- package/dataflow/graph/edge.d.ts +38 -2
- package/dataflow/graph/edge.js +32 -2
- package/dataflow/graph/graph.d.ts +4 -3
- package/dataflow/graph/graph.js +6 -2
- package/dataflow/graph/match-args.d.ts +69 -0
- package/dataflow/graph/match-args.js +167 -0
- package/dataflow/info.d.ts +14 -0
- package/dataflow/internal/control-flow.d.ts +102 -0
- package/dataflow/internal/control-flow.js +200 -0
- package/dataflow/internal/linker.d.ts +6 -31
- package/dataflow/internal/linker.js +24 -81
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -37
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +11 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
- 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 +18 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +8 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +11 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +27 -20
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +35 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +20 -17
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +8 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +7 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +15 -13
- 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 +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +26 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +17 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +71 -33
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +6 -15
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +12 -13
- 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 +14 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +15 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +12 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +45 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +19 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +6 -2
- package/dataflow/internal/process/functions/call/common.js +5 -6
- package/dataflow/internal/process/functions/call/deferred.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +23 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +2 -0
- package/dataflow/internal/process/functions/call/nse.d.ts +1 -1
- package/dataflow/internal/process/functions/call/nse.js +6 -1
- package/dataflow/internal/process/functions/call/quoted.js +2 -2
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +19 -6
- package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/process-argument.js +12 -4
- package/dataflow/internal/process/functions/process-parameter.js +13 -0
- package/dataflow/internal/process/process-named-call.d.ts +2 -2
- package/dataflow/internal/process/process-named-call.js +9 -7
- package/documentation/data/server/doc-data-server-messages.js +4 -4
- package/documentation/doc-readme.js +45 -0
- package/documentation/doc-util/doc-cfg.d.ts +8 -7
- package/documentation/doc-util/doc-cfg.js +10 -10
- package/documentation/doc-util/doc-playground.d.ts +12 -0
- package/documentation/doc-util/doc-playground.js +21 -0
- package/documentation/doc-util/doc-query.d.ts +4 -1
- package/documentation/doc-util/doc-query.js +4 -2
- package/documentation/wiki-absint.d.ts +3 -4
- package/documentation/wiki-absint.js +12 -5
- package/documentation/wiki-analyzer.js +2 -2
- package/documentation/wiki-cfg.js +101 -106
- package/documentation/wiki-dataflow-graph.js +84 -53
- package/documentation/wiki-linter.js +15 -1
- package/documentation/wiki-linting-and-testing.js +1 -16
- package/documentation/wiki-mk/doc-maker.js +6 -4
- package/documentation/wiki-query.js +14 -4
- package/documentation/wiki-signature-database.js +28 -2
- package/linter/linter-fix.d.ts +16 -0
- package/linter/linter-fix.js +104 -0
- package/linter/linter-format.d.ts +18 -1
- package/linter/linter-format.js +31 -1
- package/linter/linter-output.js +46 -10
- package/linter/linter-rules.d.ts +40 -9
- package/linter/linter-rules.js +2 -0
- package/linter/rules/absolute-path.js +4 -2
- package/linter/rules/dataframe-access-validation.js +6 -7
- package/linter/rules/deprecated-functions.d.ts +107 -10
- package/linter/rules/deprecated-functions.js +309 -23
- package/linter/rules/file-path-validity.js +5 -4
- package/linter/rules/function-finder-util.d.ts +6 -0
- package/linter/rules/function-finder-util.js +21 -13
- package/linter/rules/naming-convention.js +1 -1
- package/linter/rules/network-functions.d.ts +2 -2
- package/linter/rules/stop-with-call-arg.js +2 -2
- package/linter/rules/unclosed-connection.js +2 -2
- package/linter/rules/undefined-symbol-util.js +6 -4
- package/linter/rules/undefined-symbol.js +2 -2
- package/linter/rules/unused-definition.js +8 -4
- package/linter/rules/unused-import.d.ts +60 -0
- package/linter/rules/unused-import.js +179 -0
- package/package.json +2 -2
- package/project/attached-packages.js +2 -1
- package/project/cache/flowr-analyzer-cache.d.ts +2 -5
- package/project/cache/flowr-analyzer-cache.js +4 -7
- package/project/cache/flowr-analyzer-controlflow-cache.d.ts +9 -8
- package/project/cache/flowr-analyzer-controlflow-cache.js +17 -34
- package/project/cache/flowr-cache.d.ts +9 -0
- package/project/cache/flowr-cache.js +19 -0
- package/project/context/flowr-analyzer-context.d.ts +7 -3
- package/project/context/flowr-analyzer-context.js +15 -9
- package/project/context/flowr-analyzer-dependencies-context.d.ts +24 -3
- package/project/context/flowr-analyzer-dependencies-context.js +9 -14
- package/project/context/flowr-analyzer-files-context.js +15 -17
- package/project/context/flowr-analyzer-meta-context.js +2 -12
- package/project/dependency-version-space.d.ts +0 -7
- package/project/dependency-version-space.js +8 -7
- package/project/flowr-analyzer.d.ts +4 -6
- package/project/flowr-analyzer.js +4 -5
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -34
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +13 -13
- package/project/plugins/file-plugins/files/flowr-rda-file.js +131 -286
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +1 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +1 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +32 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +43 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +3 -16
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +5 -8
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +4 -10
- package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +3 -10
- package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +1 -13
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +3 -6
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +3 -4
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -6
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +3 -16
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +3 -16
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -16
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +2 -8
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +2 -6
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +1 -10
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.js +2 -8
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +2 -1
- package/project/sigdb/build.d.ts +2 -2
- package/project/sigdb/decode.d.ts +0 -5
- package/project/sigdb/decode.js +0 -8
- package/project/sigdb/index-format.d.ts +4 -4
- package/project/sigdb/manifest.d.ts +2 -2
- package/project/sigdb/reader.d.ts +48 -13
- package/project/sigdb/reader.js +2 -1
- package/project/sigdb/schema.d.ts +3 -1
- package/project/sigdb/signature-db.d.ts +69 -0
- package/project/sigdb/signature-db.js +54 -0
- package/project/sigdb/signature-match.d.ts +10 -5
- package/project/sigdb/signature-match.js +13 -8
- package/queries/catalog/absint-query/absint-query-executor.js +1 -2
- package/queries/catalog/call-context-query/call-context-query-executor.js +2 -4
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +33 -6
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.js +22 -35
- package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +13 -1
- package/queries/catalog/dependencies-query/function-info/library-functions.js +26 -22
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +9 -0
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +19 -0
- package/queries/catalog/dependencies-query/implicit-echo.d.ts +13 -0
- package/queries/catalog/dependencies-query/implicit-echo.js +133 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +1 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/signature-query/signature-query-executor.js +4 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +4 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +6 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +6 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +13 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +3 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +6 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +5 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +5 -3
- package/reconstruct/inline/source-inline-map.js +3 -3
- package/reconstruct/reconstruct.js +6 -4
- package/search/flowr-search-builder.d.ts +8 -8
- package/search/flowr-search-builder.js +4 -4
- package/search/flowr-search-filters.d.ts +2 -2
- package/search/flowr-search-filters.js +3 -2
- package/search/search-executor/search-enrichers.d.ts +6 -4
- package/search/search-executor/search-enrichers.js +44 -5
- package/slicing/criterion/filters/all-variables.js +2 -1
- package/slicing/criterion/parse.js +8 -6
- package/slicing/static/slice-call.js +2 -2
- package/util/arg-matching.d.ts +3 -0
- package/util/arg-matching.js +12 -1
- package/util/collections/arrays.d.ts +0 -4
- package/util/collections/arrays.js +4 -26
- package/util/diff-graph.d.ts +1 -1
- package/util/diff-graph.js +17 -3
- package/util/diff.d.ts +6 -0
- package/util/mermaid/ast.d.ts +1 -1
- package/util/mermaid/ast.js +5 -4
- package/util/mermaid/cfg.js +130 -24
- package/util/mermaid/dfg.js +31 -10
- package/util/mermaid/mermaid.js +2 -0
- package/util/objects.d.ts +9 -0
- package/util/objects.js +12 -0
- package/util/prefix.d.ts +1 -1
- package/util/text/playground-link.d.ts +131 -0
- package/util/text/playground-link.js +214 -0
- package/util/text/strings.js +7 -3
- package/util/version.js +1 -1
- package/control-flow/cfg-builder.d.ts +0 -30
- package/control-flow/cfg-builder.js +0 -79
- package/control-flow/extract-cfg.d.ts +0 -36
- package/control-flow/extract-cfg.js +0 -693
- package/project/cfg-kind.d.ts +0 -21
- package/project/cfg-kind.js +0 -26
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import { type CfgBasicBlockVertex, type
|
|
1
|
+
import { type CfgBasicBlockVertex, type CfgExpressionVertex, CfgVertex, type CfgStatementVertex, type ControlFlowInformation } from './control-flow-graph';
|
|
2
2
|
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import { type DataflowGraphVertexArgument, type DataflowGraphVertexFunctionCall, type DataflowGraphVertexFunctionDefinition, type DataflowGraphVertexUse, type DataflowGraphVertexValue, type DataflowGraphVertexVariableDefinition } from '../dataflow/graph/vertex';
|
|
4
4
|
import { type BasicCfgGuidedVisitorConfiguration, BasicCfgGuidedVisitor } from './basic-cfg-guided-visitor';
|
|
5
5
|
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
6
|
+
import type { AstIdMap } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
7
|
export interface DataflowCfgGuidedVisitorConfiguration<ControlFlow extends ControlFlowInformation = ControlFlowInformation, Dfg extends DataflowGraph = DataflowGraph> extends BasicCfgGuidedVisitorConfiguration<ControlFlow> {
|
|
7
8
|
readonly dfg: Dfg;
|
|
8
|
-
readonly defaultVisitingType?: 'entry' | 'exit';
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Fill in what a cfg-guided visitor can take from the control flow view itself: the dataflow graph it views,
|
|
12
|
+
* and the ast that graph knows. Pass either yourself to use a different one.
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* new MyVisitor(cfgVisitorConfig({ controlFlow, defaultVisitingOrder: 'forward' }))
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function cfgVisitorConfig<Config extends BasicCfgGuidedVisitorConfiguration & {
|
|
19
|
+
dfg?: DataflowGraph;
|
|
20
|
+
normalizedAst?: {
|
|
21
|
+
idMap: AstIdMap;
|
|
22
|
+
};
|
|
23
|
+
}>(config: Config): Config & {
|
|
24
|
+
dfg: DataflowGraph;
|
|
25
|
+
normalizedAst: {
|
|
26
|
+
idMap: AstIdMap;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
10
29
|
/**
|
|
11
30
|
* This visitor extends on the {@link BasicCfgGuidedVisitor} by dispatching visitors based on the dataflow graph.
|
|
12
31
|
*
|
|
@@ -19,7 +38,6 @@ export declare class DataflowAwareCfgGuidedVisitor<ControlFlow extends ControlFl
|
|
|
19
38
|
protected getDataflowGraph(id: NodeId): DataflowGraphVertexArgument | undefined;
|
|
20
39
|
protected onStatementNode(node: CfgStatementVertex): void;
|
|
21
40
|
protected onExpressionNode(node: CfgExpressionVertex): void;
|
|
22
|
-
protected onEndMarkerNode(node: CfgMarkerVertex): void;
|
|
23
41
|
protected visitDataflowNode(node: Exclude<CfgVertex, CfgBasicBlockVertex>): void;
|
|
24
42
|
/**
|
|
25
43
|
* called for every cfg vertex that has no corresponding dataflow vertex.
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DataflowAwareCfgGuidedVisitor = void 0;
|
|
4
|
+
exports.cfgVisitorConfig = cfgVisitorConfig;
|
|
4
5
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
5
6
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
6
7
|
const basic_cfg_guided_visitor_1 = require("./basic-cfg-guided-visitor");
|
|
7
8
|
const assert_1 = require("../util/assert");
|
|
9
|
+
/**
|
|
10
|
+
* Fill in what a cfg-guided visitor can take from the control flow view itself: the dataflow graph it views,
|
|
11
|
+
* and the ast that graph knows. Pass either yourself to use a different one.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* new MyVisitor(cfgVisitorConfig({ controlFlow, defaultVisitingOrder: 'forward' }))
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function cfgVisitorConfig(config) {
|
|
18
|
+
const dfg = config.dfg ?? config.controlFlow.graph.dataflow();
|
|
19
|
+
(0, assert_1.guard)(dfg?.idMap !== undefined, 'pass the dataflow graph, this control flow graph is not a view of one');
|
|
20
|
+
return { ...config, dfg, normalizedAst: config.normalizedAst ?? { idMap: dfg.idMap } };
|
|
21
|
+
}
|
|
8
22
|
/**
|
|
9
23
|
* This visitor extends on the {@link BasicCfgGuidedVisitor} by dispatching visitors based on the dataflow graph.
|
|
10
24
|
*
|
|
@@ -19,24 +33,14 @@ class DataflowAwareCfgGuidedVisitor extends basic_cfg_guided_visitor_1.BasicCfgG
|
|
|
19
33
|
}
|
|
20
34
|
onStatementNode(node) {
|
|
21
35
|
super.onStatementNode(node);
|
|
22
|
-
|
|
23
|
-
this.visitDataflowNode(node);
|
|
24
|
-
}
|
|
36
|
+
this.visitDataflowNode(node);
|
|
25
37
|
}
|
|
26
38
|
onExpressionNode(node) {
|
|
27
39
|
super.onExpressionNode(node);
|
|
28
|
-
|
|
29
|
-
this.visitDataflowNode(node);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
onEndMarkerNode(node) {
|
|
33
|
-
super.onEndMarkerNode(node);
|
|
34
|
-
if (this.config.defaultVisitingType === 'exit') {
|
|
35
|
-
this.visitDataflowNode(node);
|
|
36
|
-
}
|
|
40
|
+
this.visitDataflowNode(node);
|
|
37
41
|
}
|
|
38
42
|
visitDataflowNode(node) {
|
|
39
|
-
const dfgVertex = this.getDataflowGraph(control_flow_graph_1.CfgVertex.
|
|
43
|
+
const dfgVertex = this.getDataflowGraph(control_flow_graph_1.CfgVertex.getId(node));
|
|
40
44
|
if (!dfgVertex) {
|
|
41
45
|
this.visitUnknown(node);
|
|
42
46
|
return;
|
package/control-flow/diff-cfg.js
CHANGED
|
@@ -67,20 +67,12 @@ function diffVertices(ctx) {
|
|
|
67
67
|
ctx.report.addComment(`Vertex ${id} differs in elems.\n ${ctx.leftname}: ${JSON.stringify(lElems)}\n vs\n ${ctx.rightname}: ${JSON.stringify(rElems)}`, { tag: 'vertex', id });
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
position: `${ctx.position}Vertex ${id} differs in attached end markers. `
|
|
77
|
-
});
|
|
78
|
-
const lRoot = control_flow_graph_1.CfgVertex.getRootId(lInfo);
|
|
79
|
-
const rRoot = control_flow_graph_1.CfgVertex.getRootId(rInfo);
|
|
80
|
-
if (lRoot !== rRoot) {
|
|
81
|
-
ctx.report.addComment(`Vertex ${id} differs in root. ${ctx.leftname}: ${JSON.stringify(lRoot)} vs ${ctx.rightname}: ${JSON.stringify(rRoot)}`, {
|
|
82
|
-
tag: 'vertex',
|
|
83
|
-
id
|
|
70
|
+
const lTargets = control_flow_graph_1.CfgVertex.getCallTargets(lInfo);
|
|
71
|
+
const rTargets = control_flow_graph_1.CfgVertex.getCallTargets(rInfo);
|
|
72
|
+
if (lTargets !== undefined || rTargets !== undefined) {
|
|
73
|
+
(0, diff_1.setDifference)(lTargets ?? new Set(), rTargets ?? new Set(), {
|
|
74
|
+
...ctx,
|
|
75
|
+
position: `${ctx.position}Vertex ${id} differs in call targets. `
|
|
84
76
|
});
|
|
85
77
|
}
|
|
86
78
|
(0, diff_1.setDifference)(new Set(control_flow_graph_1.CfgVertex.getChildren(lInfo)), new Set(control_flow_graph_1.CfgVertex.getChildren(rInfo)), {
|
|
@@ -8,7 +8,7 @@ const control_flow_graph_1 = require("./control-flow-graph");
|
|
|
8
8
|
*/
|
|
9
9
|
function happensBefore(cfg, a, b) {
|
|
10
10
|
const visited = new Set();
|
|
11
|
-
/* the first is the id we are currently at, the second one the
|
|
11
|
+
/* the first is the id we are currently at, the second one the vertex the current largest cd scope joins on */
|
|
12
12
|
const stack = [[b, undefined]];
|
|
13
13
|
while (stack.length > 0) {
|
|
14
14
|
const [current, cd] = stack.pop();
|
|
@@ -23,9 +23,10 @@ function happensBefore(cfg, a, b) {
|
|
|
23
23
|
useCd = undefined;
|
|
24
24
|
}
|
|
25
25
|
visited.add(current);
|
|
26
|
-
for (const [id, t] of cfg.
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
for (const [id, t] of cfg.ingoingEdges(current) ?? []) {
|
|
27
|
+
/* the vertex that caused the branch is where its arms join again, so it closes the scope */
|
|
28
|
+
const joinsAt = control_flow_graph_1.CfgEdge.isControlDependency(t) ? control_flow_graph_1.CfgEdge.unpackCause(t) : useCd;
|
|
29
|
+
stack.push([id, useCd ?? joinsAt]);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
return logic_1.Ternary.Never;
|
|
@@ -11,7 +11,7 @@ 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
|
|
14
|
+
import { RExpressionList } from '../r-bridge/lang-4.x/ast/model/nodes/r-expression-list';
|
|
15
15
|
import type { ReadOnlyFlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
16
16
|
import { RNull } from '../r-bridge/lang-4.x/convert-values';
|
|
17
17
|
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
@@ -41,6 +41,13 @@ export interface SemanticCfgGuidedVisitorConfiguration<OtherInfo = NoInfo, Contr
|
|
|
41
41
|
*
|
|
42
42
|
* Use {@link BasicCfgGuidedVisitor#start} to start the traversal.
|
|
43
43
|
*/
|
|
44
|
+
/**
|
|
45
|
+
* What every `on...Call` hook of the {@link SemanticCfgGuidedVisitor} receives: the call vertex it fired for.
|
|
46
|
+
* Hooks that recognize more of the call's shape extend this with the parts they resolved.
|
|
47
|
+
*/
|
|
48
|
+
export interface OnCall {
|
|
49
|
+
readonly call: DataflowGraphVertexFunctionCall;
|
|
50
|
+
}
|
|
44
51
|
export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow extends ControlFlowInformation = ControlFlowInformation, Ast extends NormalizedAst<OtherInfo> = NormalizedAst<OtherInfo>, Dfg extends DataflowGraph = DataflowGraph, Config extends SemanticCfgGuidedVisitorConfiguration<OtherInfo, ControlFlow, Ast, Dfg> = SemanticCfgGuidedVisitorConfiguration<OtherInfo, ControlFlow, Ast, Dfg>> extends DataflowAwareCfgGuidedVisitor<ControlFlow, Dfg, Config> {
|
|
45
52
|
/**
|
|
46
53
|
* A helper function to get the normalized AST node for the given id or fail if it does not exist.
|
|
@@ -50,9 +57,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
50
57
|
* The logical the call's only argument resolves to, `undefined` if the call does not take exactly one
|
|
51
58
|
* argument or if that argument does not resolve to a single logical.
|
|
52
59
|
*/
|
|
53
|
-
protected getBoolArgValue(data:
|
|
54
|
-
call: DataflowGraphVertexFunctionCall;
|
|
55
|
-
}): boolean | undefined;
|
|
60
|
+
protected getBoolArgValue(data: OnCall): boolean | undefined;
|
|
56
61
|
/**
|
|
57
62
|
* See {@link DataflowAwareCfgGuidedVisitor#visitValue} for the base implementation.
|
|
58
63
|
* This now dispatches the value to the appropriate event handler based on its type.
|
|
@@ -212,9 +217,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
212
217
|
* to rely on {@link SemanticCfgGuidedVisitor#getOrigins|`getOrigins`} to get more information.
|
|
213
218
|
* @protected
|
|
214
219
|
*/
|
|
215
|
-
protected onUnnamedCall(_data:
|
|
216
|
-
call: DataflowGraphVertexFunctionCall;
|
|
217
|
-
}): void;
|
|
220
|
+
protected onUnnamedCall(_data: OnCall): void;
|
|
218
221
|
/**
|
|
219
222
|
* This event triggers for every function call that is not handled by a specific overload,
|
|
220
223
|
* and hence may be a function that targets a user-defined function. In a way, these are functions that are named,
|
|
@@ -234,9 +237,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
234
237
|
* The main reason for this separation is part of flowR's handling of these functions, as anonymous calls cannot be resolved using the active environment.
|
|
235
238
|
* @protected
|
|
236
239
|
*/
|
|
237
|
-
protected onDefaultFunctionCall(_data:
|
|
238
|
-
call: DataflowGraphVertexFunctionCall;
|
|
239
|
-
}): void;
|
|
240
|
+
protected onDefaultFunctionCall(_data: OnCall): void;
|
|
240
241
|
/**
|
|
241
242
|
* This event triggers for every call to the `eval` function.
|
|
242
243
|
*
|
|
@@ -245,9 +246,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
245
246
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
246
247
|
* @protected
|
|
247
248
|
*/
|
|
248
|
-
protected onEvalFunctionCall(_data:
|
|
249
|
-
call: DataflowGraphVertexFunctionCall;
|
|
250
|
-
}): void;
|
|
249
|
+
protected onEvalFunctionCall(_data: OnCall): void;
|
|
251
250
|
/**
|
|
252
251
|
* This event triggers for every call to any of the `*apply` functions.
|
|
253
252
|
*
|
|
@@ -256,9 +255,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
256
255
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
257
256
|
* @protected
|
|
258
257
|
*/
|
|
259
|
-
protected onApplyFunctionCall(_data:
|
|
260
|
-
call: DataflowGraphVertexFunctionCall;
|
|
261
|
-
}): void;
|
|
258
|
+
protected onApplyFunctionCall(_data: OnCall): void;
|
|
262
259
|
/**
|
|
263
260
|
* This event triggers for every expression list - implicit or explicit, _but_ not for the root program (see {@link SemanticCfgGuidedVisitor#onProgram|`onProgram`} for that).
|
|
264
261
|
*
|
|
@@ -266,9 +263,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
266
263
|
* expression list `x <- x + 1` in `for(x in 1:10) x <- x + 1`.
|
|
267
264
|
* @protected
|
|
268
265
|
*/
|
|
269
|
-
protected onExpressionList(_data:
|
|
270
|
-
call: DataflowGraphVertexFunctionCall;
|
|
271
|
-
}): void;
|
|
266
|
+
protected onExpressionList(_data: OnCall): void;
|
|
272
267
|
/**
|
|
273
268
|
* This event triggers for every call to the `source` function.
|
|
274
269
|
*
|
|
@@ -279,22 +274,17 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
279
274
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
280
275
|
* @protected
|
|
281
276
|
*/
|
|
282
|
-
protected onSourceCall(_data:
|
|
283
|
-
call: DataflowGraphVertexFunctionCall;
|
|
284
|
-
}): void;
|
|
277
|
+
protected onSourceCall(_data: OnCall): void;
|
|
285
278
|
/**
|
|
286
279
|
* This event triggers for every subsetting call, i.e., for every call to `[[`, `[`, or `$`.
|
|
287
280
|
* @protected
|
|
288
281
|
*/
|
|
289
|
-
protected onAccessCall(_data:
|
|
290
|
-
call: DataflowGraphVertexFunctionCall;
|
|
291
|
-
}): void;
|
|
282
|
+
protected onAccessCall(_data: OnCall): void;
|
|
292
283
|
/**
|
|
293
284
|
* This event triggers for every call to the `if` function, which is used to implement the `if-then-else` control flow.
|
|
294
285
|
* @protected
|
|
295
286
|
*/
|
|
296
|
-
protected onIfThenElseCall(_data: {
|
|
297
|
-
call: DataflowGraphVertexFunctionCall;
|
|
287
|
+
protected onIfThenElseCall(_data: OnCall & {
|
|
298
288
|
condition: NodeId | undefined;
|
|
299
289
|
yes: NodeId | undefined;
|
|
300
290
|
no: NodeId | undefined;
|
|
@@ -308,18 +298,14 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
308
298
|
* this may very well trigger a {@link SemanticCfgGuidedVisitor#onVariableUse|`onVariableUse`} event as well.
|
|
309
299
|
* @protected
|
|
310
300
|
*/
|
|
311
|
-
protected onGetCall(_data:
|
|
312
|
-
call: DataflowGraphVertexFunctionCall;
|
|
313
|
-
}): void;
|
|
301
|
+
protected onGetCall(_data: OnCall): void;
|
|
314
302
|
/**
|
|
315
303
|
* This event triggers for every call to the `rm` function, which is used to remove variables from the environment.
|
|
316
304
|
*
|
|
317
305
|
* For example, `rm` in `rm(x)`.
|
|
318
306
|
* @protected
|
|
319
307
|
*/
|
|
320
|
-
protected onRmCall(_data:
|
|
321
|
-
call: DataflowGraphVertexFunctionCall;
|
|
322
|
-
}): void;
|
|
308
|
+
protected onRmCall(_data: OnCall): void;
|
|
323
309
|
/**
|
|
324
310
|
* This event triggers for every call to a function which loads a library.
|
|
325
311
|
*
|
|
@@ -328,9 +314,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
328
314
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
329
315
|
* @protected
|
|
330
316
|
*/
|
|
331
|
-
protected onLibraryCall(_data:
|
|
332
|
-
call: DataflowGraphVertexFunctionCall;
|
|
333
|
-
}): void;
|
|
317
|
+
protected onLibraryCall(_data: OnCall): void;
|
|
334
318
|
/**
|
|
335
319
|
* This event triggers for every assignment call, i.e., for every call to `<-` or `=` that assigns a value to a variable.
|
|
336
320
|
*
|
|
@@ -340,8 +324,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
340
324
|
* Please be aware that replacements (e.g. assignments with a function call on the target side) like `names(x) <- 3` are subject to {@link SemanticCfgGuidedVisitor#onReplacementCall|`onReplacementCall`} instead.
|
|
341
325
|
* @protected
|
|
342
326
|
*/
|
|
343
|
-
protected onAssignmentCall(_data: {
|
|
344
|
-
call: DataflowGraphVertexFunctionCall;
|
|
327
|
+
protected onAssignmentCall(_data: OnCall & {
|
|
345
328
|
target?: NodeId;
|
|
346
329
|
source?: NodeId;
|
|
347
330
|
}): void;
|
|
@@ -353,8 +336,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
353
336
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
354
337
|
* @protected
|
|
355
338
|
*/
|
|
356
|
-
protected onSpecialBinaryOpCall(_data: {
|
|
357
|
-
call: DataflowGraphVertexFunctionCall;
|
|
339
|
+
protected onSpecialBinaryOpCall(_data: OnCall & {
|
|
358
340
|
lhs?: FunctionArgument;
|
|
359
341
|
rhs?: FunctionArgument;
|
|
360
342
|
}): void;
|
|
@@ -362,8 +344,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
362
344
|
* This event triggers for every call to R's pipe operator, i.e., for every call to `|>`.
|
|
363
345
|
* @protected
|
|
364
346
|
*/
|
|
365
|
-
protected onPipeCall(_data: {
|
|
366
|
-
call: DataflowGraphVertexFunctionCall;
|
|
347
|
+
protected onPipeCall(_data: OnCall & {
|
|
367
348
|
lhs?: FunctionArgument;
|
|
368
349
|
rhs?: FunctionArgument;
|
|
369
350
|
}): void;
|
|
@@ -375,9 +356,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
375
356
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
376
357
|
* @protected
|
|
377
358
|
*/
|
|
378
|
-
protected onQuoteCall(_data:
|
|
379
|
-
call: DataflowGraphVertexFunctionCall;
|
|
380
|
-
}): void;
|
|
359
|
+
protected onQuoteCall(_data: OnCall): void;
|
|
381
360
|
/**
|
|
382
361
|
* This event triggers for every call to the `for` loop function, which is used to implement the `for` loop control flow.
|
|
383
362
|
*
|
|
@@ -386,8 +365,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
386
365
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
387
366
|
* @protected
|
|
388
367
|
*/
|
|
389
|
-
protected onForLoopCall(_data: {
|
|
390
|
-
call: DataflowGraphVertexFunctionCall;
|
|
368
|
+
protected onForLoopCall(_data: OnCall & {
|
|
391
369
|
variable: FunctionArgument;
|
|
392
370
|
vector: FunctionArgument;
|
|
393
371
|
body: FunctionArgument;
|
|
@@ -400,8 +378,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
400
378
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
401
379
|
* @protected
|
|
402
380
|
*/
|
|
403
|
-
protected onWhileLoopCall(_data: {
|
|
404
|
-
call: DataflowGraphVertexFunctionCall;
|
|
381
|
+
protected onWhileLoopCall(_data: OnCall & {
|
|
405
382
|
condition: FunctionArgument;
|
|
406
383
|
body: FunctionArgument;
|
|
407
384
|
}): void;
|
|
@@ -413,8 +390,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
413
390
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
414
391
|
* @protected
|
|
415
392
|
*/
|
|
416
|
-
protected onRepeatLoopCall(_data: {
|
|
417
|
-
call: DataflowGraphVertexFunctionCall;
|
|
393
|
+
protected onRepeatLoopCall(_data: OnCall & {
|
|
418
394
|
body: FunctionArgument;
|
|
419
395
|
}): void;
|
|
420
396
|
/**
|
|
@@ -428,8 +404,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
428
404
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
429
405
|
* @protected
|
|
430
406
|
*/
|
|
431
|
-
protected onReplacementCall(_data: {
|
|
432
|
-
call: DataflowGraphVertexFunctionCall;
|
|
407
|
+
protected onReplacementCall(_data: OnCall & {
|
|
433
408
|
source: NodeId | undefined;
|
|
434
409
|
target: NodeId | undefined;
|
|
435
410
|
}): void;
|
|
@@ -441,9 +416,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
441
416
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
442
417
|
* @protected
|
|
443
418
|
*/
|
|
444
|
-
protected onListCall(_data:
|
|
445
|
-
call: DataflowGraphVertexFunctionCall;
|
|
446
|
-
}): void;
|
|
419
|
+
protected onListCall(_data: OnCall): void;
|
|
447
420
|
/**
|
|
448
421
|
* This event triggers for every call that (to the knowledge of flowr) constructs a (new) vector.
|
|
449
422
|
*
|
|
@@ -452,9 +425,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
452
425
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
453
426
|
* @protected
|
|
454
427
|
*/
|
|
455
|
-
protected onVectorCall(_data:
|
|
456
|
-
call: DataflowGraphVertexFunctionCall;
|
|
457
|
-
}): void;
|
|
428
|
+
protected onVectorCall(_data: OnCall): void;
|
|
458
429
|
/**
|
|
459
430
|
* This event triggers for every call to the `stop` function.
|
|
460
431
|
*
|
|
@@ -463,9 +434,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
463
434
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
464
435
|
* @protected
|
|
465
436
|
*/
|
|
466
|
-
protected onStopCall(_data:
|
|
467
|
-
call: DataflowGraphVertexFunctionCall;
|
|
468
|
-
}): void;
|
|
437
|
+
protected onStopCall(_data: OnCall): void;
|
|
469
438
|
/**
|
|
470
439
|
* This event triggers for every call to the `stopifnot` function.
|
|
471
440
|
*
|
|
@@ -474,9 +443,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
474
443
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
475
444
|
* @protected
|
|
476
445
|
*/
|
|
477
|
-
protected onStopIfNotCall(_data:
|
|
478
|
-
call: DataflowGraphVertexFunctionCall;
|
|
479
|
-
}): void;
|
|
446
|
+
protected onStopIfNotCall(_data: OnCall): void;
|
|
480
447
|
/**
|
|
481
448
|
* This event triggers for every call the `try` function, which is used to catch possible errors.
|
|
482
449
|
*
|
|
@@ -485,9 +452,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
485
452
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
486
453
|
* @protected
|
|
487
454
|
*/
|
|
488
|
-
protected onTryCall(_data:
|
|
489
|
-
call: DataflowGraphVertexFunctionCall;
|
|
490
|
-
}): void;
|
|
455
|
+
protected onTryCall(_data: OnCall): void;
|
|
491
456
|
/**
|
|
492
457
|
* This event triggers for every call to a function that performs a local call, such as `local`.
|
|
493
458
|
*
|
|
@@ -496,9 +461,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
496
461
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
497
462
|
* @protected
|
|
498
463
|
*/
|
|
499
|
-
protected onLocalCall(_data:
|
|
500
|
-
call: DataflowGraphVertexFunctionCall;
|
|
501
|
-
}): void;
|
|
464
|
+
protected onLocalCall(_data: OnCall): void;
|
|
502
465
|
/**
|
|
503
466
|
* This event triggers for every call to a function that performs an S3-like dispatch.
|
|
504
467
|
*
|
|
@@ -506,9 +469,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
506
469
|
* @see {@link SemanticCfgGuidedVisitor#onS3DispatchNextCall|`onS3DispatchNextCall`} for `NextMethod` calls.
|
|
507
470
|
* @protected
|
|
508
471
|
*/
|
|
509
|
-
protected onS3DispatchCall(_data:
|
|
510
|
-
call: DataflowGraphVertexFunctionCall;
|
|
511
|
-
}): void;
|
|
472
|
+
protected onS3DispatchCall(_data: OnCall): void;
|
|
512
473
|
/**
|
|
513
474
|
* This event triggers for every call to a function that performs an S3-like *next* dispatch.
|
|
514
475
|
*
|
|
@@ -516,23 +477,17 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
516
477
|
* @see {@link SemanticCfgGuidedVisitor#onS3DispatchCall|`onS3DispatchCall`} for `UseMethod` calls.
|
|
517
478
|
* @protected
|
|
518
479
|
*/
|
|
519
|
-
protected onS3DispatchNextCall(_data:
|
|
520
|
-
call: DataflowGraphVertexFunctionCall;
|
|
521
|
-
}): void;
|
|
480
|
+
protected onS3DispatchNextCall(_data: OnCall): void;
|
|
522
481
|
/**
|
|
523
482
|
* This event triggers for every call to a function that creates a new S7 generic, such as `new_generic`.
|
|
524
483
|
* @protected
|
|
525
484
|
*/
|
|
526
|
-
protected onS7NewGenericCall(_data:
|
|
527
|
-
call: DataflowGraphVertexFunctionCall;
|
|
528
|
-
}): void;
|
|
485
|
+
protected onS7NewGenericCall(_data: OnCall): void;
|
|
529
486
|
/**
|
|
530
487
|
* This event triggers for every call to a function that performs an S7 dispatch, such as `S7_dispatch`.
|
|
531
488
|
* @protected
|
|
532
489
|
*/
|
|
533
|
-
protected onS7DispatchCall(_data:
|
|
534
|
-
call: DataflowGraphVertexFunctionCall;
|
|
535
|
-
}): void;
|
|
490
|
+
protected onS7DispatchCall(_data: OnCall): void;
|
|
536
491
|
/**
|
|
537
492
|
* This event triggers for every call to a function that registers a hook, such as `on.exit`.
|
|
538
493
|
*
|
|
@@ -541,9 +496,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
541
496
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
542
497
|
* @protected
|
|
543
498
|
*/
|
|
544
|
-
protected onRegisterHookCall(_data:
|
|
545
|
-
call: DataflowGraphVertexFunctionCall;
|
|
546
|
-
}): void;
|
|
499
|
+
protected onRegisterHookCall(_data: OnCall): void;
|
|
547
500
|
/**
|
|
548
501
|
* This event triggers for every call to `break` to exit a loop.
|
|
549
502
|
*
|
|
@@ -552,9 +505,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
552
505
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
553
506
|
* @protected
|
|
554
507
|
*/
|
|
555
|
-
protected onBreakCall(_data:
|
|
556
|
-
call: DataflowGraphVertexFunctionCall;
|
|
557
|
-
}): void;
|
|
508
|
+
protected onBreakCall(_data: OnCall): void;
|
|
558
509
|
/**
|
|
559
510
|
* This event triggers for every call to `return` to explicitly return a value in a function.
|
|
560
511
|
*
|
|
@@ -563,27 +514,19 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
563
514
|
* More specifically, this relates to the corresponding {@link BuiltInProcessorMapper} handler.
|
|
564
515
|
* @protected
|
|
565
516
|
*/
|
|
566
|
-
protected onReturnCall(_data:
|
|
567
|
-
call: DataflowGraphVertexFunctionCall;
|
|
568
|
-
}): void;
|
|
517
|
+
protected onReturnCall(_data: OnCall): void;
|
|
569
518
|
/**
|
|
570
519
|
* This event triggers for every call to `Recall`, which is used to recall the function closure (usually in recursive functions).
|
|
571
520
|
* @protected
|
|
572
521
|
*/
|
|
573
|
-
protected onRecallCall(_data:
|
|
574
|
-
call: DataflowGraphVertexFunctionCall;
|
|
575
|
-
}): void;
|
|
522
|
+
protected onRecallCall(_data: OnCall): void;
|
|
576
523
|
/**
|
|
577
524
|
* This event triggers for any purr formula as in `map(df, ~ .x + 1)`
|
|
578
525
|
*/
|
|
579
|
-
protected onPurrFormulaCall(_data:
|
|
580
|
-
call: DataflowGraphVertexFunctionCall;
|
|
581
|
-
}): void;
|
|
526
|
+
protected onPurrFormulaCall(_data: OnCall): void;
|
|
582
527
|
protected getSourceAndTarget(call: DataflowGraphVertexFunctionCall): {
|
|
583
528
|
target: NodeId | undefined;
|
|
584
529
|
source: NodeId | undefined;
|
|
585
530
|
};
|
|
586
|
-
protected onLoadCall(_param:
|
|
587
|
-
call: DataflowGraphVertexFunctionCall;
|
|
588
|
-
}): void;
|
|
531
|
+
protected onLoadCall(_param: OnCall): void;
|
|
589
532
|
}
|
|
@@ -6,35 +6,15 @@ const dfg_cfg_guided_visitor_1 = require("./dfg-cfg-guided-visitor");
|
|
|
6
6
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
7
7
|
const edge_1 = require("../dataflow/graph/edge");
|
|
8
8
|
const assert_1 = require("../util/assert");
|
|
9
|
+
const r_expression_list_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-expression-list");
|
|
9
10
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
10
11
|
const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
|
|
11
12
|
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
12
13
|
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
13
14
|
const node_value_1 = require("../dataflow/eval/resolve/node-value");
|
|
14
15
|
const r_value_1 = require("../dataflow/eval/values/r-value");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* providing more information!
|
|
18
|
-
* In a way, this is the mixin of syntactic and dataflow guided visitation.
|
|
19
|
-
*
|
|
20
|
-
* Overwrite the functions starting with `on` to implement your logic.
|
|
21
|
-
* In general, there is just one special case that you need to be aware of:
|
|
22
|
-
*
|
|
23
|
-
* In the context of a function call, flowR may be unsure to which origin the call relates!
|
|
24
|
-
* Consider the following example:
|
|
25
|
-
*
|
|
26
|
-
* ```r
|
|
27
|
-
* if(u) foo <- library else foo <- rm
|
|
28
|
-
* foo(x)
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* Obtaining the origins of the call to `foo` will return both built-in functions `library` and `rm`.
|
|
32
|
-
* The general semantic visitor cannot decide on how to combine these cases,
|
|
33
|
-
* and it is up to your overload of {@link SemanticCfgGuidedVisitor#onDispatchFunctionCallOrigins|onDispatchFunctionCallOrigins}
|
|
34
|
-
* to decide how to handle this.
|
|
35
|
-
*
|
|
36
|
-
* Use {@link BasicCfgGuidedVisitor#start} to start the traversal.
|
|
37
|
-
*/
|
|
16
|
+
const r_function_definition_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
17
|
+
const r_if_then_else_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-if-then-else");
|
|
38
18
|
class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfgGuidedVisitor {
|
|
39
19
|
/**
|
|
40
20
|
* A helper function to get the normalized AST node for the given id or fail if it does not exist.
|
|
@@ -112,7 +92,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
112
92
|
visitFunctionDefinition(vertex) {
|
|
113
93
|
super.visitFunctionDefinition(vertex);
|
|
114
94
|
const ast = this.getNormalizedAst(vertex.id);
|
|
115
|
-
if (
|
|
95
|
+
if (r_function_definition_1.RFunctionDefinition.is(ast)) {
|
|
116
96
|
this.onFunctionDefinition({ vertex, parameters: ast.parameters.map(p => p.info.id) });
|
|
117
97
|
}
|
|
118
98
|
else {
|
|
@@ -147,7 +127,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
147
127
|
visitUnknown(vertex) {
|
|
148
128
|
super.visitUnknown(vertex);
|
|
149
129
|
const ast = this.getNormalizedAst(control_flow_graph_1.CfgVertex.getId(vertex));
|
|
150
|
-
if (ast &&
|
|
130
|
+
if (ast && r_expression_list_1.RExpressionList.is(ast) && ast.info.parent === undefined) {
|
|
151
131
|
this.onProgram(ast);
|
|
152
132
|
}
|
|
153
133
|
}
|
|
@@ -186,7 +166,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
186
166
|
case built_in_proc_name_1.BuiltInProcName.IfThenElse: {
|
|
187
167
|
// recover dead arguments from ast
|
|
188
168
|
const ast = this.getNormalizedAst(call.id);
|
|
189
|
-
if (!ast ||
|
|
169
|
+
if (!ast || !r_if_then_else_1.RIfThenElse.is(ast)) {
|
|
190
170
|
return this.onIfThenElseCall({
|
|
191
171
|
call,
|
|
192
172
|
condition: call.args[0] === r_function_call_1.EmptyArgument ? undefined : call.args[0].nodeId,
|
|
@@ -32,17 +32,13 @@ visitor) {
|
|
|
32
32
|
else if (hasBb) {
|
|
33
33
|
const get = graph.getVertex(current);
|
|
34
34
|
if (control_flow_graph_1.CfgVertex.isBlock(get)) {
|
|
35
|
-
const
|
|
36
|
-
for (const e of elems.toReversed()) {
|
|
35
|
+
for (const e of control_flow_graph_1.CfgVertex.getBasicBlockElements(get)) {
|
|
37
36
|
queue.push(control_flow_graph_1.CfgVertex.getId(e));
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
for (const c of incoming.keys()) {
|
|
44
|
-
queue.push(c);
|
|
45
|
-
}
|
|
40
|
+
for (const c of graph.predecessors(current)) {
|
|
41
|
+
queue.push(c);
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
44
|
}
|
|
@@ -70,17 +66,20 @@ visitor) {
|
|
|
70
66
|
if (visitor(current)) {
|
|
71
67
|
continue;
|
|
72
68
|
}
|
|
73
|
-
else
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
else {
|
|
70
|
+
if (hasBb) {
|
|
71
|
+
const get = graph.getVertex(current);
|
|
72
|
+
if (control_flow_graph_1.CfgVertex.isBlock(get)) {
|
|
73
|
+
for (const e of control_flow_graph_1.CfgVertex.getBasicBlockElements(get)) {
|
|
74
|
+
queue.enqueue(control_flow_graph_1.CfgVertex.getId(e));
|
|
75
|
+
}
|
|
79
76
|
}
|
|
80
77
|
}
|
|
78
|
+
for (const child of graph.childrenOf(current) ?? control_flow_graph_1.NoNeighbors) {
|
|
79
|
+
queue.enqueue(child);
|
|
80
|
+
}
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
for (const [to] of outgoing) {
|
|
82
|
+
for (const to of graph.successors(current)) {
|
|
84
83
|
queue.enqueue(to);
|
|
85
84
|
}
|
|
86
85
|
}
|
|
@@ -25,7 +25,8 @@ import type { RNumber } from '../r-bridge/lang-4.x/ast/model/nodes/r-number';
|
|
|
25
25
|
import type { RSymbol } from '../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
26
26
|
import type { NoInfo, RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
27
27
|
export interface SyntaxCfgGuidedVisitorConfiguration<OtherInfo = NoInfo, ControlFlow extends ControlFlowInformation = ControlFlowInformation, Ast extends NormalizedAst<OtherInfo> = NormalizedAst<OtherInfo>> extends BasicCfgGuidedVisitorConfiguration<ControlFlow> {
|
|
28
|
-
|
|
28
|
+
/** the ast the vertices refer to; only the id map is used, so {@link cfgVisitorConfig} can take it from the dataflow graph */
|
|
29
|
+
readonly normalizedAst: Pick<Ast, 'idMap'>;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* This visitor extends on the {@link BasicCfgGuidedVisitor} by dispatching visitors based on the AST type of the node.
|