@eagleoutice/flowr 2.4.8 → 2.6.0

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.
Files changed (234) hide show
  1. package/README.md +66 -45
  2. package/benchmark/slicer.js +1 -1
  3. package/benchmark/summarizer/second-phase/graph.js +2 -2
  4. package/cli/flowr.js +3 -29
  5. package/cli/repl/commands/repl-cfg.d.ts +5 -5
  6. package/cli/repl/commands/repl-cfg.js +21 -22
  7. package/cli/repl/commands/repl-commands.d.ts +3 -3
  8. package/cli/repl/commands/repl-commands.js +2 -0
  9. package/cli/repl/commands/repl-dataflow.d.ts +5 -5
  10. package/cli/repl/commands/repl-dataflow.js +27 -30
  11. package/cli/repl/commands/repl-execute.js +1 -0
  12. package/cli/repl/commands/repl-lineage.js +1 -0
  13. package/cli/repl/commands/repl-main.d.ts +34 -3
  14. package/cli/repl/commands/repl-normalize.d.ts +3 -3
  15. package/cli/repl/commands/repl-normalize.js +15 -19
  16. package/cli/repl/commands/repl-parse.d.ts +2 -2
  17. package/cli/repl/commands/repl-parse.js +13 -8
  18. package/cli/repl/commands/repl-query.d.ts +3 -3
  19. package/cli/repl/commands/repl-query.js +29 -19
  20. package/cli/repl/commands/repl-quit.js +1 -0
  21. package/cli/repl/commands/repl-version.js +1 -0
  22. package/cli/repl/core.d.ts +4 -1
  23. package/cli/repl/core.js +21 -1
  24. package/cli/repl/server/connection.d.ts +7 -3
  25. package/cli/repl/server/connection.js +40 -48
  26. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  27. package/cli/slicer-app.js +8 -3
  28. package/config.d.ts +1 -1
  29. package/config.js +4 -1
  30. package/control-flow/extract-cfg.d.ts +1 -1
  31. package/control-flow/extract-cfg.js +1 -1
  32. package/core/pipeline-executor.d.ts +5 -0
  33. package/core/pipeline-executor.js +5 -0
  34. package/core/steps/pipeline/create-pipeline.js +1 -1
  35. package/core/steps/pipeline/default-pipelines.d.ts +42 -42
  36. package/core/steps/pipeline/default-pipelines.js +4 -1
  37. package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
  38. package/dataflow/graph/dataflowgraph-builder.js +6 -6
  39. package/documentation/doc-util/doc-query.d.ts +3 -6
  40. package/documentation/doc-util/doc-query.js +5 -17
  41. package/documentation/doc-util/doc-search.js +7 -10
  42. package/documentation/doc-util/doc-structure.d.ts +4 -0
  43. package/documentation/doc-util/doc-structure.js +28 -0
  44. package/documentation/doc-util/doc-types.d.ts +5 -1
  45. package/documentation/doc-util/doc-types.js +29 -3
  46. package/documentation/print-analyzer-wiki.d.ts +1 -0
  47. package/documentation/print-analyzer-wiki.js +137 -0
  48. package/documentation/print-core-wiki.d.ts +2 -1
  49. package/documentation/print-core-wiki.js +58 -4
  50. package/documentation/print-dataflow-graph-wiki.js +15 -22
  51. package/documentation/print-interface-wiki.js +18 -1
  52. package/documentation/print-linter-wiki.js +5 -1
  53. package/documentation/print-linting-and-testing-wiki.js +4 -0
  54. package/documentation/print-normalized-ast-wiki.js +6 -8
  55. package/documentation/print-readme.js +6 -0
  56. package/engines.d.ts +9 -0
  57. package/engines.js +38 -0
  58. package/linter/linter-executor.d.ts +2 -8
  59. package/linter/linter-executor.js +9 -4
  60. package/linter/linter-format.d.ts +8 -9
  61. package/linter/linter-rules.d.ts +57 -15
  62. package/linter/linter-rules.js +2 -0
  63. package/linter/rules/absolute-path.d.ts +1 -0
  64. package/linter/rules/dataframe-access-validation.d.ts +4 -3
  65. package/linter/rules/dataframe-access-validation.js +7 -4
  66. package/linter/rules/dead-code.d.ts +2 -1
  67. package/linter/rules/deprecated-functions.d.ts +15 -28
  68. package/linter/rules/deprecated-functions.js +5 -43
  69. package/linter/rules/file-path-validity.d.ts +2 -1
  70. package/linter/rules/file-path-validity.js +1 -1
  71. package/linter/rules/function-finder-util.d.ts +51 -0
  72. package/linter/rules/function-finder-util.js +77 -0
  73. package/linter/rules/naming-convention.d.ts +2 -1
  74. package/linter/rules/network-functions.d.ts +40 -0
  75. package/linter/rules/network-functions.js +24 -0
  76. package/linter/rules/seeded-randomness.d.ts +2 -1
  77. package/linter/rules/unused-definition.d.ts +2 -1
  78. package/linter/rules/useless-loop.d.ts +3 -2
  79. package/linter/rules/useless-loop.js +4 -6
  80. package/package.json +5 -1
  81. package/project/cache/flowr-analyzer-cache.d.ts +93 -0
  82. package/project/cache/flowr-analyzer-cache.js +156 -0
  83. package/project/cache/flowr-cache.d.ts +28 -0
  84. package/project/cache/flowr-cache.js +49 -0
  85. package/project/context/abstract-flowr-analyzer-context.d.ts +35 -0
  86. package/project/context/abstract-flowr-analyzer-context.js +46 -0
  87. package/project/context/flowr-analyzer-context.d.ts +48 -0
  88. package/project/context/flowr-analyzer-context.js +47 -0
  89. package/project/context/flowr-analyzer-dependencies-context.d.ts +38 -0
  90. package/project/context/flowr-analyzer-dependencies-context.js +39 -0
  91. package/project/context/flowr-analyzer-files-context.d.ts +86 -0
  92. package/project/context/flowr-analyzer-files-context.js +130 -0
  93. package/project/context/flowr-analyzer-loading-order-context.d.ts +76 -0
  94. package/project/context/flowr-analyzer-loading-order-context.js +90 -0
  95. package/project/context/flowr-file.d.ts +89 -0
  96. package/project/context/flowr-file.js +78 -0
  97. package/project/flowr-analyzer-builder.d.ts +106 -0
  98. package/project/flowr-analyzer-builder.js +197 -0
  99. package/project/flowr-analyzer.d.ts +125 -0
  100. package/project/flowr-analyzer.js +81 -0
  101. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
  102. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
  103. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
  104. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
  105. package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
  106. package/project/plugins/file-plugins/flowr-description-file.js +38 -0
  107. package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
  108. package/project/plugins/flowr-analyzer-plugin.js +82 -0
  109. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
  110. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
  111. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
  112. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
  113. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
  114. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
  115. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
  116. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
  117. package/project/plugins/package-version-plugins/package.d.ts +15 -0
  118. package/project/plugins/package-version-plugins/package.js +56 -0
  119. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
  120. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
  121. package/queries/base-query-format.d.ts +2 -8
  122. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  123. package/queries/catalog/call-context-query/call-context-query-executor.js +20 -13
  124. package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
  125. package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
  126. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
  127. package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
  128. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
  129. package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
  130. package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
  131. package/queries/catalog/config-query/config-query-executor.js +5 -5
  132. package/queries/catalog/config-query/config-query-format.d.ts +1 -1
  133. package/queries/catalog/config-query/config-query-format.js +1 -1
  134. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
  135. package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
  136. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
  137. package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
  138. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
  139. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
  140. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
  141. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
  142. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
  143. package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
  144. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
  145. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
  146. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
  147. package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
  148. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
  149. package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
  150. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  151. package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
  152. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
  153. package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
  154. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
  155. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  156. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
  157. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
  158. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
  159. package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
  160. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
  161. package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
  162. package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
  163. package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
  164. package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
  165. package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
  166. package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
  167. package/queries/catalog/linter-query/linter-query-executor.js +2 -3
  168. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
  169. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  170. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
  171. package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
  172. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  173. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  174. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
  175. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
  176. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
  177. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
  178. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  179. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  180. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
  181. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  182. package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
  183. package/queries/catalog/project-query/project-query-executor.js +2 -2
  184. package/queries/catalog/project-query/project-query-format.d.ts +1 -54
  185. package/queries/catalog/project-query/project-query-format.js +1 -1
  186. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
  187. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
  188. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
  189. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  190. package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
  191. package/queries/catalog/search-query/search-query-executor.js +3 -3
  192. package/queries/catalog/search-query/search-query-format.d.ts +1 -54
  193. package/queries/catalog/search-query/search-query-format.js +1 -1
  194. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  195. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
  196. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
  197. package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
  198. package/queries/query-print.d.ts +4 -4
  199. package/queries/query-print.js +12 -12
  200. package/queries/query.d.ts +29 -885
  201. package/queries/query.js +1 -1
  202. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +1 -1
  203. package/r-bridge/retriever.d.ts +15 -2
  204. package/r-bridge/retriever.js +15 -5
  205. package/search/flowr-search-executor.d.ts +3 -5
  206. package/search/flowr-search-executor.js +6 -4
  207. package/search/flowr-search-filters.d.ts +12 -6
  208. package/search/flowr-search-filters.js +1 -1
  209. package/search/flowr-search.d.ts +5 -16
  210. package/search/flowr-search.js +14 -5
  211. package/search/search-executor/search-enrichers.d.ts +37 -36
  212. package/search/search-executor/search-enrichers.js +4 -4
  213. package/search/search-executor/search-generators.d.ts +12 -12
  214. package/search/search-executor/search-generators.js +27 -19
  215. package/search/search-executor/search-mappers.d.ts +5 -5
  216. package/search/search-executor/search-transformer.d.ts +17 -17
  217. package/search/search-executor/search-transformer.js +14 -7
  218. package/util/collections/arrays.d.ts +1 -0
  219. package/util/collections/arrays.js +15 -0
  220. package/util/collections/objectmap.d.ts +17 -0
  221. package/util/collections/objectmap.js +28 -0
  222. package/util/containers.d.ts +0 -1
  223. package/util/containers.js +0 -1
  224. package/util/files.d.ts +17 -0
  225. package/util/files.js +65 -0
  226. package/util/formats/adapter-format.d.ts +6 -0
  227. package/util/formats/adapter-format.js +3 -0
  228. package/util/formats/adapter.d.ts +18 -0
  229. package/util/formats/adapter.js +49 -0
  230. package/util/formats/adapters/r-adapter.d.ts +4 -0
  231. package/util/formats/adapters/r-adapter.js +7 -0
  232. package/util/formats/adapters/rmd-adapter.d.ts +26 -0
  233. package/util/formats/adapters/rmd-adapter.js +91 -0
  234. package/util/version.js +1 -1
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerBuilder = void 0;
4
+ const config_1 = require("../config");
5
+ const retriever_1 = require("../r-bridge/retriever");
6
+ const flowr_analyzer_1 = require("./flowr-analyzer");
7
+ const engines_1 = require("../engines");
8
+ const assert_1 = require("../util/assert");
9
+ const files_1 = require("../util/files");
10
+ const flowr_analyzer_context_1 = require("./context/flowr-analyzer-context");
11
+ const flowr_analyzer_cache_1 = require("./cache/flowr-analyzer-cache");
12
+ /**
13
+ * Builder for the {@link FlowrAnalyzer}, use it to configure all analysis aspects before creating the analyzer instance
14
+ * with {@link FlowrAnalyzerBuilder#build|`.build()`} or {@link FlowrAnalyzerBuilder#buildSync|`.buildSync()`}.
15
+ *
16
+ * You can add new files and folders to analyze using the constructor or the {@link FlowrAnalyzerBuilder#add|`.add()`} method.
17
+ *
18
+ * @example Let's create an analyzer for a single R script file:
19
+ *
20
+ * ```ts
21
+ * const analyzer = new FlowrAnalyzerBuilder()
22
+ * .add('file:///path/to/script.R')
23
+ * .setParser(new TreeSitterExecutor())
24
+ * .buildSync();
25
+ * ```
26
+ *
27
+ * If you now want to get the dataflow information for the file, you can do this:
28
+ *
29
+ * ```ts
30
+ * const dfInfo = await analyzer.dataflow();
31
+ * console.log(dfInfo);
32
+ * ```
33
+ */
34
+ class FlowrAnalyzerBuilder {
35
+ flowrConfig = (0, config_1.cloneConfig)(config_1.defaultConfigOptions);
36
+ parser;
37
+ request;
38
+ input;
39
+ plugins = new Map();
40
+ /**
41
+ * Create a new builder instance.
42
+ * @param request - The code to analyze
43
+ */
44
+ constructor(request) {
45
+ this.addRequest(request ?? []);
46
+ }
47
+ /**
48
+ * Add one or multiple requests to analyze.
49
+ * This is a convenience method that uses {@link addRequest} and {@link addRequestFromInput} internally.
50
+ * @param request - One or multiple requests or a file path (with the `file://` protocol). If you just enter a string, it will be interpreted as R code.
51
+ */
52
+ add(request) {
53
+ if (Array.isArray(request) || (0, retriever_1.isParseRequest)(request)) {
54
+ this.addRequest(request);
55
+ }
56
+ else if (typeof request === 'string') {
57
+ const trimmed = request.substring(retriever_1.fileProtocol.length);
58
+ if (request.startsWith(retriever_1.fileProtocol) && !(0, files_1.isFilePath)(trimmed)) {
59
+ this.addRequest({ request: 'project', content: trimmed });
60
+ }
61
+ else {
62
+ this.addRequestFromInput(request);
63
+ }
64
+ }
65
+ else {
66
+ this.addRequest(request);
67
+ }
68
+ return this;
69
+ }
70
+ /**
71
+ * Add one or multiple requests to analyze the builder.
72
+ */
73
+ addRequest(request) {
74
+ const r = Array.isArray(request) ? request : [request];
75
+ if (this.request) {
76
+ this.request = this.request.concat(request);
77
+ }
78
+ else {
79
+ this.request = r;
80
+ }
81
+ return this;
82
+ }
83
+ /**
84
+ * Add a request created from the given input.
85
+ * This is a convenience method that uses {@link requestFromInput} internally.
86
+ */
87
+ addRequestFromInput(input) {
88
+ this.addRequest((0, retriever_1.requestFromInput)(input));
89
+ return this;
90
+ }
91
+ /**
92
+ * Apply an amendment to the configuration the builder currently holds.
93
+ * Per default, the {@link defaultConfigOptions} are used.
94
+ * @param func - Receives the current configuration of the builder and allows for amendment.
95
+ */
96
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
97
+ amendConfig(func) {
98
+ this.flowrConfig = (0, config_1.amendConfig)(this.flowrConfig, func);
99
+ return this;
100
+ }
101
+ /**
102
+ * Overwrite the configuration used by the resulting analyzer.
103
+ * @param config - The new configuration.
104
+ */
105
+ setConfig(config) {
106
+ this.flowrConfig = config;
107
+ return this;
108
+ }
109
+ /**
110
+ * Set the parser instance used by the analyzer.
111
+ * This is an alternative to {@link FlowrAnalyzerBuilder#setEngine} if you already have a parser instance.
112
+ * Please be aware, that if you want to parallelize multiple analyzers, there should be separate parser instances.
113
+ */
114
+ setParser(parser) {
115
+ this.parser = parser;
116
+ return this;
117
+ }
118
+ /**
119
+ * Set the engine and hence the parser that will be used by the analyzer.
120
+ * This is an alternative to {@link FlowrAnalyzerBuilder#setParser} if you do not have a parser instance at hand.
121
+ */
122
+ setEngine(engine) {
123
+ this.flowrConfig.defaultEngine = engine;
124
+ return this;
125
+ }
126
+ /**
127
+ * Additional parameters for the analyses.
128
+ * @param input - The input.
129
+ */
130
+ setInput(input) {
131
+ this.input = input;
132
+ return this;
133
+ }
134
+ /**
135
+ * Register one or multiple additional plugins.
136
+ *
137
+ * @see {@link FlowrAnalyzerBuilder#unregisterPlugins} to remove plugins.
138
+ */
139
+ registerPlugins(...plugin) {
140
+ for (const p of plugin) {
141
+ const g = this.plugins.get(p.type);
142
+ if (g === undefined) {
143
+ this.plugins.set(p.type, [p]);
144
+ }
145
+ else {
146
+ g.push(p);
147
+ }
148
+ }
149
+ return this;
150
+ }
151
+ /**
152
+ * Remove one or multiple plugins.
153
+ */
154
+ unregisterPlugins(...plugin) {
155
+ for (const p of plugin) {
156
+ const g = this.plugins.get(p.type);
157
+ if (g !== undefined) {
158
+ this.plugins.set(p.type, g.filter(x => x !== p));
159
+ }
160
+ }
161
+ return this;
162
+ }
163
+ /**
164
+ * Create the {@link FlowrAnalyzer} instance using the given information.
165
+ * Please note that the only reason this is `async` is that if no parser is set,
166
+ * we need to retrieve the default engine instance which is an async operation.
167
+ * If you set the parser using {@link FlowrAnalyzerBuilder#setParser},
168
+ */
169
+ async build() {
170
+ if (!this.parser) {
171
+ const engines = await (0, engines_1.retrieveEngineInstances)(this.flowrConfig, true);
172
+ this.parser = engines.engines[engines.default];
173
+ }
174
+ return this.buildSync();
175
+ }
176
+ /**
177
+ * Synchronous version of {@link FlowrAnalyzerBuilder#build}, please only use this if you have set the parser using
178
+ * {@link FlowrAnalyzerBuilder#setParser} before, otherwise an error will be thrown.
179
+ */
180
+ buildSync() {
181
+ (0, assert_1.guard)(this.parser !== undefined, 'No parser set, please use the setParser or setEngine method to set a parser before building the analyzer');
182
+ (0, assert_1.guard)(this.request !== undefined, 'Currently we require at least one request to build an analyzer, please provide one using the constructor or the addRequest method');
183
+ const context = new flowr_analyzer_context_1.FlowrAnalyzerContext(this.plugins);
184
+ context.addRequests(this.request);
185
+ // we do it here to save time later if the analyzer is to be duplicated
186
+ context.resolvePreAnalysis();
187
+ const cache = flowr_analyzer_cache_1.FlowrAnalyzerCache.create({
188
+ parser: this.parser,
189
+ config: this.flowrConfig,
190
+ request: context.files.computeLoadingOrder(),
191
+ ...(this.input ?? {})
192
+ });
193
+ return new flowr_analyzer_1.FlowrAnalyzer(this.flowrConfig, this.parser, context, cache);
194
+ }
195
+ }
196
+ exports.FlowrAnalyzerBuilder = FlowrAnalyzerBuilder;
197
+ //# sourceMappingURL=flowr-analyzer-builder.js.map
@@ -0,0 +1,125 @@
1
+ import type { FlowrConfigOptions } from '../config';
2
+ import type { KnownParser, KnownParserName, ParseStepOutput } from '../r-bridge/parser';
3
+ import type { Queries, QueryResults, SupportedQueryTypes } from '../queries/query';
4
+ import type { ControlFlowInformation } from '../control-flow/control-flow-graph';
5
+ import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
6
+ import type { DataflowInformation } from '../dataflow/info';
7
+ import type { CfgSimplificationPassName } from '../control-flow/cfg-simplification';
8
+ import type { PipelinePerStepMetaInformation } from '../core/steps/pipeline/pipeline';
9
+ import type { FlowrAnalyzerCache } from './cache/flowr-analyzer-cache';
10
+ import type { FlowrSearchLike, SearchOutput } from '../search/flowr-search-builder';
11
+ import type { GetSearchElements } from '../search/flowr-search-executor';
12
+ import type { FlowrAnalyzerContext, ReadOnlyFlowrAnalyzerContext } from './context/flowr-analyzer-context';
13
+ /**
14
+ * Exposes the central analyses and information provided by the {@link FlowrAnalyzer} to the linter, search, and query APIs.
15
+ * This allows us to exchange the underlying implementation of the analyzer without affecting the APIs.
16
+ */
17
+ export interface FlowrAnalysisProvider {
18
+ /**
19
+ * Get the name of the parser used by the analyzer.
20
+ */
21
+ parserName(): string;
22
+ /**
23
+ * Returns project context information.
24
+ * If you are a user that wants to inspect the context, prefer {@link inspectContext} instead.
25
+ * Please be aware that modifications to the context may break analyzer assumptions.
26
+ */
27
+ context(): FlowrAnalyzerContext;
28
+ /**
29
+ * Returns a read-only version of the project context information.
30
+ * This is the preferred method for users that want to inspect the context.
31
+ */
32
+ inspectContext(): ReadOnlyFlowrAnalyzerContext;
33
+ /**
34
+ * Get the parse output for the request.
35
+ *
36
+ * The parse result type depends on the {@link KnownParser} used by the analyzer.
37
+ * @param force - Do not use the cache, instead force a new parse.
38
+ */
39
+ parse(force?: boolean): Promise<ParseStepOutput<Awaited<ReturnType<KnownParser['parse']>>> & PipelinePerStepMetaInformation>;
40
+ /**
41
+ * Get the normalized abstract syntax tree for the request.
42
+ * @param force - Do not use the cache, instead force new analyses.
43
+ */
44
+ normalize(force?: boolean): Promise<NormalizedAst & PipelinePerStepMetaInformation>;
45
+ /**
46
+ * Get the dataflow graph for the request.
47
+ * @param force - Do not use the cache, instead force new analyses.
48
+ */
49
+ dataflow(force?: boolean): Promise<DataflowInformation & PipelinePerStepMetaInformation>;
50
+ /**
51
+ * Get the control flow graph (CFG) for the request.
52
+ * @param simplifications - Simplification passes to be applied to the CFG.
53
+ * @param useDataflow - Whether to use the dataflow graph for the creation of the CFG.
54
+ * @param force - Do not use the cache, instead force new analyses.
55
+ */
56
+ controlflow(simplifications?: readonly CfgSimplificationPassName[], useDataflow?: boolean, force?: boolean): Promise<ControlFlowInformation>;
57
+ /**
58
+ * Get a quick and dirty control flow graph (CFG) for the request.
59
+ * This does not use the dataflow information and does not apply any simplifications.
60
+ *
61
+ * @param force - Do not use the cache, instead force new analyses.
62
+ */
63
+ controlflowQuick(force?: boolean): Promise<ControlFlowInformation>;
64
+ /**
65
+ * Access the query API for the request.
66
+ * @param query - The list of queries.
67
+ */
68
+ query<Types extends SupportedQueryTypes = SupportedQueryTypes>(query: Queries<Types>): Promise<QueryResults<Types>>;
69
+ /**
70
+ * Run a search on the current analysis.
71
+ */
72
+ runSearch<Search extends FlowrSearchLike>(search: Search): Promise<GetSearchElements<SearchOutput<Search>>>;
73
+ /**
74
+ * This executes all steps of the core analysis (parse, normalize, dataflow).
75
+ */
76
+ runFull(force?: boolean): Promise<void>;
77
+ /**
78
+ * Reset all caches used by the analyzer and effectively force all analyses to be redone.
79
+ */
80
+ reset(): void;
81
+ /** This is the config used for the analyzer */
82
+ flowrConfig: FlowrConfigOptions;
83
+ }
84
+ /**
85
+ * Central class for conducting analyses with FlowR.
86
+ * Use the {@link FlowrAnalyzerBuilder} to create a new instance.
87
+ *
88
+ * If you want the original pattern of creating a pipeline and running all steps, you can still do this with {@link FlowrAnalyzer#runFull}.
89
+ *
90
+ * To inspect the context of the analyzer, use {@link FlowrAnalyzer#inspectContext} (if you are a plugin and need to modify it, use {@link FlowrAnalyzer#context} instead).
91
+ */
92
+ export declare class FlowrAnalyzer<Parser extends KnownParser = KnownParser> implements FlowrAnalysisProvider {
93
+ readonly flowrConfig: FlowrConfigOptions;
94
+ /** The parser and engine backend */
95
+ private readonly parser;
96
+ /** The cache used for storing analysis results */
97
+ private readonly cache;
98
+ private readonly ctx;
99
+ /**
100
+ * Create a new analyzer instance.
101
+ * **Prefer the use of the {@link FlowrAnalyzerBuilder} instead of calling this constructor directly.**
102
+ *
103
+ * @param config - The FlowR config to use for the analyses
104
+ * @param parser - The parser to use for parsing the given request.
105
+ * @param ctx - The context to use for the analyses.
106
+ * @param cache - The caching layer to use for storing analysis results.
107
+ */
108
+ constructor(config: FlowrConfigOptions, parser: Parser, ctx: FlowrAnalyzerContext, cache: FlowrAnalyzerCache<Parser>);
109
+ context(): FlowrAnalyzerContext;
110
+ inspectContext(): ReadOnlyFlowrAnalyzerContext;
111
+ reset(): void;
112
+ parserName(): KnownParserName;
113
+ parse(force?: boolean): ReturnType<typeof this.cache.parse>;
114
+ normalize(force?: boolean): ReturnType<typeof this.cache.normalize>;
115
+ dataflow(force?: boolean): ReturnType<typeof this.cache.dataflow>;
116
+ runFull(force?: boolean): Promise<void>;
117
+ controlflow(simplifications?: readonly CfgSimplificationPassName[], useDataflow?: boolean, force?: boolean): Promise<ControlFlowInformation>;
118
+ controlflowQuick(force?: boolean): Promise<ControlFlowInformation>;
119
+ query<Types extends SupportedQueryTypes = SupportedQueryTypes>(query: Queries<Types>): Promise<QueryResults<Types>>;
120
+ runSearch<Search extends FlowrSearchLike>(search: Search): Promise<GetSearchElements<SearchOutput<Search>>>;
121
+ /**
122
+ * Close the parser if it was created by this builder. This is only required if you rely on an RShell/remote engine.
123
+ */
124
+ close(): boolean | void;
125
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzer = void 0;
4
+ const query_1 = require("../queries/query");
5
+ const flowr_search_executor_1 = require("../search/flowr-search-executor");
6
+ /**
7
+ * Central class for conducting analyses with FlowR.
8
+ * Use the {@link FlowrAnalyzerBuilder} to create a new instance.
9
+ *
10
+ * If you want the original pattern of creating a pipeline and running all steps, you can still do this with {@link FlowrAnalyzer#runFull}.
11
+ *
12
+ * To inspect the context of the analyzer, use {@link FlowrAnalyzer#inspectContext} (if you are a plugin and need to modify it, use {@link FlowrAnalyzer#context} instead).
13
+ */
14
+ class FlowrAnalyzer {
15
+ flowrConfig;
16
+ /** The parser and engine backend */
17
+ parser;
18
+ /** The cache used for storing analysis results */
19
+ cache;
20
+ ctx;
21
+ /**
22
+ * Create a new analyzer instance.
23
+ * **Prefer the use of the {@link FlowrAnalyzerBuilder} instead of calling this constructor directly.**
24
+ *
25
+ * @param config - The FlowR config to use for the analyses
26
+ * @param parser - The parser to use for parsing the given request.
27
+ * @param ctx - The context to use for the analyses.
28
+ * @param cache - The caching layer to use for storing analysis results.
29
+ */
30
+ constructor(config, parser, ctx, cache) {
31
+ this.flowrConfig = config;
32
+ this.parser = parser;
33
+ this.ctx = ctx;
34
+ this.cache = cache;
35
+ }
36
+ context() {
37
+ return this.ctx;
38
+ }
39
+ inspectContext() {
40
+ return this.ctx.inspect();
41
+ }
42
+ reset() {
43
+ this.cache.reset();
44
+ }
45
+ parserName() {
46
+ return this.parser.name;
47
+ }
48
+ async parse(force) {
49
+ return this.cache.parse(force);
50
+ }
51
+ async normalize(force) {
52
+ return this.cache.normalize(force);
53
+ }
54
+ async dataflow(force) {
55
+ return this.cache.dataflow(force);
56
+ }
57
+ async runFull(force) {
58
+ await this.dataflow(force);
59
+ return;
60
+ }
61
+ async controlflow(simplifications, useDataflow, force) {
62
+ return this.cache.controlflow(force, useDataflow ?? false, simplifications);
63
+ }
64
+ async controlflowQuick(force) {
65
+ return this.controlflow(undefined, false, force);
66
+ }
67
+ async query(query) {
68
+ return (0, query_1.executeQueries)({ analyzer: this }, query);
69
+ }
70
+ async runSearch(search) {
71
+ return (0, flowr_search_executor_1.runSearch)(search, this);
72
+ }
73
+ /**
74
+ * Close the parser if it was created by this builder. This is only required if you rely on an RShell/remote engine.
75
+ */
76
+ close() {
77
+ return this.parser?.close();
78
+ }
79
+ }
80
+ exports.FlowrAnalyzer = FlowrAnalyzer;
81
+ //# sourceMappingURL=flowr-analyzer.js.map
@@ -0,0 +1,17 @@
1
+ import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
2
+ import { SemVer } from 'semver';
3
+ import type { PathLike } from 'fs';
4
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
+ import { FlowrDescriptionFile } from './flowr-description-file';
6
+ import type { FlowrFileProvider } from '../../context/flowr-file';
7
+ export declare const descriptionFileLog: import("tslog").Logger<import("tslog").ILogObj>;
8
+ /**
9
+ * This plugin provides support for R `DESCRIPTION` files.
10
+ */
11
+ export declare class FlowrAnalyzerDescriptionFilePlugin extends FlowrAnalyzerFilePlugin {
12
+ readonly name = "flowr-analyzer-description-file-plugin";
13
+ readonly description = "This plugin provides support for DESCRIPTION files and extracts their content into key-value(s) pairs.";
14
+ readonly version: SemVer;
15
+ applies(file: PathLike): boolean;
16
+ process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider<string>): FlowrDescriptionFile;
17
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerDescriptionFilePlugin = exports.descriptionFileLog = void 0;
4
+ const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
+ const semver_1 = require("semver");
6
+ const log_1 = require("../../../util/log");
7
+ const flowr_description_file_1 = require("./flowr-description-file");
8
+ const flowr_file_1 = require("../../context/flowr-file");
9
+ exports.descriptionFileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-loading-order-description-file-plugin' });
10
+ /**
11
+ * This plugin provides support for R `DESCRIPTION` files.
12
+ */
13
+ class FlowrAnalyzerDescriptionFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
14
+ name = 'flowr-analyzer-description-file-plugin';
15
+ description = 'This plugin provides support for DESCRIPTION files and extracts their content into key-value(s) pairs.';
16
+ version = new semver_1.SemVer('0.1.0');
17
+ applies(file) {
18
+ return /^(DESCRIPTION|DESCRIPTION\.txt)$/i.test(file.toString().split(/[/\\]/).pop() ?? '');
19
+ }
20
+ process(_ctx, file) {
21
+ const f = flowr_description_file_1.FlowrDescriptionFile.from(file, flowr_file_1.SpecialFileRole.Description);
22
+ // already load it here
23
+ f.content();
24
+ return f;
25
+ }
26
+ }
27
+ exports.FlowrAnalyzerDescriptionFilePlugin = FlowrAnalyzerDescriptionFilePlugin;
28
+ //# sourceMappingURL=flowr-analyzer-description-file-plugin.js.map
@@ -0,0 +1,21 @@
1
+ import { FlowrAnalyzerPlugin, PluginType } from '../flowr-analyzer-plugin';
2
+ import type { PathLike } from 'fs';
3
+ import type { FlowrFileProvider } from '../../context/flowr-file';
4
+ /**
5
+ * This is the base class for all plugins that load and possibly transform files when they are loaded.
6
+ * Different from other plugins, these plugins trigger for each file that is loaded (if they {@link applies} to the file).
7
+ * See the {@link FlowrAnalyzerFilesContext.addFile} for more information on how files are loaded and managed.
8
+ *
9
+ * It is upt to the construction to ensure that no two file plugins {@link applies} to the same file, otherwise, the loading order
10
+ * of these plugins will determine which plugin gets to process the file.
11
+ *
12
+ * See {@link DefaultFlowrAnalyzerFilePlugin} for the no-op default implementation.
13
+ */
14
+ export declare abstract class FlowrAnalyzerFilePlugin extends FlowrAnalyzerPlugin<FlowrFileProvider<string>, FlowrFileProvider> {
15
+ readonly type = PluginType.FileLoad;
16
+ /**
17
+ * Determine whether this plugin applies to the given file.
18
+ */
19
+ abstract applies(file: PathLike): boolean;
20
+ static defaultPlugin(): FlowrAnalyzerFilePlugin;
21
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerFilePlugin = void 0;
4
+ const flowr_analyzer_plugin_1 = require("../flowr-analyzer-plugin");
5
+ const semver_1 = require("semver");
6
+ /**
7
+ * This is the base class for all plugins that load and possibly transform files when they are loaded.
8
+ * Different from other plugins, these plugins trigger for each file that is loaded (if they {@link applies} to the file).
9
+ * See the {@link FlowrAnalyzerFilesContext.addFile} for more information on how files are loaded and managed.
10
+ *
11
+ * It is upt to the construction to ensure that no two file plugins {@link applies} to the same file, otherwise, the loading order
12
+ * of these plugins will determine which plugin gets to process the file.
13
+ *
14
+ * See {@link DefaultFlowrAnalyzerFilePlugin} for the no-op default implementation.
15
+ */
16
+ class FlowrAnalyzerFilePlugin extends flowr_analyzer_plugin_1.FlowrAnalyzerPlugin {
17
+ type = flowr_analyzer_plugin_1.PluginType.FileLoad;
18
+ static defaultPlugin() {
19
+ return new DefaultFlowrAnalyzerFilePlugin();
20
+ }
21
+ }
22
+ exports.FlowrAnalyzerFilePlugin = FlowrAnalyzerFilePlugin;
23
+ class DefaultFlowrAnalyzerFilePlugin extends FlowrAnalyzerFilePlugin {
24
+ name = 'default-file-plugin';
25
+ description = 'This is the default file plugin that does nothing.';
26
+ version = new semver_1.SemVer('0.0.0');
27
+ applies() {
28
+ return true;
29
+ }
30
+ process(_context, args) {
31
+ return args;
32
+ }
33
+ }
34
+ //# sourceMappingURL=flowr-analyzer-file-plugin.js.map
@@ -0,0 +1,24 @@
1
+ import type { FlowrFileProvider, SpecialFileRole } from '../../context/flowr-file';
2
+ import { FlowrFile } from '../../context/flowr-file';
3
+ export type DCF = Map<string, string[]>;
4
+ /**
5
+ * This decorates a text file and provides access to its content as a DCF (Debian Control File)-like structure.
6
+ */
7
+ export declare class FlowrDescriptionFile extends FlowrFile<DCF> {
8
+ private readonly wrapped;
9
+ /**
10
+ * Prefer the static {@link FlowrDescriptionFile.from} method to create instances of this class as it will not re-create if already a description file
11
+ * and handle role assignments.
12
+ */
13
+ constructor(file: FlowrFileProvider<string>);
14
+ /**
15
+ * Loads and parses the content of the wrapped file as a DCF structure.
16
+ *
17
+ * @see {@link parseDCF} for details on the parsing logic.
18
+ */
19
+ protected loadContent(): DCF;
20
+ /**
21
+ * Description file lifter, this does not re-create if already a description file
22
+ */
23
+ static from(file: FlowrFileProvider<string> | FlowrDescriptionFile, role?: SpecialFileRole): FlowrDescriptionFile;
24
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrDescriptionFile = void 0;
4
+ const flowr_file_1 = require("../../context/flowr-file");
5
+ const files_1 = require("../../../util/files");
6
+ /**
7
+ * This decorates a text file and provides access to its content as a DCF (Debian Control File)-like structure.
8
+ */
9
+ class FlowrDescriptionFile extends flowr_file_1.FlowrFile {
10
+ wrapped;
11
+ /**
12
+ * Prefer the static {@link FlowrDescriptionFile.from} method to create instances of this class as it will not re-create if already a description file
13
+ * and handle role assignments.
14
+ */
15
+ constructor(file) {
16
+ super(file.path(), file.role);
17
+ this.wrapped = file;
18
+ }
19
+ /**
20
+ * Loads and parses the content of the wrapped file as a DCF structure.
21
+ *
22
+ * @see {@link parseDCF} for details on the parsing logic.
23
+ */
24
+ loadContent() {
25
+ return (0, files_1.parseDCF)(this.wrapped);
26
+ }
27
+ /**
28
+ * Description file lifter, this does not re-create if already a description file
29
+ */
30
+ static from(file, role) {
31
+ if (role) {
32
+ file.assignRole(role);
33
+ }
34
+ return file instanceof FlowrDescriptionFile ? file : new FlowrDescriptionFile(file);
35
+ }
36
+ }
37
+ exports.FlowrDescriptionFile = FlowrDescriptionFile;
38
+ //# sourceMappingURL=flowr-description-file.js.map
@@ -0,0 +1,90 @@
1
+ import type { SemVer } from 'semver';
2
+ import type { AsyncOrSync } from 'ts-essentials';
3
+ import type { FlowrAnalyzerContext } from '../context/flowr-analyzer-context';
4
+ /**
5
+ * Based on *when* and *what-for* the plugin is applied during the analysis,
6
+ * plugins are categorized into different types.
7
+ *
8
+ * Consult this diagram for an overview of orders and (implicit or explicit) dependencies:
9
+ *
10
+ * ```text
11
+ * ┌───────────┐ ┌───────────────────┐ ┌─────────────┐ ┌───────────────┐ ┌───────┐
12
+ * │ │ │ │ │ │ │ │ │ │
13
+ * │ *Builder* ├──▶│ Project Discovery ├──▶│ File Loader ├──▶│ Dependencies ├──▶│ *DFA* │
14
+ * │ │ │ (if necessary) │ │ │ │ (static) │ │ │
15
+ * └───────────┘ └───────────────────┘ └──────┬──────┘ └───────────────┘ └───────┘
16
+ * │ ▲
17
+ * │ ┌───────────────┐ │
18
+ * │ │ │ │
19
+ * └─────────▶│ Loading Order ├───────┘
20
+ * │ │
21
+ * └───────────────┘
22
+ *```
23
+ *
24
+ */
25
+ export declare enum PluginType {
26
+ /**
27
+ * Plugins that are applied right after the builder has been created and before any analysis is done.
28
+ * @see {@link FlowrAnalyzerPackageVersionsPlugin} - for the base class to implement such a plugin.
29
+ */
30
+ DependencyIdentification = "package-versions",
31
+ /**
32
+ * Plugins that are used to determine the order in which files are loaded and analyzed.
33
+ * @see {@link FlowrAnalyzerLoadingOrderPlugin} - for the base class to implement such a plugin.
34
+ */
35
+ LoadingOrder = "loading-order",
36
+ /**
37
+ * Plugins that are applied to discover the project structure, files, and folders to analyze.
38
+ * @see {@link FlowrAnalyzerProjectDiscoveryPlugin} - for the base class to implement such a plugin.
39
+ */
40
+ ProjectDiscovery = "project-discovery",
41
+ /**
42
+ * Plugins that are applied to load and parse files.
43
+ * @see {@link FlowrAnalyzerFilePlugin} - for the base class to implement such a plugin.
44
+ */
45
+ FileLoad = "file-load"
46
+ }
47
+ /**
48
+ * This is the main interface that every plugin to be used with the {@link FlowrAnalyzer} must comply with.
49
+ *
50
+ * One of the most important decisions for the generics is also the {@link PluginType}, as this determines
51
+ * at which stage of the analysis the plugin is applied and what it is expected to do.
52
+ * Do yourself a favor and do not implement a corresponding class yourself but use the classes referenced alongside
53
+ * the {@link PluginType} values, as these already provide the correct generic restrictions, additional capabilities, and the `type` property.
54
+ */
55
+ export interface FlowrAnalyzerPluginInterface<In = unknown, Out = In> {
56
+ /** A unique, human-readable name of the plugin. */
57
+ readonly name: string;
58
+ /** A short description of what the plugin does. */
59
+ readonly description: string;
60
+ /** The version of the plugin, ideally following [semver](https://semver.org/). */
61
+ readonly version: SemVer;
62
+ /** The type of the plugin, determining when and for what purpose it is applied during the analysis. */
63
+ readonly type: PluginType;
64
+ /**
65
+ * The main implementation of the plugin, receiving the current analysis context and the input arguments,
66
+ * The plugin is (based on the restrictions of its {@link PluginType}) allowed to modify the context.
67
+ */
68
+ processor(analyzer: FlowrAnalyzerContext, args: In): Out;
69
+ }
70
+ /**
71
+ * The base class every plugin to be used with the {@link FlowrAnalyzer} must extend.
72
+ * **Please do not create plugins directly based on this class, but use the classes referenced alongside the {@link PluginType} values!**
73
+ * For example, if you want to create a plugin that determines the loading order of files, extend {@link FlowrAnalyzerLoadingOrderPlugin} instead.
74
+ * These classes also provide sensible overrides of {@link FlowrAnalyzerPlugin.defaultPlugin} to be used when no plugin of this type is registered or triggered.
75
+ */
76
+ export declare abstract class FlowrAnalyzerPlugin<In = unknown, Out extends AsyncOrSync<unknown> = In> implements FlowrAnalyzerPluginInterface<In, Out> {
77
+ abstract readonly name: string;
78
+ abstract readonly description: string;
79
+ abstract readonly version: SemVer;
80
+ abstract readonly type: PluginType;
81
+ /**
82
+ * Returns a default/dummy implementation to be used when no plugin of this type is registered or triggered.
83
+ */
84
+ static defaultPlugin(): FlowrAnalyzerPlugin<unknown, unknown>;
85
+ /**
86
+ * Run the plugin with the given context and arguments.
87
+ */
88
+ processor(context: FlowrAnalyzerContext, args: In): Out;
89
+ protected abstract process(analyzer: FlowrAnalyzerContext, args: In): Out;
90
+ }