@eagleoutice/flowr 2.6.1 → 2.6.3
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 +142 -39
- package/abstract-interpretation/data-frame/absint-info.d.ts +1 -1
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +2 -3
- package/abstract-interpretation/data-frame/absint-visitor.js +17 -12
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +18 -12
- package/abstract-interpretation/data-frame/dataframe-domain.js +25 -13
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -1
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -10
- package/abstract-interpretation/data-frame/mappers/arguments.js +0 -7
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +0 -1
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +0 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +9 -10
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +21 -18
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -1
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -1
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
- package/abstract-interpretation/data-frame/semantics.d.ts +3 -4
- package/abstract-interpretation/data-frame/semantics.js +179 -162
- package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -7
- package/abstract-interpretation/data-frame/shape-inference.js +10 -12
- package/abstract-interpretation/domains/abstract-domain.d.ts +59 -18
- package/abstract-interpretation/domains/abstract-domain.js +74 -1
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +37 -24
- package/abstract-interpretation/domains/bounded-set-domain.js +70 -47
- package/abstract-interpretation/domains/interval-domain.d.ts +33 -25
- package/abstract-interpretation/domains/interval-domain.js +109 -50
- package/abstract-interpretation/domains/lattice.d.ts +19 -11
- package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +34 -0
- package/abstract-interpretation/domains/mapped-abstract-domain.js +189 -0
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +16 -12
- package/abstract-interpretation/domains/positive-interval-domain.js +20 -11
- package/abstract-interpretation/domains/product-domain.d.ts +18 -23
- package/abstract-interpretation/domains/product-domain.js +11 -19
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +29 -0
- package/abstract-interpretation/domains/satisfiable-domain.js +24 -0
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +54 -0
- package/abstract-interpretation/domains/set-upper-bound-domain.js +197 -0
- package/abstract-interpretation/domains/singleton-domain.d.ts +24 -19
- package/abstract-interpretation/domains/singleton-domain.js +52 -37
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +8 -24
- package/abstract-interpretation/domains/state-abstract-domain.js +2 -167
- package/abstract-interpretation/normalized-ast-fold.d.ts +2 -8
- package/abstract-interpretation/normalized-ast-fold.js +0 -5
- package/benchmark/slicer.d.ts +4 -7
- package/benchmark/slicer.js +27 -31
- package/benchmark/stats/print.d.ts +6 -0
- package/benchmark/stats/print.js +6 -0
- package/benchmark/stats/size-of.d.ts +0 -1
- package/benchmark/stats/size-of.js +0 -1
- package/benchmark/stats/stats.d.ts +2 -2
- package/benchmark/stopwatch.d.ts +11 -13
- package/benchmark/stopwatch.js +11 -13
- package/benchmark/summarizer/first-phase/input.d.ts +6 -0
- package/benchmark/summarizer/first-phase/input.js +6 -0
- package/benchmark/summarizer/first-phase/process.d.ts +13 -1
- package/benchmark/summarizer/first-phase/process.js +13 -1
- package/benchmark/summarizer/second-phase/graph.d.ts +5 -0
- package/benchmark/summarizer/second-phase/graph.js +5 -0
- package/benchmark/summarizer/second-phase/process.d.ts +12 -0
- package/benchmark/summarizer/second-phase/process.js +12 -0
- package/benchmark/summarizer/summarizer.d.ts +1 -2
- package/cli/benchmark-app.js +0 -2
- package/cli/common/features.d.ts +7 -1
- package/cli/common/features.js +6 -0
- package/cli/common/script.d.ts +3 -1
- package/cli/common/script.js +3 -1
- package/cli/common/scripts-info.d.ts +3 -1
- package/cli/common/scripts-info.js +3 -0
- package/cli/export-quads-app.js +1 -1
- package/cli/flowr-main-options.d.ts +3 -0
- package/cli/flowr-main-options.js +3 -0
- package/cli/repl/commands/repl-commands.d.ts +13 -0
- package/cli/repl/commands/repl-commands.js +13 -2
- package/cli/repl/commands/repl-dataflow.js +2 -1
- package/cli/repl/commands/repl-execute.d.ts +4 -0
- package/cli/repl/commands/repl-execute.js +6 -2
- package/cli/repl/commands/repl-main.d.ts +15 -9
- package/cli/repl/commands/repl-parse.js +18 -6
- package/cli/repl/commands/repl-query.js +16 -5
- package/cli/repl/core.d.ts +24 -6
- package/cli/repl/core.js +42 -30
- package/cli/repl/execute.d.ts +0 -2
- package/cli/repl/execute.js +0 -2
- package/cli/repl/parser/slice-query-parser.d.ts +14 -0
- package/cli/repl/parser/slice-query-parser.js +34 -0
- package/cli/repl/print-version.d.ts +6 -0
- package/cli/repl/print-version.js +6 -0
- package/cli/repl/server/compact.d.ts +8 -0
- package/cli/repl/server/compact.js +8 -0
- package/cli/repl/server/connection.d.ts +4 -3
- package/cli/repl/server/connection.js +5 -32
- package/cli/repl/server/messages/all-messages.d.ts +1 -3
- package/cli/repl/server/messages/all-messages.js +0 -1
- package/cli/repl/server/messages/message-analysis.d.ts +0 -2
- package/cli/repl/server/messages/message-query.d.ts +1 -1
- package/cli/repl/server/messages/message-repl.d.ts +0 -1
- package/cli/repl/server/send.d.ts +6 -0
- package/cli/repl/server/send.js +6 -0
- package/cli/repl/server/server.d.ts +1 -1
- package/cli/repl/server/validate.d.ts +10 -1
- package/cli/repl/server/validate.js +9 -0
- package/cli/run-script.d.ts +1 -2
- package/cli/run-script.js +0 -1
- package/cli/script-core/statistics-core.d.ts +3 -0
- package/cli/script-core/statistics-core.js +3 -0
- package/cli/script-core/statistics-helper-core.d.ts +4 -1
- package/cli/script-core/statistics-helper-core.js +5 -1
- package/cli/script-core/summarizer-core.d.ts +3 -0
- package/cli/script-core/summarizer-core.js +3 -0
- package/cli/slicer-app.js +3 -4
- package/cli/summarizer-app.d.ts +2 -3
- package/cli/summarizer-app.js +2 -3
- package/cli/wiki.d.ts +4 -0
- package/cli/wiki.js +165 -0
- package/config.d.ts +21 -3
- package/config.js +21 -0
- package/control-flow/basic-cfg-guided-visitor.d.ts +1 -2
- package/control-flow/basic-cfg-guided-visitor.js +0 -1
- package/control-flow/cfg-dead-code.js +13 -3
- package/control-flow/cfg-simplification.d.ts +5 -2
- package/control-flow/cfg-simplification.js +3 -0
- package/control-flow/cfg-to-basic-blocks.d.ts +1 -1
- package/control-flow/control-flow-graph.d.ts +20 -12
- package/control-flow/control-flow-graph.js +16 -4
- package/control-flow/dfg-cfg-guided-visitor.d.ts +2 -3
- package/control-flow/diff-cfg.d.ts +3 -5
- package/control-flow/diff-cfg.js +0 -1
- package/control-flow/extract-cfg.d.ts +12 -9
- package/control-flow/extract-cfg.js +44 -7
- package/control-flow/happens-before.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +4 -33
- package/control-flow/semantic-cfg-guided-visitor.js +0 -28
- package/control-flow/simple-visitor.d.ts +1 -3
- package/control-flow/simple-visitor.js +2 -4
- package/control-flow/syntax-cfg-guided-visitor.d.ts +1 -2
- package/control-flow/useless-loop.d.ts +3 -6
- package/control-flow/useless-loop.js +16 -10
- package/core/pipeline-executor.d.ts +11 -22
- package/core/pipeline-executor.js +13 -25
- package/core/print/dataflow-printer.d.ts +19 -0
- package/core/print/dataflow-printer.js +19 -0
- package/core/print/normalize-printer.d.ts +21 -1
- package/core/print/normalize-printer.js +21 -1
- package/core/print/parse-printer.d.ts +6 -1
- package/core/print/parse-printer.js +5 -0
- package/core/print/print.d.ts +0 -1
- package/core/print/print.js +0 -1
- package/core/print/slice-diff-ansi.d.ts +3 -0
- package/core/print/slice-diff-ansi.js +3 -0
- package/core/steps/all/core/00-parse.d.ts +2 -2
- package/core/steps/all/core/00-parse.js +1 -1
- package/core/steps/all/core/01-parse-tree-sitter.d.ts +1 -11
- package/core/steps/all/core/10-normalize.d.ts +3 -6
- package/core/steps/all/core/10-normalize.js +1 -13
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +5 -5
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -3
- package/core/steps/all/core/20-dataflow.d.ts +3 -4
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +1 -2
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +8 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +4 -1
- package/core/steps/pipeline/create-pipeline.d.ts +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +94 -95
- package/core/steps/pipeline/default-pipelines.js +8 -12
- package/core/steps/pipeline/pipeline.d.ts +1 -8
- package/core/steps/pipeline/pipeline.js +1 -3
- package/core/steps/pipeline-step.d.ts +0 -1
- package/core/steps/pipeline-step.js +0 -1
- package/dataflow/cluster.d.ts +3 -0
- package/dataflow/cluster.js +3 -0
- package/dataflow/environments/append.d.ts +1 -1
- package/dataflow/environments/built-in-config.d.ts +1 -5
- package/dataflow/environments/built-in-config.js +0 -1
- package/dataflow/environments/built-in.d.ts +10 -5
- package/dataflow/environments/built-in.js +6 -1
- package/dataflow/environments/clone.d.ts +1 -2
- package/dataflow/environments/clone.js +12 -2
- package/dataflow/environments/default-builtin-config.d.ts +3 -0
- package/dataflow/environments/default-builtin-config.js +4 -1
- package/dataflow/environments/diff.d.ts +11 -2
- package/dataflow/environments/diff.js +11 -2
- package/dataflow/environments/environment.d.ts +3 -3
- package/dataflow/environments/environment.js +8 -6
- package/dataflow/environments/identifier.d.ts +0 -4
- package/dataflow/environments/identifier.js +0 -1
- package/dataflow/environments/overwrite.d.ts +1 -2
- package/dataflow/environments/overwrite.js +3 -16
- package/dataflow/environments/resolve-by-name.d.ts +4 -4
- package/dataflow/environments/resolve-by-name.js +3 -2
- package/dataflow/environments/scoping.d.ts +9 -2
- package/dataflow/environments/scoping.js +8 -1
- package/dataflow/eval/resolve/alias-tracking.d.ts +4 -10
- package/dataflow/eval/resolve/alias-tracking.js +11 -14
- package/dataflow/eval/resolve/resolve-argument.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-argument.js +2 -2
- package/dataflow/eval/resolve/resolve.d.ts +1 -7
- package/dataflow/eval/resolve/resolve.js +0 -5
- package/dataflow/eval/values/general.d.ts +1 -3
- package/dataflow/eval/values/general.js +0 -1
- package/dataflow/eval/values/intervals/interval-constants.d.ts +7 -1
- package/dataflow/eval/values/intervals/interval-constants.js +6 -0
- package/dataflow/eval/values/logical/logical-constants.d.ts +4 -1
- package/dataflow/eval/values/logical/logical-constants.js +3 -0
- package/dataflow/eval/values/r-value.d.ts +12 -0
- package/dataflow/eval/values/r-value.js +12 -0
- package/dataflow/eval/values/scalar/scalar-consatnts.d.ts +7 -1
- package/dataflow/eval/values/scalar/scalar-consatnts.js +6 -0
- package/dataflow/eval/values/sets/set-constants.d.ts +7 -2
- package/dataflow/eval/values/sets/set-constants.js +6 -0
- package/dataflow/eval/values/string/string-constants.d.ts +16 -1
- package/dataflow/eval/values/string/string-constants.js +15 -0
- package/dataflow/eval/values/vectors/vector-constants.d.ts +1 -1
- package/dataflow/extractor.d.ts +3 -4
- package/dataflow/extractor.js +25 -22
- package/dataflow/graph/dataflowgraph-builder.d.ts +20 -38
- package/dataflow/graph/dataflowgraph-builder.js +6 -23
- package/dataflow/graph/diff-dataflow-graph.d.ts +16 -6
- package/dataflow/graph/diff-dataflow-graph.js +12 -1
- package/dataflow/graph/edge.d.ts +9 -0
- package/dataflow/graph/edge.js +9 -0
- package/dataflow/graph/graph.d.ts +9 -28
- package/dataflow/graph/graph.js +4 -28
- package/dataflow/graph/invert-dfg.d.ts +3 -0
- package/dataflow/graph/invert-dfg.js +3 -0
- package/dataflow/graph/quads.d.ts +1 -1
- package/dataflow/graph/unknown-replacement.d.ts +8 -0
- package/dataflow/graph/unknown-replacement.js +8 -0
- package/dataflow/graph/unknown-side-effect.d.ts +8 -0
- package/dataflow/graph/unknown-side-effect.js +8 -0
- package/dataflow/graph/vertex.d.ts +9 -9
- package/dataflow/graph/vertex.js +9 -1
- package/dataflow/info.d.ts +16 -10
- package/dataflow/info.js +27 -1
- package/dataflow/internal/linker.d.ts +25 -9
- package/dataflow/internal/linker.js +30 -11
- package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +6 -0
- package/dataflow/internal/process/functions/call/argument/make-argument.js +6 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +6 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +9 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +10 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +7 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +3 -0
- 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 +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +6 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +10 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +8 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +6 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +34 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +90 -68
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +1 -1
- 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.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -1
- package/dataflow/internal/process/functions/call/common.d.ts +11 -5
- package/dataflow/internal/process/functions/call/common.js +9 -3
- package/dataflow/internal/process/functions/call/default-call-handling.d.ts +5 -0
- package/dataflow/internal/process/functions/call/default-call-handling.js +5 -0
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -5
- package/dataflow/internal/process/functions/call/known-call-handling.js +10 -3
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +7 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +10 -4
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +4 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +3 -0
- package/dataflow/internal/process/functions/process-argument.d.ts +8 -2
- package/dataflow/internal/process/functions/process-argument.js +6 -0
- package/dataflow/internal/process/functions/process-parameter.d.ts +5 -2
- package/dataflow/internal/process/functions/process-parameter.js +7 -4
- package/dataflow/internal/process/process-symbol.d.ts +3 -0
- package/dataflow/internal/process/process-symbol.js +3 -0
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +3 -0
- package/dataflow/internal/process/process-uninteresting-leaf.js +3 -0
- package/dataflow/internal/process/process-value.d.ts +3 -0
- package/dataflow/internal/process/process-value.js +3 -0
- package/dataflow/origin/dfg-get-origin.d.ts +0 -2
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +6 -8
- package/dataflow/origin/dfg-get-symbol-refs.js +7 -9
- package/dataflow/processor.d.ts +6 -12
- package/dataflow/processor.js +0 -1
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +6 -2
- package/documentation/data/dfg/doc-data-dfg-util.js +6 -0
- package/documentation/data/faq/faqs.d.ts +5 -0
- package/documentation/data/faq/faqs.js +87 -0
- package/documentation/data/faq/recommended-configs.d.ts +36 -0
- package/documentation/data/faq/recommended-configs.js +40 -0
- package/documentation/data/faq/wiki-faq-store.d.ts +19 -0
- package/documentation/data/faq/wiki-faq-store.js +83 -0
- package/documentation/data/server/doc-data-server-messages.d.ts +3 -0
- package/documentation/data/server/doc-data-server-messages.js +5 -64
- package/documentation/doc-capabilities.d.ts +9 -0
- package/documentation/{print-capabilities-markdown.js → doc-capabilities.js} +18 -21
- package/documentation/doc-readme.d.ts +9 -0
- package/documentation/{print-readme.js → doc-readme.js} +136 -35
- package/documentation/doc-util/doc-auto-gen.d.ts +6 -0
- package/documentation/doc-util/doc-auto-gen.js +6 -0
- package/documentation/doc-util/doc-benchmarks.d.ts +14 -0
- package/documentation/doc-util/doc-benchmarks.js +14 -0
- package/documentation/doc-util/doc-cfg.d.ts +7 -1
- package/documentation/doc-util/doc-cfg.js +14 -8
- package/documentation/doc-util/doc-cli-option.d.ts +9 -0
- package/documentation/doc-util/doc-cli-option.js +9 -0
- package/documentation/doc-util/doc-code.d.ts +24 -0
- package/documentation/doc-util/doc-code.js +24 -0
- package/documentation/doc-util/doc-dfg.d.ts +12 -6
- package/documentation/doc-util/doc-dfg.js +19 -10
- package/documentation/doc-util/doc-env.d.ts +3 -0
- package/documentation/doc-util/doc-env.js +3 -0
- package/documentation/doc-util/doc-escape.d.ts +6 -1
- package/documentation/doc-util/doc-escape.js +11 -1
- package/documentation/doc-util/doc-files.d.ts +11 -0
- package/documentation/doc-util/doc-files.js +15 -4
- package/documentation/doc-util/doc-general.d.ts +26 -0
- package/documentation/doc-util/doc-general.js +26 -0
- package/documentation/doc-util/doc-normalized-ast.d.ts +14 -3
- package/documentation/doc-util/doc-normalized-ast.js +16 -7
- package/documentation/doc-util/doc-query.d.ts +26 -3
- package/documentation/doc-util/doc-query.js +34 -12
- package/documentation/doc-util/doc-repl.d.ts +6 -0
- package/documentation/doc-util/doc-repl.js +6 -0
- package/documentation/doc-util/doc-search.d.ts +3 -18
- package/documentation/doc-util/doc-search.js +6 -62
- package/documentation/doc-util/doc-server-message.d.ts +18 -6
- package/documentation/doc-util/doc-server-message.js +17 -5
- package/documentation/doc-util/doc-structure.d.ts +9 -0
- package/documentation/doc-util/doc-structure.js +10 -1
- package/documentation/doc-util/doc-types.d.ts +90 -11
- package/documentation/doc-util/doc-types.js +128 -39
- package/documentation/index.d.ts +9 -9
- package/documentation/index.js +9 -9
- package/documentation/issue-linting-rule.d.ts +9 -0
- package/documentation/{print-linter-issue.js → issue-linting-rule.js} +20 -23
- package/documentation/wiki-analyzer.d.ts +9 -0
- package/documentation/wiki-analyzer.js +412 -0
- package/documentation/wiki-cfg.d.ts +9 -0
- package/documentation/{print-cfg-wiki.js → wiki-cfg.js} +144 -160
- package/documentation/wiki-core.d.ts +14 -0
- package/documentation/{print-core-wiki.js → wiki-core.js} +167 -175
- package/documentation/wiki-dataflow-graph.d.ts +9 -0
- package/documentation/{print-dataflow-graph-wiki.js → wiki-dataflow-graph.js} +145 -175
- package/documentation/wiki-engine.d.ts +9 -0
- package/documentation/{print-engines-wiki.js → wiki-engine.js} +27 -42
- package/documentation/wiki-faq.d.ts +8 -0
- package/documentation/wiki-faq.js +22 -0
- package/documentation/wiki-interface.d.ts +9 -0
- package/documentation/{print-interface-wiki.js → wiki-interface.js} +60 -57
- package/documentation/wiki-linter.d.ts +9 -0
- package/documentation/{print-linter-wiki.js → wiki-linter.js} +52 -48
- package/documentation/wiki-linting-and-testing.d.ts +9 -0
- package/documentation/{print-linting-and-testing-wiki.js → wiki-linting-and-testing.js} +25 -32
- package/documentation/wiki-mk/doc-context.d.ts +186 -0
- package/documentation/wiki-mk/doc-context.js +84 -0
- package/documentation/wiki-mk/doc-maker.d.ts +95 -0
- package/documentation/wiki-mk/doc-maker.js +133 -0
- package/documentation/wiki-normalized-ast.d.ts +9 -0
- package/documentation/{print-normalized-ast-wiki.js → wiki-normalized-ast.js} +64 -47
- package/documentation/wiki-onboarding.d.ts +8 -0
- package/documentation/{print-onboarding-wiki.js → wiki-onboarding.js} +18 -15
- package/documentation/wiki-query.d.ts +9 -0
- package/documentation/{print-query-wiki.js → wiki-query.js} +65 -80
- package/documentation/wiki-search.d.ts +9 -0
- package/documentation/wiki-search.js +61 -0
- package/engines.d.ts +1 -1
- package/linter/linter-executor.d.ts +6 -3
- package/linter/linter-executor.js +6 -2
- package/linter/linter-format.d.ts +10 -2
- package/linter/linter-format.js +8 -0
- package/linter/linter-rules.d.ts +13 -17
- package/linter/rules/absolute-path.d.ts +4 -6
- package/linter/rules/absolute-path.js +2 -2
- package/linter/rules/dataframe-access-validation.d.ts +4 -5
- package/linter/rules/dataframe-access-validation.js +21 -19
- package/linter/rules/dead-code.d.ts +2 -2
- package/linter/rules/deprecated-functions.d.ts +2 -6
- package/linter/rules/file-path-validity.d.ts +2 -3
- package/linter/rules/file-path-validity.js +4 -4
- package/linter/rules/function-finder-util.d.ts +2 -7
- package/linter/rules/naming-convention.d.ts +15 -4
- package/linter/rules/naming-convention.js +14 -2
- package/linter/rules/network-functions.d.ts +2 -2
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +4 -4
- package/linter/rules/seeded-randomness.js +33 -13
- package/linter/rules/unused-definition.d.ts +3 -4
- package/linter/rules/useless-loop.d.ts +3 -4
- package/linter/rules/useless-loop.js +2 -2
- package/package.json +7 -18
- package/project/cache/flowr-analyzer-cache.d.ts +9 -19
- package/project/cache/flowr-analyzer-cache.js +17 -44
- package/project/cache/flowr-analyzer-controlflow-cache.d.ts +34 -0
- package/project/cache/flowr-analyzer-controlflow-cache.js +79 -0
- package/project/context/flowr-analyzer-context.d.ts +31 -9
- package/project/context/flowr-analyzer-context.js +48 -4
- package/project/context/flowr-analyzer-dependencies-context.d.ts +0 -1
- package/project/context/flowr-analyzer-files-context.d.ts +63 -15
- package/project/context/flowr-analyzer-files-context.js +110 -39
- package/project/context/flowr-file.d.ts +32 -11
- package/project/context/flowr-file.js +30 -9
- package/project/flowr-analyzer-builder.d.ts +23 -31
- package/project/flowr-analyzer-builder.js +35 -74
- package/project/flowr-analyzer.d.ts +79 -29
- package/project/flowr-analyzer.js +59 -15
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +8 -2
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +13 -5
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +3 -3
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +11 -5
- package/project/plugins/file-plugins/flowr-description-file.d.ts +3 -5
- package/project/plugins/file-plugins/flowr-description-file.js +0 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.d.ts +20 -0
- package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.js +42 -0
- package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.d.ts +59 -0
- package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.js +132 -0
- package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
- package/project/plugins/file-plugins/notebooks/notebook.js +2 -0
- package/project/plugins/flowr-analyzer-plugin-defaults.d.ts +5 -0
- package/project/plugins/flowr-analyzer-plugin-defaults.js +23 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +2 -0
- package/project/plugins/flowr-analyzer-plugin.js +2 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/plugin-registry.d.ts +34 -0
- package/project/plugins/plugin-registry.js +62 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +1 -1
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
- package/queries/base-query-format.d.ts +2 -2
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +3 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +7 -2
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +3 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +16 -4
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +34 -18
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +3 -0
- package/queries/catalog/cluster-query/cluster-query-executor.js +3 -0
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.d.ts +3 -0
- package/queries/catalog/config-query/config-query-executor.js +3 -0
- package/queries/catalog/config-query/config-query-format.d.ts +5 -2
- package/queries/catalog/config-query/config-query-format.js +13 -16
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +3 -0
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +3 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +3 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +3 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +3 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +3 -0
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +3 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +4 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +7 -4
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +4 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +5 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +4 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +8 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +10 -3
- package/queries/catalog/df-shape-query/df-shape-query-format.js +25 -5
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +4 -0
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +4 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +3 -0
- package/queries/catalog/id-map-query/id-map-query-executor.js +3 -0
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/linter-query/linter-query-executor.d.ts +4 -0
- package/queries/catalog/linter-query/linter-query-executor.js +4 -0
- package/queries/catalog/linter-query/linter-query-format.d.ts +12 -3
- package/queries/catalog/linter-query/linter-query-format.js +80 -2
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +4 -0
- package/queries/catalog/location-map-query/location-map-query-executor.js +7 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +7 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +12 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +3 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +3 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-executor.d.ts +7 -1
- package/queries/catalog/origin-query/origin-query-executor.js +6 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +7 -1
- package/queries/catalog/origin-query/origin-query-format.js +17 -1
- package/queries/catalog/project-query/project-query-executor.d.ts +3 -0
- package/queries/catalog/project-query/project-query-executor.js +6 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +6 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +6 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +7 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +19 -1
- package/queries/catalog/search-query/search-query-executor.d.ts +3 -0
- package/queries/catalog/search-query/search-query-executor.js +3 -0
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +9 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +10 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +7 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +30 -1
- package/queries/query-print.d.ts +20 -4
- package/queries/query-print.js +18 -2
- package/queries/query.d.ts +93 -55
- package/queries/query.js +55 -23
- package/queries/virtual-query/virtual-queries.d.ts +1 -2
- package/r-bridge/data/get.d.ts +6 -0
- package/r-bridge/data/get.js +6 -0
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/collect.js +4 -1
- package/r-bridge/lang-4.x/ast/model/model.d.ts +8 -11
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +3 -0
- package/r-bridge/lang-4.x/ast/model/operators.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +11 -14
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +30 -17
- package/r-bridge/lang-4.x/ast/model/processing/fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +0 -1
- package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +0 -1
- package/r-bridge/lang-4.x/ast/model/type.d.ts +6 -5
- package/r-bridge/lang-4.x/ast/model/type.js +6 -5
- package/r-bridge/lang-4.x/ast/model/versions.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/model/versions.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +12 -12
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +11 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +1 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-break.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-break.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.d.ts +4 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.d.ts +4 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/other/normalize-comment.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/other/normalize-comment.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/other/normalize-line-directive.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/other/normalize-line-directive.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-delimiter.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-delimiter.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +9 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.d.ts +4 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +20 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.d.ts +1 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +14 -5
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +13 -6
- package/r-bridge/lang-4.x/convert-values.d.ts +12 -1
- package/r-bridge/lang-4.x/convert-values.js +12 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +7 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +18 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +15 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +62 -24
- package/r-bridge/parser.d.ts +43 -12
- package/r-bridge/parser.js +27 -13
- package/r-bridge/retriever.d.ts +25 -16
- package/r-bridge/retriever.js +29 -5
- package/r-bridge/shell-executor.d.ts +3 -3
- package/r-bridge/shell-executor.js +6 -1
- package/r-bridge/shell.d.ts +24 -23
- package/r-bridge/shell.js +37 -31
- package/reconstruct/auto-select/auto-select-defaults.d.ts +0 -2
- package/reconstruct/auto-select/magic-comments.d.ts +1 -2
- package/reconstruct/auto-select/magic-comments.js +2 -3
- package/reconstruct/reconstruct.d.ts +18 -12
- package/reconstruct/reconstruct.js +19 -10
- package/search/flowr-search-builder.d.ts +12 -5
- package/search/flowr-search-builder.js +7 -2
- package/search/flowr-search-executor.d.ts +3 -3
- package/search/flowr-search-filters.d.ts +14 -1
- package/search/flowr-search-filters.js +13 -0
- package/search/flowr-search-printer.d.ts +6 -0
- package/search/flowr-search-printer.js +6 -0
- package/search/flowr-search-traverse.d.ts +1 -1
- package/search/flowr-search.d.ts +15 -3
- package/search/search-executor/search-enrichers.d.ts +16 -6
- package/search/search-executor/search-enrichers.js +4 -3
- package/search/search-executor/search-generators.d.ts +19 -10
- package/search/search-executor/search-generators.js +57 -5
- package/search/search-executor/search-mappers.d.ts +8 -5
- package/search/search-executor/search-mappers.js +3 -0
- package/search/search-executor/search-transformer.d.ts +19 -16
- package/search/search-executor/search-transformer.js +3 -0
- package/slicing/criterion/collect-all.d.ts +13 -12
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/criterion/parse.d.ts +4 -2
- package/slicing/criterion/parse.js +8 -6
- package/slicing/static/fingerprint.d.ts +9 -1
- package/slicing/static/fingerprint.js +8 -0
- package/slicing/static/slice-call.d.ts +2 -2
- package/slicing/static/static-slicer.d.ts +8 -4
- package/slicing/static/static-slicer.js +5 -1
- package/slicing/static/visiting-queue.d.ts +1 -1
- package/statistics/features/common-syntax-probability.d.ts +10 -1
- package/statistics/features/common-syntax-probability.js +9 -0
- package/statistics/features/feature.d.ts +0 -4
- package/statistics/features/feature.js +0 -1
- package/statistics/features/post-processing.d.ts +6 -0
- package/statistics/features/post-processing.js +6 -0
- package/statistics/features/supported/assignments/assignments.js +1 -1
- package/statistics/features/supported/assignments/post-process.d.ts +3 -0
- package/statistics/features/supported/assignments/post-process.js +3 -0
- package/statistics/features/supported/comments/post-process.d.ts +3 -0
- package/statistics/features/supported/comments/post-process.js +3 -0
- package/statistics/features/supported/control-flow/control-flow.js +1 -1
- package/statistics/features/supported/control-flow/post-process.d.ts +3 -0
- package/statistics/features/supported/control-flow/post-process.js +3 -0
- package/statistics/features/supported/data-access/data-access.d.ts +1 -1
- package/statistics/features/supported/data-access/data-access.js +1 -1
- package/statistics/features/supported/data-access/post-process.d.ts +3 -0
- package/statistics/features/supported/data-access/post-process.js +3 -0
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +1 -1
- package/statistics/features/supported/defined-functions/defined-functions.js +1 -1
- package/statistics/features/supported/expression-list/post-process.d.ts +3 -0
- package/statistics/features/supported/expression-list/post-process.js +3 -0
- package/statistics/features/supported/expression-list/statistics-expression-list.js +1 -1
- package/statistics/features/supported/loops/loops.js +1 -1
- package/statistics/features/supported/loops/post-process.d.ts +3 -0
- package/statistics/features/supported/loops/post-process.js +3 -0
- package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +1 -1
- package/statistics/features/supported/used-packages/post-process.d.ts +3 -0
- package/statistics/features/supported/used-packages/post-process.js +3 -0
- package/statistics/features/supported/values/post-process.d.ts +3 -0
- package/statistics/features/supported/values/post-process.js +3 -0
- package/statistics/features/supported/variables/post-process.d.ts +7 -1
- package/statistics/features/supported/variables/post-process.js +6 -0
- package/statistics/features/supported/variables/variables.js +1 -1
- package/statistics/meta-statistics.d.ts +8 -9
- package/statistics/output/file-provider.d.ts +5 -6
- package/statistics/output/file-provider.js +5 -6
- package/statistics/output/print-stats.d.ts +13 -1
- package/statistics/output/print-stats.js +12 -0
- package/statistics/output/statistics-file.d.ts +1 -2
- package/statistics/output/statistics-file.js +0 -1
- package/statistics/statistics.d.ts +3 -4
- package/statistics/statistics.js +4 -4
- package/statistics/summarizer/auto-detect.d.ts +3 -0
- package/statistics/summarizer/auto-detect.js +3 -0
- package/statistics/summarizer/post-process/clusterer.d.ts +3 -4
- package/statistics/summarizer/post-process/clusterer.js +0 -2
- package/statistics/summarizer/post-process/file-based-count.d.ts +0 -1
- package/statistics/summarizer/post-process/file-based-count.js +0 -1
- package/statistics/summarizer/post-process/histogram.d.ts +0 -2
- package/statistics/summarizer/post-process/histogram.js +0 -2
- package/statistics/summarizer/post-process/post-process-output.d.ts +2 -4
- package/statistics/summarizer/post-process/post-process-output.js +0 -3
- package/statistics/summarizer/second-phase/process.d.ts +5 -3
- package/statistics/summarizer/second-phase/process.js +3 -1
- package/statistics/summarizer/summarizer.d.ts +1 -2
- package/util/assert.d.ts +56 -2
- package/util/assert.js +56 -2
- package/util/collections/arrays.d.ts +10 -5
- package/util/collections/arrays.js +10 -5
- package/util/collections/defaultmap.d.ts +11 -11
- package/util/collections/defaultmap.js +11 -11
- package/util/containers.d.ts +2 -7
- package/util/containers.js +0 -5
- package/util/diff-graph.d.ts +0 -1
- package/util/diff-graph.js +0 -1
- package/util/diff.d.ts +3 -1
- package/util/diff.js +3 -1
- package/util/files.d.ts +12 -12
- package/util/files.js +11 -11
- package/util/html-hover-over.d.ts +5 -0
- package/util/html-hover-over.js +5 -0
- package/util/json.d.ts +13 -0
- package/util/json.js +13 -0
- package/util/log.d.ts +2 -2
- package/util/log.js +2 -2
- package/util/mermaid/ast.d.ts +7 -3
- package/util/mermaid/ast.js +39 -8
- package/util/mermaid/cfg.d.ts +1 -1
- package/util/mermaid/cfg.js +1 -1
- package/util/mermaid/dfg.d.ts +12 -4
- package/util/mermaid/dfg.js +9 -1
- package/util/mermaid/mermaid.d.ts +6 -1
- package/util/mermaid/mermaid.js +6 -1
- package/util/numbers.d.ts +7 -0
- package/util/numbers.js +7 -0
- package/util/objects.d.ts +0 -2
- package/util/os.d.ts +3 -0
- package/util/os.js +3 -0
- package/util/parallel.d.ts +4 -4
- package/util/parallel.js +4 -4
- package/util/prefix.d.ts +0 -1
- package/util/prefix.js +0 -1
- package/util/quads.d.ts +14 -17
- package/util/quads.js +3 -5
- package/util/r-value.d.ts +10 -1
- package/util/r-value.js +21 -0
- package/util/random.d.ts +3 -0
- package/util/random.js +3 -0
- package/util/range.d.ts +9 -3
- package/util/range.js +15 -2
- package/util/schema.d.ts +14 -1
- package/util/schema.js +15 -2
- package/util/simple-df/dfg-view.d.ts +4 -1
- package/util/simple-df/dfg-view.js +4 -1
- package/util/summarizer.d.ts +9 -1
- package/util/summarizer.js +9 -0
- package/util/text/ansi.d.ts +3 -0
- package/util/text/ansi.js +3 -0
- package/util/text/args.d.ts +2 -4
- package/util/text/args.js +7 -5
- package/util/text/text.d.ts +4 -0
- package/util/text/text.js +4 -0
- package/util/text/time.d.ts +0 -1
- package/util/text/time.js +0 -1
- package/util/version.d.ts +12 -3
- package/util/version.js +12 -3
- package/abstract-interpretation/data-frame/domain.d.ts +0 -107
- package/abstract-interpretation/data-frame/domain.js +0 -315
- package/abstract-interpretation/domains/set-bounded-set-domain.d.ts +0 -43
- package/abstract-interpretation/domains/set-bounded-set-domain.js +0 -164
- package/cli/repl/commands/repl-lineage.d.ts +0 -15
- package/cli/repl/commands/repl-lineage.js +0 -66
- package/cli/repl/server/messages/message-lineage.d.ts +0 -17
- package/cli/repl/server/messages/message-lineage.js +0 -25
- package/documentation/print-analyzer-wiki.d.ts +0 -1
- package/documentation/print-analyzer-wiki.js +0 -137
- package/documentation/print-capabilities-markdown.d.ts +0 -1
- package/documentation/print-cfg-wiki.d.ts +0 -1
- package/documentation/print-core-wiki.d.ts +0 -2
- package/documentation/print-dataflow-graph-wiki.d.ts +0 -1
- package/documentation/print-engines-wiki.d.ts +0 -1
- package/documentation/print-faq-wiki.d.ts +0 -1
- package/documentation/print-faq-wiki.js +0 -90
- package/documentation/print-interface-wiki.d.ts +0 -1
- package/documentation/print-linter-issue.d.ts +0 -1
- package/documentation/print-linter-wiki.d.ts +0 -1
- package/documentation/print-linting-and-testing-wiki.d.ts +0 -1
- package/documentation/print-normalized-ast-wiki.d.ts +0 -1
- package/documentation/print-onboarding-wiki.d.ts +0 -1
- package/documentation/print-query-wiki.d.ts +0 -1
- package/documentation/print-readme.d.ts +0 -1
- package/documentation/print-search-wiki.d.ts +0 -1
- package/documentation/print-search-wiki.js +0 -74
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +0 -3
- package/queries/catalog/lineage-query/lineage-query-executor.js +0 -22
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +0 -22
- package/queries/catalog/lineage-query/lineage-query-format.js +0 -31
- package/util/formats/adapter-format.d.ts +0 -6
- package/util/formats/adapter-format.js +0 -3
- package/util/formats/adapter.d.ts +0 -18
- package/util/formats/adapter.js +0 -49
- package/util/formats/adapters/r-adapter.d.ts +0 -4
- package/util/formats/adapters/r-adapter.js +0 -7
- package/util/formats/adapters/rmd-adapter.d.ts +0 -26
- package/util/formats/adapters/rmd-adapter.js +0 -91
|
@@ -3,15 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WikiDataflowGraph = void 0;
|
|
6
7
|
const graph_1 = require("../dataflow/graph/graph");
|
|
7
|
-
const shell_1 = require("../r-bridge/shell");
|
|
8
8
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
9
9
|
const edge_1 = require("../dataflow/graph/edge");
|
|
10
10
|
const dataflowgraph_builder_1 = require("../dataflow/graph/dataflowgraph-builder");
|
|
11
11
|
const assert_1 = require("../util/assert");
|
|
12
12
|
const doc_dfg_1 = require("./doc-util/doc-dfg");
|
|
13
13
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
14
|
-
const retriever_1 = require("../r-bridge/retriever");
|
|
15
14
|
const json_1 = require("../util/json");
|
|
16
15
|
const doc_env_1 = require("./doc-util/doc-env");
|
|
17
16
|
const doc_data_dfg_util_1 = require("./data/dfg/doc-data-dfg-util");
|
|
@@ -26,9 +25,7 @@ const identifier_1 = require("../dataflow/environments/identifier");
|
|
|
26
25
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
27
26
|
const resolve_by_name_1 = require("../dataflow/environments/resolve-by-name");
|
|
28
27
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
29
|
-
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
|
|
30
28
|
const text_1 = require("../util/text/text");
|
|
31
|
-
const log_1 = require("../../test/functionality/_helper/log");
|
|
32
29
|
const linker_1 = require("../dataflow/internal/linker");
|
|
33
30
|
const doc_normalized_ast_1 = require("./doc-util/doc-normalized-ast");
|
|
34
31
|
const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
|
|
@@ -37,10 +34,11 @@ const alias_tracking_1 = require("../dataflow/eval/resolve/alias-tracking");
|
|
|
37
34
|
const doc_issue_1 = require("./doc-util/doc-issue");
|
|
38
35
|
const unnamed_call_handling_1 = require("../dataflow/internal/process/functions/call/unnamed-call-handling");
|
|
39
36
|
const environment_builder_1 = require("../../test/functionality/_helper/dataflow/environment-builder");
|
|
40
|
-
const config_1 = require("../config");
|
|
41
37
|
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-context");
|
|
39
|
+
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
40
|
+
async function subExplanation(parser, { description, code, expectedSubgraph }) {
|
|
41
|
+
expectedSubgraph = await (0, doc_dfg_1.verifyExpectedSubgraph)(parser, code, expectedSubgraph);
|
|
44
42
|
const marks = [];
|
|
45
43
|
for (const [id] of expectedSubgraph.vertices(true)) {
|
|
46
44
|
marks.push(id);
|
|
@@ -51,11 +49,11 @@ async function subExplanation(shell, { description, code, expectedSubgraph }) {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
return `
|
|
54
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
52
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set(marks) })}
|
|
55
53
|
|
|
56
54
|
${description}`;
|
|
57
55
|
}
|
|
58
|
-
async function printAllSubExplanations(
|
|
56
|
+
async function printAllSubExplanations(parser, expls) {
|
|
59
57
|
let result = `
|
|
60
58
|
<details>
|
|
61
59
|
|
|
@@ -64,21 +62,21 @@ async function printAllSubExplanations(shell, expls) {
|
|
|
64
62
|
`;
|
|
65
63
|
for (const sub of expls) {
|
|
66
64
|
result += `#### ${sub.name}\n`;
|
|
67
|
-
result += await subExplanation(
|
|
65
|
+
result += await subExplanation(parser, sub) + '\n';
|
|
68
66
|
}
|
|
69
67
|
return result + '\n\n</details>';
|
|
70
68
|
}
|
|
71
|
-
async function explanation({
|
|
72
|
-
await (0, doc_dfg_1.verifyExpectedSubgraph)(
|
|
69
|
+
async function explanation({ name, type, description, code, expectedSubgraph }, parser, index, ...subExplanations) {
|
|
70
|
+
await (0, doc_dfg_1.verifyExpectedSubgraph)(parser, code, expectedSubgraph);
|
|
73
71
|
return `
|
|
74
72
|
<a id='${name.toLowerCase().replaceAll(' ', '-')}'> </a>
|
|
75
73
|
### ${index}) ${name}
|
|
76
74
|
|
|
77
75
|
Type: \`${type}\` (this is the bit-flag value, e.g., when looking at the serialization)
|
|
78
76
|
|
|
79
|
-
${await subExplanation(
|
|
77
|
+
${await subExplanation(parser, { name, description, code, expectedSubgraph })}
|
|
80
78
|
|
|
81
|
-
${subExplanations.length > 0 ? await printAllSubExplanations(
|
|
79
|
+
${subExplanations.length > 0 ? await printAllSubExplanations(parser, subExplanations) : ''}
|
|
82
80
|
`;
|
|
83
81
|
}
|
|
84
82
|
function edgeTypeToId(edgeType) {
|
|
@@ -87,18 +85,17 @@ function edgeTypeToId(edgeType) {
|
|
|
87
85
|
function linkEdgeName(edgeType, page = '') {
|
|
88
86
|
return `[\`${(0, edge_1.edgeTypeToName)(edgeType)}\`](${page}#${edgeTypeToId(edgeType)})`;
|
|
89
87
|
}
|
|
90
|
-
async function getVertexExplanations(
|
|
88
|
+
async function getVertexExplanations(parser, ctx) {
|
|
91
89
|
/* we use the map to ensure order easily :D */
|
|
92
90
|
const vertexExplanations = new Map();
|
|
93
91
|
vertexExplanations.set(vertex_1.VertexType.Value, [{
|
|
94
|
-
shell,
|
|
95
92
|
name: 'Value Vertex',
|
|
96
93
|
type: vertex_1.VertexType.Value,
|
|
97
94
|
description: `
|
|
98
95
|
Describes a constant value (numbers, booleans/logicals, strings, ...).
|
|
99
96
|
In general, the respective vertex is more or less a dummy vertex as you can see from its implementation.
|
|
100
97
|
|
|
101
|
-
${
|
|
98
|
+
${ctx.hierarchy('DataflowGraphVertexValue')}
|
|
102
99
|
|
|
103
100
|
${(0, doc_structure_1.block)({
|
|
104
101
|
type: 'NOTE',
|
|
@@ -112,14 +109,13 @@ and ask for the value associated with it.
|
|
|
112
109
|
Please be aware that such nodes may be the result from language semantics as well, and not just from constants directly in the source.
|
|
113
110
|
For example, an access operation like \`df$column\` will treat the column name as a constant value.
|
|
114
111
|
|
|
115
|
-
${(0, doc_structure_1.details)('Example: Semantics Create a Value', `In the following graph, the original type printed by mermaid is still \`RSymbol\` (from the [normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized
|
|
116
|
-
await (0, doc_dfg_1.printDfGraphForCode)(
|
|
112
|
+
${(0, doc_structure_1.details)('Example: Semantics Create a Value', `In the following graph, the original type printed by mermaid is still \`RSymbol\` (from the [normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized-AST)), however, the shape of the vertex signals to you that the symbol is in-fact treated as a constant! If you do not know what \`df$column\` even means, please refer to the [R topic](https://rdrr.io/r/base/Extract.html).\n` +
|
|
113
|
+
await (0, doc_dfg_1.printDfGraphForCode)(parser, 'df$column', { mark: new Set([1]) }))}
|
|
117
114
|
`,
|
|
118
115
|
code: '42',
|
|
119
116
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().constant('0')
|
|
120
117
|
}, []]);
|
|
121
118
|
vertexExplanations.set(vertex_1.VertexType.Use, [{
|
|
122
|
-
shell,
|
|
123
119
|
name: 'Use Vertex',
|
|
124
120
|
type: vertex_1.VertexType.Use,
|
|
125
121
|
description: `
|
|
@@ -128,7 +124,7 @@ Describes symbol/variable references which are read (or potentially read at a gi
|
|
|
128
124
|
Similar to the [value vertex](#value-vertex) described above, this is more a marker vertex as
|
|
129
125
|
you can see from the implementation.
|
|
130
126
|
|
|
131
|
-
${
|
|
127
|
+
${ctx.hierarchy('DataflowGraphVertexUse')}
|
|
132
128
|
|
|
133
129
|
${(0, doc_structure_1.block)({
|
|
134
130
|
type: 'NOTE',
|
|
@@ -148,26 +144,26 @@ Consider a case, in which we refer to a variable with a string, as in \`get("x")
|
|
|
148
144
|
${(0, doc_structure_1.details)('Example: Semantics Create a Symbol', `In the following graph, the original type printed by mermaid is still \`RString\` (from the [normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized%20AST)), however, the shape of the vertex signals to you that the symbol is in-fact treated as a variable use! ` +
|
|
149
145
|
'If you are unsure what `get` does, refer to the [documentation](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/get). ' +
|
|
150
146
|
'Please note, that the lexeme being printed as `"x"` may be misleading (after all it is recovered from the AST), the quotes are not part of the reference.\n' +
|
|
151
|
-
await (0, doc_dfg_1.printDfGraphForCode)(
|
|
147
|
+
await (0, doc_dfg_1.printDfGraphForCode)(parser, 'get("x")', { mark: new Set([1]) }))}
|
|
152
148
|
|
|
153
149
|
But now to the interesting stuff: how do we actually know which values are read by the respective variable use?
|
|
154
150
|
This usually involves a [variable definition](#variable-definition-vertex) and a [reads edge](#reads-edge) linking the two.
|
|
155
151
|
|
|
156
152
|
${(0, doc_structure_1.details)('Example: Reads Edge Identifying a Single Definition', 'In the following graph, the `x` is read from the definition `x <- 1`.\n' +
|
|
157
|
-
await (0, doc_dfg_1.printDfGraphForCode)(
|
|
153
|
+
await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 1\nprint(x)', { mark: new Set([3, '0->3']), codeOpen: true }))}
|
|
158
154
|
|
|
159
155
|
In general, there may be many such edges, identifying every possible definition of the variable.
|
|
160
156
|
|
|
161
|
-
${(0, doc_structure_1.details)('Example: Reads Edge Identifying Multiple Definitions (conditional)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
162
|
-
${(0, doc_structure_1.details)('Example: Reads Edge Identifying Multiple Definitions (loop)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
163
|
-
${(0, doc_structure_1.details)('Example: Reads Edge Identifying Multiple Definitions (side-effect)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
157
|
+
${(0, doc_structure_1.details)('Example: Reads Edge Identifying Multiple Definitions (conditional)', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 1\nif(u) x <- 2\nprint(x)', { mark: new Set([10, '10->0', '10->4']), codeOpen: true }))}
|
|
158
|
+
${(0, doc_structure_1.details)('Example: Reads Edge Identifying Multiple Definitions (loop)', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 1\nfor(i in v) x <- 2\nprint(x)', { mark: new Set([11, '11->0', '11->5']), codeOpen: true }))}
|
|
159
|
+
${(0, doc_structure_1.details)('Example: Reads Edge Identifying Multiple Definitions (side-effect)', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() x <<- 2\nx <- 2\nif(u) f()\nprint(x)', { mark: new Set([16, '16->1', '16->7']), codeOpen: true }))}
|
|
164
160
|
|
|
165
161
|
${(0, doc_structure_1.block)({
|
|
166
162
|
type: 'IMPORTANT',
|
|
167
163
|
content: `
|
|
168
164
|
If you want to obtain the locations where a variable is defined, or read, or re-defined, refrain from tracking these details manually in the dataflow graph
|
|
169
165
|
as there are some edge-cases that require special attention.
|
|
170
|
-
In general, the ${
|
|
166
|
+
In general, the ${ctx.link(dfg_get_origin_1.getOriginInDfg)} function explained below in [working with the dataflow graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph#working-with-the-dataflow-graph) will help you to get the information you need.
|
|
171
167
|
`
|
|
172
168
|
})}
|
|
173
169
|
|
|
@@ -176,7 +172,6 @@ ${(0, doc_structure_1.block)({
|
|
|
176
172
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().use('1@x', 'x')
|
|
177
173
|
}, []]);
|
|
178
174
|
vertexExplanations.set(vertex_1.VertexType.FunctionCall, [{
|
|
179
|
-
shell,
|
|
180
175
|
name: 'Function Call Vertex',
|
|
181
176
|
type: vertex_1.VertexType.FunctionCall,
|
|
182
177
|
description: `
|
|
@@ -187,20 +182,19 @@ the _name_ of the called function, the passed _arguments_, and the _environment_
|
|
|
187
182
|
However, the implementation reveals that it may hold an additional \`onlyBuiltin\` flag to indicate that the call is only calling builtin functions — however, this is only a flag to improve performance,
|
|
188
183
|
and it should not be relied on as it may under-approximate the actual calling targets (e.g., being \`false\` even though all calls resolve to builtins).
|
|
189
184
|
|
|
190
|
-
${
|
|
185
|
+
${ctx.hierarchy('DataflowGraphVertexFunctionCall')}
|
|
186
|
+
|
|
191
187
|
The related function argument references are defined like this:
|
|
192
|
-
${
|
|
188
|
+
${ctx.hierarchy('FunctionArgument')}
|
|
193
189
|
|
|
194
190
|
There is another element of potential interest to you, the \`origin\` property which records how flowR created the respective function call.
|
|
195
|
-
These origins may hold the name of any processor that is part of the ${
|
|
191
|
+
These origins may hold the name of any processor that is part of the ${ctx.link('BuiltInProcessorMapper')} to signal that the respective processor was responsible for creating the vertex.
|
|
196
192
|
The entry \`function\` signals that flowR used a processor for a user-defined function defined within the source code, \`unnamed\` signals that the function as an anonymous function definition.
|
|
197
193
|
However, in general, flowR may use any fitting handler as an origin. For example, within a access definition, flowR will correspondingly redefine the meaning of \`:=\` to that of the \`table:assign\`.
|
|
198
194
|
|
|
199
|
-
|
|
200
|
-
|
|
201
195
|
${(0, doc_structure_1.details)('Example: Simple Function Call (unresolved)', await (async () => {
|
|
202
196
|
const code = 'foo(x,3,y=3,)';
|
|
203
|
-
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
197
|
+
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([8]), exposeResult: true });
|
|
204
198
|
const callInfo = [...info.dataflow.graph.vertices(true)].find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
|
|
205
199
|
(0, assert_1.guard)(callInfo !== undefined, () => `Could not find call vertex for ${code}`);
|
|
206
200
|
const [callId, callVert] = callInfo;
|
|
@@ -251,13 +245,13 @@ ${(0, doc_structure_1.details)('1) the function resolves only to builtin definit
|
|
|
251
245
|
|
|
252
246
|
Let's have a look at a simple assignment:
|
|
253
247
|
|
|
254
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
248
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 2')}
|
|
255
249
|
|
|
256
250
|
In this case, the call does not have a single ${linkEdgeName(edge_1.EdgeType.Calls)} edge, which in general means (i.e., if the analysis is done and you are not looking at an intermediate result) it is bound to anything
|
|
257
251
|
global beyond the scope of the given script. _flowR_ generally (theoretically at least) does not know if the call really refers to a built-in variable or function,
|
|
258
252
|
as any code that is not part of the analysis could cause the semantics to change.
|
|
259
253
|
However, it is (in most cases) safe to assume we call a builtin if there is a builtin function with the given name and if there is no ${linkEdgeName(edge_1.EdgeType.Calls)} edge attached to a call.
|
|
260
|
-
If you want to check the resolve targets, refer to ${
|
|
254
|
+
If you want to check the resolve targets, refer to ${ctx.link(resolve_by_name_1.resolveByName)}.
|
|
261
255
|
`)}
|
|
262
256
|
|
|
263
257
|
${(0, doc_structure_1.details)('2) the function only resolves to definitions that are present in the program', `
|
|
@@ -266,7 +260,7 @@ Let's have a look at a call to a function named \`foo\` which is defined in the
|
|
|
266
260
|
|
|
267
261
|
${await (async () => {
|
|
268
262
|
const code = 'foo <- function() 3\nfoo()';
|
|
269
|
-
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
263
|
+
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { exposeResult: true, mark: new Set([6, '6->0', '6->1', '6->3']) });
|
|
270
264
|
const numberOfEdges = [...info.dataflow.graph.edges()].flatMap(e => [...e[1].keys()]).length;
|
|
271
265
|
const callVertex = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
|
|
272
266
|
(0, assert_1.guard)(callVertex !== undefined, () => `Could not find call vertex for ${code}`);
|
|
@@ -281,12 +275,12 @@ While it seems to be somewhat redundant given the ${linkEdgeName(edge_1.EdgeType
|
|
|
281
275
|
you have to consider cases in which aliases are involved in the call resolution (e.g., with higher order functions).
|
|
282
276
|
|
|
283
277
|
${(0, doc_structure_1.details)('Example: Alias in Call Resolution', `In the following example, \`g\` ${linkEdgeName(edge_1.EdgeType.Reads)} the previous definition, but ${linkEdgeName(edge_1.EdgeType.Calls)} the function assigned to \`f\`.\n`
|
|
284
|
-
+ await (0, doc_dfg_1.printDfGraphForCode)(
|
|
278
|
+
+ await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() 3\ng <- f\ng()', { mark: new Set(['9', '9->5', '9->3']) }))}
|
|
285
279
|
|
|
286
280
|
Lastly, the ${linkEdgeName(edge_1.EdgeType.Returns)} edge links the call to the return vertices(s) of the function.
|
|
287
281
|
Please be aware, that these multiple exit points may be counter intuitive as they often appear with a nested call (usually a call to the built-in \`{\` function).
|
|
288
282
|
|
|
289
|
-
${(0, doc_structure_1.details)('(Advanced) Example: Multiple Exit Points May Still Reflect As One', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
283
|
+
${(0, doc_structure_1.details)('(Advanced) Example: Multiple Exit Points May Still Reflect As One', await (0, doc_dfg_1.printDfGraphForCode)(parser, `
|
|
290
284
|
f <- function() {
|
|
291
285
|
if(u) return(3)
|
|
292
286
|
if(v) return(2)
|
|
@@ -299,7 +293,6 @@ But you have to beware that \`{\` is a function call as well (see below) and it
|
|
|
299
293
|
In this scenario we show two types of such returns (or exit points): _explicit_ returns with the \`return\` function and _implicit_ returns (the result of the last evaluated expression).
|
|
300
294
|
However, they are actually linked with the call of the built-in function \`{\` (and, in fact, they are highlighted in the mermaid graph).
|
|
301
295
|
`)}
|
|
302
|
-
|
|
303
296
|
`;
|
|
304
297
|
})()}
|
|
305
298
|
|
|
@@ -314,7 +307,7 @@ Users may write… interesting pieces of code - for reasons we should not be int
|
|
|
314
307
|
Consider a case in which you have a built-in function (like the assignment operator \`<-\`) and a user that wants to redefine the meaning of the function call _sometimes_:
|
|
315
308
|
|
|
316
309
|
${await (async () => {
|
|
317
|
-
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
310
|
+
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 2\nif(u) `<-` <- `*`\nx <- 3', { switchCodeAndGraph: true, mark: new Set([9, '9->0', '9->10']), exposeResult: true });
|
|
318
311
|
const interestingUseOfAssignment = [...info.dataflow.graph.vertices(true)].find(([, vertex]) => vertex.id === 11);
|
|
319
312
|
(0, assert_1.guard)(interestingUseOfAssignment !== undefined, () => 'Could not find interesting assignment vertex for the code');
|
|
320
313
|
const [id, interestingVertex] = interestingUseOfAssignment;
|
|
@@ -323,7 +316,7 @@ ${await (async () => {
|
|
|
323
316
|
const name = interestingVertex.name;
|
|
324
317
|
(0, assert_1.guard)(name !== undefined, () => 'Could not find name for interesting assignment vertex');
|
|
325
318
|
return `
|
|
326
|
-
${text}
|
|
319
|
+
${text}
|
|
327
320
|
|
|
328
321
|
Interesting program, right? Running this with \`u <- TRUE\` will cause the last line to evaluate to \`6\` because we redefined the assignment
|
|
329
322
|
operator to mean multiplication, while with \`u <- FALSE\` causes \`x\` to be assigned to \`3\`.
|
|
@@ -336,10 +329,10 @@ For starters, let's have a look at the environment of the call to \`<-\` in the
|
|
|
336
329
|
${(0, doc_env_1.printEnvironmentToMarkdown)(env.current)}
|
|
337
330
|
|
|
338
331
|
Great, you should see a definition of \`<-\` which is constraint by the [control dependency](#control-dependencies) to the \`if\`.
|
|
339
|
-
Hence, trying to re-resolve the call using
|
|
332
|
+
Hence, trying to re-resolve the call using ${ctx.link(linker_1.getAllFunctionCallTargets)} (defined in ${(0, doc_files_1.getFilePathMd)('../dataflow/internal/linker.ts')}) with the id \`${id}\` of the call as starting point will present you with
|
|
340
333
|
the following target ids: { \`${[...(0, linker_1.getAllFunctionCallTargets)(id, info.dataflow.graph)].join('`, `')}\` }.
|
|
341
334
|
This way we know that the call may refer to the built-in assignment operator or to the multiplication.
|
|
342
|
-
Similarly, trying to resolve the name with
|
|
335
|
+
Similarly, trying to resolve the name with ${ctx.link(resolve_by_name_1.resolveByName)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
|
|
343
336
|
{ \`${(0, resolve_by_name_1.resolveByName)(name, env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
|
|
344
337
|
|
|
345
338
|
`;
|
|
@@ -348,26 +341,26 @@ Similarly, trying to resolve the name with \`${resolve_by_name_1.resolveByName.n
|
|
|
348
341
|
`)}
|
|
349
342
|
|
|
350
343
|
|
|
351
|
-
Similar to finding the definitions read by a variable use, please use the ${
|
|
352
|
-
as explained in the [working with the dataflow graph](${doc_files_1.FlowrWikiBaseRef}/
|
|
344
|
+
Similar to finding the definitions read by a variable use, please use the ${ctx.link(linker_1.getAllFunctionCallTargets)} function to find all possible definitions of a function call,
|
|
345
|
+
as explained in the [working with the dataflow graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph#working-with-the-dataflow-graph) section.`
|
|
353
346
|
})}
|
|
354
347
|
|
|
355
348
|
Function calls are the most complicated mechanism in R as essentially everything is a function call.
|
|
356
349
|
Even **control structures** like \`if(p) a else b\` are desugared into function calls (e.g., as \`\` \`if\`(p, a, b) \`\`).
|
|
357
|
-
${(0, doc_structure_1.details)('Example: <code>if</code> as a Function Call', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
350
|
+
${(0, doc_structure_1.details)('Example: <code>if</code> as a Function Call', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'if(p) a else b'))}
|
|
358
351
|
|
|
359
352
|
Similarly, you should be aware of calls to **anonymous functions**, which may appear given directly (e.g. as \`(function() 1)()\`) or indirectly, with code
|
|
360
353
|
directly calling the return of another function call: \`foo()()\`.
|
|
361
|
-
${(0, doc_structure_1.details)('Example: Anonymous Function Call (given directly)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
354
|
+
${(0, doc_structure_1.details)('Example: Anonymous Function Call (given directly)', await (0, doc_dfg_1.printDfGraphForCode)(parser, '(function() 1)()', { mark: new Set([6, '6->4']) }))}
|
|
362
355
|
|
|
363
|
-
${(0, doc_structure_1.details)('Example: Anonymous Function Call (given indirectly)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
356
|
+
${(0, doc_structure_1.details)('Example: Anonymous Function Call (given indirectly)', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'foo <- function() return(function() 3)\nfoo()()', { mark: new Set([12, '12->4']) }))}
|
|
364
357
|
|
|
365
358
|
${(0, doc_structure_1.block)({
|
|
366
359
|
type: 'NOTE',
|
|
367
360
|
content: `Now you might be asking yourself how to differentiate anonymous and named functions and what you have to keep in mind when working with them?
|
|
368
361
|
|
|
369
362
|
Unnamed functions have an array of signatures which you can use to identify them.
|
|
370
|
-
But in short: the \`origin\` attribute of the ${
|
|
363
|
+
But in short: the \`origin\` attribute of the ${ctx.link('DataflowGraphVertexFunctionCall')} is \`${unnamed_call_handling_1.UnnamedFunctionCallOrigin}\`.
|
|
371
364
|
Please be aware that unnamed functions still have a \`name\` property to give it a unique identifier that can be used for debugging and reference.
|
|
372
365
|
This name _always_ starts with \`${unnamed_call_handling_1.UnnamedFunctionCallPrefix}\`.
|
|
373
366
|
|
|
@@ -379,39 +372,38 @@ To know which function is called, please rely on the ${linkEdgeName(edge_1.EdgeT
|
|
|
379
372
|
|
|
380
373
|
Another interesting case is a function with **side effects**, most prominently with the super-assignment \`<<-\`.
|
|
381
374
|
In this case, you may encounter the ${linkEdgeName(edge_1.EdgeType.SideEffectOnCall)} as exemplified below.
|
|
382
|
-
${(0, doc_structure_1.details)('Example: Function Call with a Side-Effect', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
375
|
+
${(0, doc_structure_1.details)('Example: Function Call with a Side-Effect', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() x <<- 3\n f()', { mark: new Set([8, '1->8']) }))}
|
|
383
376
|
|
|
384
377
|
`,
|
|
385
378
|
code: 'foo()',
|
|
386
379
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().call('1@foo', 'foo', [])
|
|
387
380
|
}, []]);
|
|
388
381
|
vertexExplanations.set(vertex_1.VertexType.VariableDefinition, [{
|
|
389
|
-
shell,
|
|
390
382
|
name: 'Variable Definition Vertex',
|
|
391
383
|
type: vertex_1.VertexType.VariableDefinition,
|
|
392
384
|
description: `
|
|
393
385
|
Defined variables most commonly occur in the context of an assignment, for example, with the \`<-\` operator as shown above.
|
|
394
386
|
|
|
395
|
-
${(0, doc_structure_1.details)('Example: Super Definition (<code><<-</code>)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
387
|
+
${(0, doc_structure_1.details)('Example: Super Definition (<code><<-</code>)', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <<- 1', { mark: new Set([0]) }))}
|
|
396
388
|
|
|
397
389
|
The implementation is relatively sparse and similar to the other marker vertices:
|
|
398
390
|
|
|
399
|
-
${
|
|
391
|
+
${ctx.hierarchy('DataflowGraphVertexVariableDefinition')}
|
|
400
392
|
|
|
401
393
|
Of course, there are not just operators that define variables, but also functions, like \`assign\`.
|
|
402
394
|
|
|
403
|
-
${(0, doc_structure_1.details)('Example: Using <code>assign</code>', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
395
|
+
${(0, doc_structure_1.details)('Example: Using <code>assign</code>', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'assign("x", 1)\nx', { mark: new Set([1]) })
|
|
404
396
|
+ `\nThe example may be misleading as the visualization uses \`${node_id_1.recoverName.name}\` to print the lexeme of the variable. However, this actually defines the variable \`x\` (without the quotes) as you can see with the ${linkEdgeName(edge_1.EdgeType.Reads)} edge.`)}
|
|
405
397
|
|
|
406
398
|
Please be aware, that the name of the symbol defined may differ from what you read in the program as R allows the assignments to strings, escaped names, and more:
|
|
407
399
|
|
|
408
|
-
${(0, doc_structure_1.details)('Example: Assigning with an Escaped Name', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
409
|
-
${(0, doc_structure_1.details)('Example: Assigning with a String', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
400
|
+
${(0, doc_structure_1.details)('Example: Assigning with an Escaped Name', await (0, doc_dfg_1.printDfGraphForCode)(parser, '`x` <- 1\nx', { mark: new Set([0]) }))}
|
|
401
|
+
${(0, doc_structure_1.details)('Example: Assigning with a String', await (0, doc_dfg_1.printDfGraphForCode)(parser, '"x" <- 1\nx', { mark: new Set([0]) }))}
|
|
410
402
|
|
|
411
403
|
Definitions may be constrained by conditionals (_flowR_ takes care of calculating the dominating front for you).
|
|
412
404
|
|
|
413
405
|
${(0, doc_structure_1.details)('Conditional Assignments', await (async () => {
|
|
414
|
-
const constrainedDefinitions = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
406
|
+
const constrainedDefinitions = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 0\nif(u) x <- 1 else x <- 2\nx', { exposeResult: true });
|
|
415
407
|
const [text, info] = constrainedDefinitions;
|
|
416
408
|
const finalEnvironment = (0, doc_env_1.printEnvironmentToMarkdown)(info.dataflow.environment.current);
|
|
417
409
|
return `
|
|
@@ -430,18 +422,17 @@ As you can see, _flowR_ is able to recognize that the initial definition of \`x\
|
|
|
430
422
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().defineVariable('1@x', 'x')
|
|
431
423
|
}, []]);
|
|
432
424
|
vertexExplanations.set(vertex_1.VertexType.FunctionDefinition, [{
|
|
433
|
-
shell,
|
|
434
425
|
name: 'Function Definition Vertex',
|
|
435
426
|
type: vertex_1.VertexType.FunctionDefinition,
|
|
436
427
|
description: `
|
|
437
428
|
Defining a function does do a lot of things: 1) it creates a new scope, 2) it may introduce parameters which act as promises and which are only evaluated if they are actually required in the body, 3) it may access the enclosing environments and the callstack.
|
|
438
429
|
The vertex object in the dataflow graph stores multiple things, including all exit points, the enclosing environment if necessary, and the information of the subflow (the "body" of the function).
|
|
439
430
|
|
|
440
|
-
${
|
|
431
|
+
${ctx.hierarchy('DataflowGraphVertexFunctionDefinition')}
|
|
441
432
|
The subflow is defined like this:
|
|
442
|
-
${
|
|
433
|
+
${ctx.hierarchy('DataflowFunctionFlowInformation')}
|
|
443
434
|
And if you are interested in the exit points, they are defined like this:
|
|
444
|
-
${
|
|
435
|
+
${ctx.hierarchy('ExitPoint')}
|
|
445
436
|
|
|
446
437
|
|
|
447
438
|
Whenever we visualize a function definition, we use a dedicated node to represent the anonymous function object,
|
|
@@ -457,7 +448,7 @@ the actual dataflow graph is flat, and you can query all root vertices (i.e., th
|
|
|
457
448
|
vertices of function definitions or not (e.g., \`${new graph_1.DataflowGraph(undefined).vertices.name}\`)
|
|
458
449
|
|
|
459
450
|
${(0, doc_structure_1.details)('Example: Nested Function Definitions', await (async () => {
|
|
460
|
-
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
451
|
+
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() { g <- function() 3 }', { mark: new Set([9, 6]), exposeResult: true });
|
|
461
452
|
const definitions = info.dataflow.graph.vertices(true)
|
|
462
453
|
.filter(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition)
|
|
463
454
|
.map(([id, vertex]) => `| \`${id}\` | { \`${[...vertex.subflow.graph].join('`, `')}\` } |`)
|
|
@@ -480,8 +471,8 @@ However, you can use the [normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normal
|
|
|
480
471
|
|
|
481
472
|
${(0, doc_structure_1.details)('Example: Parameters of a Function', await (async () => {
|
|
482
473
|
const code = 'f <- function(x, y = 3) x + y';
|
|
483
|
-
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
484
|
-
const ast = await (0, doc_normalized_ast_1.printNormalizedAstForCode)(
|
|
474
|
+
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([10, 1, 3]), exposeResult: true });
|
|
475
|
+
const ast = await (0, doc_normalized_ast_1.printNormalizedAstForCode)(parser, code, { prefix: 'flowchart LR\n', showCode: false });
|
|
485
476
|
const functionDefinition = [...info.dataflow.graph.vertices(true)].find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition);
|
|
486
477
|
(0, assert_1.guard)(functionDefinition !== undefined, () => `Could not find function definition for ${code}`);
|
|
487
478
|
const [id] = functionDefinition;
|
|
@@ -502,7 +493,7 @@ ${ast}
|
|
|
502
493
|
|
|
503
494
|
Last but not least, please keep in mind that R offers another way of writing anonymous functions (using the backslash):
|
|
504
495
|
|
|
505
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
496
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(parser, '\\(x) x + 1', { switchCodeAndGraph: true })}
|
|
506
497
|
|
|
507
498
|
Besides this being a theoretically "shorter" way of defining a function, this behaves similarly to the use of \`function\`.
|
|
508
499
|
|
|
@@ -516,14 +507,13 @@ Besides this being a theoretically "shorter" way of defining a function, this be
|
|
|
516
507
|
const get = vertexExplanations.get(vertex);
|
|
517
508
|
(0, assert_1.guard)(get !== undefined, () => `No explanation for vertex type ${vertex}`);
|
|
518
509
|
const [expl, subExplanations] = get;
|
|
519
|
-
results.push(await explanation(expl, ++i, ...subExplanations));
|
|
510
|
+
results.push(await explanation(expl, parser, ++i, ...subExplanations));
|
|
520
511
|
}
|
|
521
512
|
return results.join('\n');
|
|
522
513
|
}
|
|
523
|
-
async function getEdgesExplanations(
|
|
514
|
+
async function getEdgesExplanations(parser, ctx) {
|
|
524
515
|
const edgeExplanations = new Map();
|
|
525
516
|
edgeExplanations.set(edge_1.EdgeType.Reads, [{
|
|
526
|
-
shell,
|
|
527
517
|
name: 'Reads Edge',
|
|
528
518
|
type: edge_1.EdgeType.Reads,
|
|
529
519
|
description: `
|
|
@@ -534,20 +524,20 @@ ${(0, doc_structure_1.block)({
|
|
|
534
524
|
content: `
|
|
535
525
|
A ${linkEdgeName(edge_1.EdgeType.Reads)} edge is not a transitive closure and only links the "directly read" definition(s).
|
|
536
526
|
Our abstract domains resolving transitive ${linkEdgeName(edge_1.EdgeType.Reads)} edges (and for that matter, following ${linkEdgeName(edge_1.EdgeType.Returns)} as well)
|
|
537
|
-
are currently tailored to what we need in _flowR_. Hence, we offer a function like ${
|
|
538
|
-
as well as ${
|
|
539
|
-
Refer to ${
|
|
527
|
+
are currently tailored to what we need in _flowR_. Hence, we offer a function like ${ctx.link(linker_1.getAllFunctionCallTargets)},
|
|
528
|
+
as well as ${ctx.link(resolve_by_name_1.resolvesToBuiltInConstant)} which do this for specific cases.
|
|
529
|
+
Refer to ${ctx.link(dfg_get_origin_1.getOriginInDfg)} for a more general solution, as explained in [working with the dataflow graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph#working-with-the-dataflow-graph).
|
|
540
530
|
|
|
541
|
-
${(0, doc_structure_1.details)('Example: Multi-Level Reads', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
531
|
+
${(0, doc_structure_1.details)('Example: Multi-Level Reads', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 3\ny <- x\nprint(y)', { mark: new Set(['9->7', '7->3', '4->0']) }))}
|
|
542
532
|
|
|
543
533
|
Similarly, ${linkEdgeName(edge_1.EdgeType.Reads)} can be cyclic, for example in the context of loops:
|
|
544
534
|
|
|
545
|
-
${(0, doc_structure_1.details)('Example: Cyclic Reads', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
535
|
+
${(0, doc_structure_1.details)('Example: Cyclic Reads', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'for(i in v) x <- x + 1', { mark: new Set(['3->2']) }))}
|
|
546
536
|
`
|
|
547
537
|
})}
|
|
548
538
|
|
|
549
539
|
Reads edges may point to built-in definitions as well, to signal that something relates to a built-in element of flowR.
|
|
550
|
-
Their targets are not part of the ${
|
|
540
|
+
Their targets are not part of the ${ctx.link(graph_1.DataflowGraph)} but only markers to signal that the respective definition is a built-in.
|
|
551
541
|
|
|
552
542
|
|
|
553
543
|
Please refer to the explanation of the respective vertices for more information.
|
|
@@ -566,12 +556,11 @@ Please refer to the explanation of the respective vertices for more information.
|
|
|
566
556
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().reads('1:20', '1@x')
|
|
567
557
|
}]]);
|
|
568
558
|
edgeExplanations.set(edge_1.EdgeType.DefinedBy, [{
|
|
569
|
-
shell,
|
|
570
559
|
name: 'DefinedBy Edge', /* concat for link generation */
|
|
571
560
|
type: edge_1.EdgeType.DefinedBy,
|
|
572
561
|
description: `
|
|
573
562
|
The source vertex is usually a [\`variable definition\`](#variable-definition-vertex) linking the defined symbol to the entry point of the resulting side.
|
|
574
|
-
${(0, doc_structure_1.details)('In general, this does not have to be the right hand side of the operator.', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
563
|
+
${(0, doc_structure_1.details)('In general, this does not have to be the right hand side of the operator.', await (0, doc_dfg_1.printDfGraphForCode)(parser, '3 -> x', { mark: new Set([0]) }))}
|
|
575
564
|
|
|
576
565
|
However, nested definitions can carry it (in the nested case, \`x\` is defined by the return value of <code>\\\`<-\\\`(y, z)</code>). Additionally, we link the assignment function.
|
|
577
566
|
|
|
@@ -590,16 +579,14 @@ However, nested definitions can carry it (in the nested case, \`x\` is defined b
|
|
|
590
579
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().definedBy('1@x', '1:8')
|
|
591
580
|
}]]);
|
|
592
581
|
edgeExplanations.set(edge_1.EdgeType.Calls, [{
|
|
593
|
-
shell,
|
|
594
582
|
name: 'Calls Edge',
|
|
595
583
|
type: edge_1.EdgeType.Calls,
|
|
596
584
|
description: `Link the [function call](#function-call-vertex) to the [function definition](#function-definition-vertex) that is called. To find all called definitions,
|
|
597
|
-
please use the ${
|
|
585
|
+
please use the ${ctx.link(dfg_get_origin_1.getOriginInDfg.name)} function, as explained in [working with the dataflow graph](${doc_files_1.FlowrWikiBaseRef}/Working%20with%20the%20Dataflow%20Graph).`,
|
|
598
586
|
code: 'foo <- function() {}\nfoo()',
|
|
599
587
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().calls('2@foo', '1@function')
|
|
600
588
|
}, []]);
|
|
601
589
|
edgeExplanations.set(edge_1.EdgeType.Returns, [{
|
|
602
|
-
shell,
|
|
603
590
|
name: 'Returns Edge',
|
|
604
591
|
type: edge_1.EdgeType.Returns,
|
|
605
592
|
description: `Link the [function call](#function-call-vertex) to the exit points of the target definition (this may incorporate the call-context).
|
|
@@ -607,17 +594,17 @@ As you can see in the example, this happens for user-defined functions (like \`f
|
|
|
607
594
|
However, these edges are specific to scenarios in which flowR knows that a specific element is returned.
|
|
608
595
|
For contrast, compare this to a use of, for example, \`+\`:
|
|
609
596
|
|
|
610
|
-
${(0, doc_structure_1.details)('Example: No returns edge for +', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
597
|
+
${(0, doc_structure_1.details)('Example: No returns edge for +', await (0, doc_dfg_1.printDfGraphForCode)(parser, '1 + 1'))}
|
|
611
598
|
|
|
612
599
|
Here, we do not get a ${linkEdgeName(edge_1.EdgeType.Returns)} edge as this function call creates a new value based on its arguments.
|
|
613
|
-
In these scenarios you should rely on the \`args\` property of the ${
|
|
600
|
+
In these scenarios you should rely on the \`args\` property of the ${ctx.link('DataflowGraphVertexFunctionCall')}
|
|
614
601
|
and use the arguments to calculate what you need to know. Alternatively, you can track the ${linkEdgeName(edge_1.EdgeType.Argument)} edges.
|
|
615
602
|
|
|
616
603
|
In general, the ${linkEdgeName(edge_1.EdgeType.Returns)} edge already does most of the heavy lifting for you, by respecting control flow influences and
|
|
617
604
|
(as long as flowR is able to detect it) dead code.
|
|
618
605
|
|
|
619
606
|
${(0, doc_structure_1.details)('Example: Tricky Returns', `We show the _simplified_ DFG for simplicity and highlight all ${linkEdgeName(edge_1.EdgeType.Returns)} edges involved in tracking the return of a call to \`f\` (as ${linkEdgeName(edge_1.EdgeType.Returns)} are never transitive and must hence be followed):\n` +
|
|
620
|
-
await (0, doc_dfg_1.printDfGraphForCode)(
|
|
607
|
+
await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() { if(u) { return(3); 2 } else 42 }\nf()', {
|
|
621
608
|
simplified: true,
|
|
622
609
|
mark: new Set(['19->15', '15->14', '14->12', '14->11', '11->9', '9->7'])
|
|
623
610
|
})
|
|
@@ -642,9 +629,8 @@ f <- function() x
|
|
|
642
629
|
x <- 3
|
|
643
630
|
f()
|
|
644
631
|
`.trim();
|
|
645
|
-
const dfInfo = await (0, doc_dfg_1.printDfGraphForCode)(
|
|
632
|
+
const dfInfo = await (0, doc_dfg_1.printDfGraphForCode)(parser, lateBindingExample, { switchCodeAndGraph: true, codeOpen: true, mark: new Set([1, '1->5', '9->5']) });
|
|
646
633
|
edgeExplanations.set(edge_1.EdgeType.DefinesOnCall, [{
|
|
647
|
-
shell,
|
|
648
634
|
name: 'DefinesOnCall Edge',
|
|
649
635
|
type: edge_1.EdgeType.DefinesOnCall,
|
|
650
636
|
description: `*This edge is usually joined with ${linkEdgeName(edge_1.EdgeType.DefinedByOnCall)}!*
|
|
@@ -668,7 +654,6 @@ ${dfInfo}
|
|
|
668
654
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().definesOnCall('$11', '$1').definedByOnCall('$1', '$11')
|
|
669
655
|
}, []]);
|
|
670
656
|
edgeExplanations.set(edge_1.EdgeType.DefinedByOnCall, [{
|
|
671
|
-
shell,
|
|
672
657
|
name: 'DefinedByOnCall Edge',
|
|
673
658
|
type: edge_1.EdgeType.DefinedByOnCall,
|
|
674
659
|
description: `*This edge is usually joined with ${linkEdgeName(edge_1.EdgeType.DefinesOnCall)}!*
|
|
@@ -678,7 +663,6 @@ ${dfInfo}
|
|
|
678
663
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().definesOnCall('$11', '$1').definedByOnCall('$1', '$11')
|
|
679
664
|
}, []]);
|
|
680
665
|
edgeExplanations.set(edge_1.EdgeType.Argument, [{
|
|
681
|
-
shell,
|
|
682
666
|
name: 'Argument Edge',
|
|
683
667
|
type: edge_1.EdgeType.Argument,
|
|
684
668
|
description: `Links a [function call](#function-call-vertex) to the entry point of its arguments. If we do not know the target of such a call, we automatically assume that all arguments are read by the call as well!
|
|
@@ -689,7 +673,6 @@ The exception to this is the [function definition](#function-definition-vertex)
|
|
|
689
673
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().argument('1@f', '1@x').reads('1@f', '1@x').argument('1@f', '1@y').reads('1@f', '1@y')
|
|
690
674
|
}, []]);
|
|
691
675
|
edgeExplanations.set(edge_1.EdgeType.SideEffectOnCall, [{
|
|
692
|
-
shell,
|
|
693
676
|
name: 'SideEffectOnCall Edge',
|
|
694
677
|
type: edge_1.EdgeType.SideEffectOnCall,
|
|
695
678
|
description: 'Links a global side effect to an affected function call (e.g., a super definition within the function body)',
|
|
@@ -697,7 +680,6 @@ The exception to this is the [function definition](#function-definition-vertex)
|
|
|
697
680
|
expectedSubgraph: (0, dataflowgraph_builder_1.emptyGraph)().sideEffectOnCall('1@x', '2@f')
|
|
698
681
|
}, []]);
|
|
699
682
|
edgeExplanations.set(edge_1.EdgeType.NonStandardEvaluation, [{
|
|
700
|
-
shell,
|
|
701
683
|
name: 'NonStandardEvaluation Edge',
|
|
702
684
|
type: edge_1.EdgeType.NonStandardEvaluation,
|
|
703
685
|
description: `
|
|
@@ -714,9 +696,8 @@ Yet, you may choose to follow these references for other queries. For now, _flow
|
|
|
714
696
|
Besides the obvious quotation there are other cases in which _flowR_ may choose to create a ${linkEdgeName(edge_1.EdgeType.NonStandardEvaluation)} edge, there are
|
|
715
697
|
some that may appear to be counter-intuitive. For example, a for-loop body, as in the following example.
|
|
716
698
|
|
|
717
|
-
${(0, doc_structure_1.details)('Example: For-Loop Body', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
718
|
-
${(0, doc_structure_1.details)('Example: While-Loop Body', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
719
|
-
|
|
699
|
+
${(0, doc_structure_1.details)('Example: For-Loop Body', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'for(i in v) b', { mark: new Set([2, '4->2']) }))}
|
|
700
|
+
${(0, doc_structure_1.details)('Example: While-Loop Body', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'while(TRUE) b', { mark: new Set([1, '3->1']) }))}
|
|
720
701
|
`
|
|
721
702
|
})}
|
|
722
703
|
`,
|
|
@@ -737,33 +718,28 @@ ${(0, doc_structure_1.details)('Example: While-Loop Body', await (0, doc_dfg_1.p
|
|
|
737
718
|
const get = edgeExplanations.get(edge);
|
|
738
719
|
(0, assert_1.guard)(get !== undefined, () => `No explanation for edge type ${edge}`);
|
|
739
720
|
const [expl, subExplanations] = get;
|
|
740
|
-
results.push(`<a id='${edgeTypeToId(edge)}'></a>` + await explanation(expl, ++i, ...subExplanations));
|
|
721
|
+
results.push(`<a id='${edgeTypeToId(edge)}'></a>` + await explanation(expl, parser, ++i, ...subExplanations));
|
|
741
722
|
}
|
|
742
723
|
return results.join('\n');
|
|
743
724
|
}
|
|
744
725
|
async function dummyDataflow() {
|
|
745
|
-
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder(
|
|
726
|
+
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().build();
|
|
727
|
+
analyzer.addRequest('x <- 1\nx + 1');
|
|
746
728
|
const result = await analyzer.dataflow();
|
|
747
729
|
analyzer.close();
|
|
748
730
|
return result;
|
|
749
731
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
})
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
inlineTypes: ['MergeableRecord']
|
|
762
|
-
});
|
|
763
|
-
return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'dataflow graph', rVersion: rversion })}
|
|
764
|
-
|
|
765
|
-
This page briefly summarizes flowR's dataflow graph, represented by the ${(0, doc_types_1.shortLink)(graph_1.DataflowGraph.name, vertexType.info)} class within the code.
|
|
766
|
-
In case you want to manually build such a graph (e.g., for testing), you can use the ${(0, doc_types_1.shortLink)(dataflowgraph_builder_1.DataflowGraphBuilder.name, vertexType.info)}.
|
|
732
|
+
/**
|
|
733
|
+
* https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph
|
|
734
|
+
*/
|
|
735
|
+
class WikiDataflowGraph extends doc_maker_1.DocMaker {
|
|
736
|
+
constructor() {
|
|
737
|
+
super('wiki/Dataflow Graph.md', module.filename, 'dataflow graph');
|
|
738
|
+
}
|
|
739
|
+
async text({ ctx, treeSitter }) {
|
|
740
|
+
return `
|
|
741
|
+
This page briefly summarizes flowR's dataflow graph, represented by the ${ctx.link(graph_1.DataflowGraph)} class within the code.
|
|
742
|
+
In case you want to manually build such a graph (e.g., for testing), you can use the ${ctx.link(dataflowgraph_builder_1.DataflowGraphBuilder)}.
|
|
767
743
|
If you are interested in which features we support and which features are still to be worked on, please refer to our [capabilities](${doc_files_1.FlowrWikiBaseRef}/Capabilities) page.
|
|
768
744
|
In summary, we discuss the following topics:
|
|
769
745
|
|
|
@@ -774,7 +750,7 @@ In summary, we discuss the following topics:
|
|
|
774
750
|
- [Unknown Side Effects](#unknown-side-effects)
|
|
775
751
|
- [Working with the Dataflow Graph](#dfg-working)
|
|
776
752
|
|
|
777
|
-
Please be aware that the accompanied [dataflow information](#dataflow-information) (${
|
|
753
|
+
Please be aware that the accompanied [dataflow information](#dataflow-information) (${ctx.link('DataflowInformation')}) returned by _flowR_ contains things besides the graph,
|
|
778
754
|
like the entry and exit points of the subgraphs, and currently active references (see [below](#dataflow-information)).
|
|
779
755
|
Additionally, you may be interested in the set of [Unknown Side Effects](#unknown-side-effects), marking calls which _flowR_ is unable to handle correctly.
|
|
780
756
|
|
|
@@ -788,9 +764,11 @@ wiki page if you are unsure.
|
|
|
788
764
|
> There is also a simplified perspective available with ${(0, doc_cli_option_1.getReplCommand)('dataflowsimple*')} that does not show everything but is easier to read.
|
|
789
765
|
> When using _flowR_ as a library, you may use the functions in ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}.
|
|
790
766
|
>
|
|
791
|
-
> If you receive a dataflow graph in its serialized form (e.g., by talking to a [_flowR_ server](${doc_files_1.FlowrWikiBaseRef}/Interface)), you can use ${
|
|
767
|
+
> If you receive a dataflow graph in its serialized form (e.g., by talking to a [_flowR_ server](${doc_files_1.FlowrWikiBaseRef}/Interface)), you can use ${ctx.link(`${graph_1.DataflowGraph.name}::${graph_1.DataflowGraph.fromJson.name}`, { realNameWrapper: 'i', codeFont: true })} to retrieve the graph from the JSON representation.
|
|
768
|
+
>
|
|
769
|
+
> Also, check out the [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-df-diff](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-df-diff) repository for a complete example project creating and comparing dataflow graphs.
|
|
792
770
|
|
|
793
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
771
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'x <- 3\ny <- x + 1\ny')}
|
|
794
772
|
|
|
795
773
|
|
|
796
774
|
The above dataflow graph showcases the general gist. We define a dataflow graph as a directed graph G = (V, E), differentiating between ${(0, doc_data_dfg_util_1.getAllVertices)().length} types of vertices V and
|
|
@@ -806,7 +784,7 @@ The following vertices types exist:
|
|
|
806
784
|
|
|
807
785
|
1. ${(0, doc_data_dfg_util_1.getAllVertices)().map(([k, v], index) => `[\`${k}\`](#${index + 1}-${v.toLowerCase().replace(/\s/g, '-')}-vertex)`).join('\n1. ')}
|
|
808
786
|
|
|
809
|
-
${
|
|
787
|
+
${(0, doc_structure_1.details)('Class Diagram', 'All boxes should link to their respective implementation:\n' + (0, doc_code_1.codeBlock)('mermaid', ctx.mermaid('DataflowGraphVertexInfo', ['MergeableRecord'])))}
|
|
810
788
|
|
|
811
789
|
</details>
|
|
812
790
|
|
|
@@ -818,7 +796,7 @@ The following edges types exist, internally we use bitmasks to represent multipl
|
|
|
818
796
|
|
|
819
797
|
1. ${(0, doc_data_dfg_util_1.getAllEdges)().map(([k, v], index) => `[\`${k}\` (${v})](#${index + 1}-${k.toLowerCase().replace(/\s/g, '-')}-edge)`).join('\n1. ')}
|
|
820
798
|
|
|
821
|
-
${
|
|
799
|
+
${(0, doc_structure_1.details)('Class Diagram', 'All boxes should link to their respective implementation:\n' + (0, doc_code_1.codeBlock)('mermaid', ctx.mermaid('EdgeType', ['MergeableRecord'])))}
|
|
822
800
|
|
|
823
801
|
</details>
|
|
824
802
|
|
|
@@ -830,9 +808,9 @@ The following sections present details on the different types of vertices and ed
|
|
|
830
808
|
> [!NOTE]
|
|
831
809
|
> Every dataflow vertex holds an \`id\` which links it to the respective node in the [normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized-AST).
|
|
832
810
|
> So if you want more information about the respective vertex, you can usually access more information
|
|
833
|
-
> using the <code>${
|
|
811
|
+
> using the <code>${ctx.link(`${graph_1.DataflowGraph.name}`, { codeFont: false, realNameWrapper: 'i' })}::idMap</code> linked to the dataflow graph:
|
|
834
812
|
${(0, doc_general_1.prefixLines)((0, doc_code_1.codeBlock)('ts', 'const node = graph.idMap.get(id);'), '> ')}
|
|
835
|
-
> In case you just need the name (\`lexeme\`) of the respective vertex, ${
|
|
813
|
+
> In case you just need the name (\`lexeme\`) of the respective vertex, ${ctx.link(node_id_1.recoverName)} can help you out:
|
|
836
814
|
${(0, doc_general_1.prefixLines)((0, doc_code_1.codeBlock)('ts', `const name = ${node_id_1.recoverName.name}(id, graph.idMap);`), '> ')}
|
|
837
815
|
>
|
|
838
816
|
> Please note, that not every node in the [normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized-AST) is represented in the dataflow graph.
|
|
@@ -846,32 +824,32 @@ ${(0, doc_structure_1.section)('Vertices', 2, 'vertices')}
|
|
|
846
824
|
|
|
847
825
|
1. ${(0, doc_data_dfg_util_1.getAllVertices)().map(([k, v], index) => `[\`${k}\`](#${index + 1}-${v.toLowerCase().replace(/\s/g, '-')}-vertex)`).join('\n1. ')}
|
|
848
826
|
|
|
849
|
-
${await getVertexExplanations(
|
|
827
|
+
${await getVertexExplanations(treeSitter, ctx)}
|
|
850
828
|
|
|
851
829
|
${(0, doc_structure_1.section)('Edges', 2, 'edges')}
|
|
852
830
|
|
|
853
831
|
1. ${(0, doc_data_dfg_util_1.getAllEdges)().map(([k, v], index) => `[\`${k}\` (${v})](#${index + 1}-${k.toLowerCase().replace(/\s/g, '-')}-edge)`).join('\n1. ')}
|
|
854
832
|
|
|
855
|
-
${await getEdgesExplanations(
|
|
833
|
+
${await getEdgesExplanations(treeSitter, ctx)}
|
|
856
834
|
|
|
857
835
|
${(0, doc_structure_1.section)('Control Dependencies', 2, 'control-dependencies')}
|
|
858
836
|
|
|
859
837
|
Each vertex may have a list of active control dependencies.
|
|
860
|
-
They hold the ${
|
|
838
|
+
They hold the ${ctx.link('NodeId')} of all nodes that effect if the current vertex is part of the execution or not,
|
|
861
839
|
and a boolean flag \`when\` to indicate if the control dependency is active when the condition is \`true\` or \`false\`.
|
|
862
840
|
|
|
863
841
|
As an example, consider the following dataflow graph:
|
|
864
842
|
|
|
865
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
843
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'if(p) a else b')}
|
|
866
844
|
|
|
867
845
|
Whenever we visualize a graph, we represent the control dependencies as grayed out edges with a \`CD\` prefix, followed
|
|
868
846
|
by the \`when\` flag.
|
|
869
847
|
In the above example, both \`a\` and \`b\` depend on the \`if\`. Please note that they are _not_ linked to the result of
|
|
870
848
|
the condition itself as this is the more general linkage point (and harmonizes with other control structures, especially those which are user-defined).
|
|
871
849
|
|
|
872
|
-
${(0, doc_structure_1.details)('Example: Multiple Vertices (Assignment)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
873
|
-
${(0, doc_structure_1.details)('Example: Multiple Vertices (Arithmetic Expression)', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
874
|
-
${(0, doc_structure_1.details)('Example: Nested Conditionals', await (0, doc_dfg_1.printDfGraphForCode)(
|
|
850
|
+
${(0, doc_structure_1.details)('Example: Multiple Vertices (Assignment)', await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'if(p) a <- 1'))}
|
|
851
|
+
${(0, doc_structure_1.details)('Example: Multiple Vertices (Arithmetic Expression)', await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'if(p) 3 + 2'))}
|
|
852
|
+
${(0, doc_structure_1.details)('Example: Nested Conditionals', await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'if(x) { if(y) a else b } else c'))}
|
|
875
853
|
|
|
876
854
|
|
|
877
855
|
${(0, doc_structure_1.section)('Dataflow Information', 2, 'dataflow-information')}
|
|
@@ -898,9 +876,9 @@ ${(0, doc_code_1.codeBlock)('ts', dummyDataflow.toString())}
|
|
|
898
876
|
Now, you can find the dataflow _information_ with \`result.dataflow\`. More specifically, the graph is stored in \`result.dataflow.graph\` and looks like this:
|
|
899
877
|
|
|
900
878
|
${await (async () => {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
879
|
+
const result = await dummyDataflow();
|
|
880
|
+
const dfGraphString = (0, doc_dfg_1.printDfGraph)(result.graph);
|
|
881
|
+
return `
|
|
904
882
|
${dfGraphString}
|
|
905
883
|
|
|
906
884
|
However, the dataflow information contains more, quite a lot of information in fact.
|
|
@@ -916,15 +894,15 @@ ${(0, doc_code_1.codeBlock)('text', JSON.stringify(result, json_1.jsonReplacer))
|
|
|
916
894
|
|
|
917
895
|
You may be interested in its implementation:
|
|
918
896
|
|
|
919
|
-
${
|
|
897
|
+
${ctx.hierarchy('DataflowInformation')}
|
|
920
898
|
|
|
921
899
|
Let's start by looking at the properties of the dataflow information object: ${Object.keys(result).map(k => `\`${k}\``).join(', ')}.
|
|
922
900
|
|
|
923
901
|
${(() => {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
902
|
+
/* this includes the meta field for timing and the quick CFG in order to enable re-use and improve performance */
|
|
903
|
+
(0, assert_1.guard)(Object.keys(result).length === 9, () => 'Update Dataflow Documentation!');
|
|
904
|
+
return '';
|
|
905
|
+
})()}
|
|
928
906
|
|
|
929
907
|
There are three sets of references.
|
|
930
908
|
**in** (ids: ${JSON.stringify(new Set(result.in.map(n => n.nodeId)), json_1.jsonReplacer)}) and **out** (ids: ${JSON.stringify(new Set(result.out.map(n => n.nodeId)), json_1.jsonReplacer)}) contain the
|
|
@@ -951,7 +929,7 @@ In case _flowR_ encounters a function call that it cannot handle, it marks the c
|
|
|
951
929
|
You can find these as part of the dataflow graph, specifically as \`unknownSideEffects\` (with a leading underscore if sesrialized as JSON).
|
|
952
930
|
In the following graph, _flowR_ realizes that it is unable to correctly handle the impacts of the \`load\` call and therefore marks it as such (marked in bright red):
|
|
953
931
|
|
|
954
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
932
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'load("file")\nprint(x + y)')}
|
|
955
933
|
|
|
956
934
|
In general, as we cannot handle these correctly, we leave it up to other analyses (and [queries](${doc_files_1.FlowrWikiBaseRef}/Query%20API)) to handle these cases
|
|
957
935
|
as they see fit.
|
|
@@ -963,27 +941,27 @@ Consider R's basic [\`graphics\`](https://www.rdocumentation.org/packages/graphi
|
|
|
963
941
|
implicitly draws on the current device and does not explicitly link a function like \`points\` to the last call opening a new graphic device. In such a scenario, we use a linked side effect to mark the relation:
|
|
964
942
|
|
|
965
943
|
${await (async () => {
|
|
966
|
-
|
|
967
|
-
|
|
944
|
+
const [result, df] = await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'plot(data)\npoints(data2)', { exposeResult: true });
|
|
945
|
+
return `
|
|
968
946
|
${result}
|
|
969
947
|
|
|
970
948
|
Such side effects are not marked explicitly (with a big edge) but they are part of the unknown side effects: [${[...df.dataflow.graph.unknownSideEffects].map(doc_dfg_1.formatSideEffect).join(',')}].
|
|
971
949
|
Additionally, we express this by a ${linkEdgeName(edge_1.EdgeType.Reads)} edge.
|
|
972
950
|
`;
|
|
973
|
-
|
|
951
|
+
})()}
|
|
974
952
|
|
|
975
953
|
${(0, doc_structure_1.section)('Working with the Dataflow Graph', 2, 'dfg-working')}
|
|
976
954
|
|
|
977
|
-
The ${
|
|
955
|
+
The ${ctx.link('DataflowInformation')} is the core result of _flowR_ and summarizes a lot of information.
|
|
978
956
|
Depending on what you are interested in, there exists a plethora of functions and queries to help you out, answering the most important questions:
|
|
979
957
|
|
|
980
958
|
* The **[Query API](${doc_files_1.FlowrWikiBaseRef}/Query%20API)** provides many functions to query the dataflow graph for specific information (dependencies, calls, slices, clusters, ...)
|
|
981
959
|
* The **[Search API](${doc_files_1.FlowrWikiBaseRef}/Search%20API)** allows you to search for specific vertices or edges in the dataflow graph or the original program
|
|
982
|
-
* ${
|
|
983
|
-
* ${
|
|
984
|
-
* ${
|
|
985
|
-
* ${
|
|
986
|
-
* ${
|
|
960
|
+
* ${ctx.link(node_id_1.recoverName.name)} and ${ctx.link(node_id_1.recoverContent.name)} to get the name or content of a vertex in the dataflow graph
|
|
961
|
+
* ${ctx.link(alias_tracking_1.resolveIdToValue.name)} to resolve the value of a variable or id (if possible, see [below](#dfg-resolving-values))
|
|
962
|
+
* ${ctx.link(edge_1.edgeIncludesType.name)} to check if an edge includes a specific type and ${ctx.link(edge_1.splitEdgeTypes.name)} to split the bitmask of edges into its types (see [below](#dfg-resolving-values))
|
|
963
|
+
* ${ctx.link(identify_link_to_last_call_relation_1.getValueOfArgument.name)} to get the (syntactical) value of an argument in a function call
|
|
964
|
+
* ${ctx.link(dfg_get_origin_1.getOriginInDfg.name)} to get information about where a read, call, ... comes from (see [below](#dfg-resolving-values))
|
|
987
965
|
|
|
988
966
|
Some of these functions have been explained in their respective wiki pages. However, some are part of the [Dataflow Graph API](${doc_files_1.FlowrWikiBaseRef}/Dataflow-Graph) and so we explain them here.
|
|
989
967
|
If you are interested in which features we support and which features are still to be worked on, please refer to our [capabilities](${doc_files_1.FlowrWikiBaseRef}/Capabilities) page.
|
|
@@ -993,12 +971,12 @@ ${(0, doc_structure_1.section)('Resolving Values', 3, 'dfg-resolving-values')}
|
|
|
993
971
|
FlowR supports a [configurable](${doc_files_1.FlowrWikiBaseRef}/Interface#configuring-flowr) level of value tracking—all with the goal of knowing the static value domain of a variable.
|
|
994
972
|
These capabilities are exposed by the [resolve value Query](${doc_files_1.FlowrWikiBaseRef}/Query-API#resolve-value-query) and backed by two important functions:
|
|
995
973
|
|
|
996
|
-
${
|
|
974
|
+
${ctx.link(alias_tracking_1.resolveIdToValue.name)} provides an environment-sensitive (see ${ctx.link('REnvironmentInformation')})
|
|
997
975
|
value resolution depending on if the environment is provided.
|
|
998
|
-
The idea of ${
|
|
976
|
+
The idea of ${ctx.link(alias_tracking_1.resolveIdToValue.name)} is to provide a compromise between precision and performance, to
|
|
999
977
|
be used _during_ and _after_ the core analysis. After the dataflow analysis completes, there are much more expensive queries possible (such as the resolution of the data frame shape, see the [Query API](${doc_files_1.FlowrWikiBaseRef}/Query-API)).
|
|
1000
978
|
|
|
1001
|
-
Additionally, to ${
|
|
979
|
+
Additionally, to ${ctx.link(alias_tracking_1.resolveIdToValue.name)}, we offer the aforementioned ${ctx.link(identify_link_to_last_call_relation_1.getValueOfArgument.name)} to retrieve the value of an argument in a function call.
|
|
1002
980
|
Be aware, that this function is currently not optimized for speed, so if you frequently require the values of multiple arguments of the same function call, you may want to open [an issue](${doc_issue_1.NewIssueUrl}) to request support for resolving
|
|
1003
981
|
multiple arguments at once.
|
|
1004
982
|
|
|
@@ -1008,54 +986,46 @@ The [edges](#edges) of the dataflow graph use bitmasks to represent an edge with
|
|
|
1008
986
|
difficult to check whether a given edge is a read edge.
|
|
1009
987
|
Consider the following example:
|
|
1010
988
|
|
|
1011
|
-
${await (0, doc_dfg_1.printDfGraphForCode)(
|
|
989
|
+
${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'print(x)', { mark: new Set(['3->1']) })}
|
|
1012
990
|
|
|
1013
991
|
Retrieving the _types_ of the edge from the print call to its argument returns:
|
|
1014
992
|
${await (async () => {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
993
|
+
const dfg = await (0, default_pipelines_1.createDataflowPipeline)(treeSitter, {
|
|
994
|
+
context: (0, flowr_analyzer_context_1.contextFromInput)('print(x)')
|
|
995
|
+
}).allRemainingSteps();
|
|
996
|
+
const edge = dfg.dataflow.graph.outgoingEdges(3);
|
|
997
|
+
if (edge) {
|
|
998
|
+
const wanted = edge.get(1);
|
|
999
|
+
if (wanted) {
|
|
1000
|
+
return '`' + wanted.types + '`';
|
|
1001
|
+
}
|
|
1023
1002
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
${(0, doc_types_1.shortLink)(edge_1.edgeIncludesType.name, vertexType.info)} to check whether a specific type (or one of a collection of types) is included in the edge.
|
|
1003
|
+
new Error('Could not find edge');
|
|
1004
|
+
})()}—which is usually not very helpful.
|
|
1005
|
+
You can use ${ctx.link(edge_1.splitEdgeTypes.name)} to get the individual bitmasks of all included types, and
|
|
1006
|
+
${ctx.link(edge_1.edgeIncludesType.name)} to check whether a specific type (or one of a collection of types) is included in the edge.
|
|
1029
1007
|
|
|
1030
1008
|
${(0, doc_structure_1.section)('Handling Origins', 3, 'dfg-handling-origins')}
|
|
1031
1009
|
|
|
1032
1010
|
If you are writing another analysis on top of the dataflow graph, you probably want to know all definitions that serve as the source of a read, all functions
|
|
1033
1011
|
that are called by an invocation, and more.
|
|
1034
|
-
For this, the ${
|
|
1012
|
+
For this, the ${ctx.link(dfg_get_origin_1.getOriginInDfg)} function provides you with a collection of ${ctx.link('Origin')} objects:
|
|
1035
1013
|
|
|
1036
|
-
${
|
|
1014
|
+
${ctx.hierarchy('Origin', { openTop: true })}
|
|
1037
1015
|
|
|
1038
1016
|
Their respective uses are documented alongside their implementation:
|
|
1039
1017
|
|
|
1040
|
-
${['SimpleOrigin', 'FunctionCallOrigin', 'BuiltInFunctionOrigin'].sort().map(key => `- ${
|
|
1018
|
+
${['SimpleOrigin', 'FunctionCallOrigin', 'BuiltInFunctionOrigin'].sort().map(key => `- ${ctx.link(key)}\\\n${ctx.doc(key, { type: 'interface' })}`).join('\n')}
|
|
1041
1019
|
|
|
1042
1020
|
Please note, the current structure of this function is biased by what implementations already exist in flowR.
|
|
1043
1021
|
Hence, we do not just track definitions and constants, but also the origins of function calls, albeit we do not yet track the origins of values (only resorting to
|
|
1044
1022
|
a constant origin). If you are confused by this please start a discussion—in a way we are still deciding on a good API for this.
|
|
1045
1023
|
|
|
1046
1024
|
`;
|
|
1047
|
-
|
|
1025
|
+
})()}
|
|
1048
1026
|
|
|
1049
1027
|
`;
|
|
1028
|
+
}
|
|
1050
1029
|
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
(0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
|
|
1054
|
-
const shell = new shell_1.RShell();
|
|
1055
|
-
void getText(shell).then(str => {
|
|
1056
|
-
console.log(str);
|
|
1057
|
-
}).finally(() => {
|
|
1058
|
-
shell.close();
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
//# sourceMappingURL=print-dataflow-graph-wiki.js.map
|
|
1030
|
+
exports.WikiDataflowGraph = WikiDataflowGraph;
|
|
1031
|
+
//# sourceMappingURL=wiki-dataflow-graph.js.map
|