flowquery 1.0.3 → 1.0.6

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 (268) hide show
  1. package/README.md +182 -0
  2. package/dist/compute/runner.d.ts +81 -0
  3. package/dist/compute/runner.d.ts.map +1 -0
  4. package/dist/extensibility.d.ts +9 -0
  5. package/dist/extensibility.d.ts.map +1 -0
  6. package/dist/extensibility.js +25 -0
  7. package/dist/extensibility.js.map +1 -0
  8. package/dist/flowquery.min.js +1 -1
  9. package/dist/index.browser.d.ts +10 -0
  10. package/dist/index.browser.d.ts.map +1 -0
  11. package/dist/index.d.ts +9 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.node.d.ts +14 -0
  14. package/dist/index.node.d.ts.map +1 -0
  15. package/dist/io/command_line.d.ts +28 -0
  16. package/dist/io/command_line.d.ts.map +1 -0
  17. package/dist/parsing/alias.d.ts +10 -0
  18. package/dist/parsing/alias.d.ts.map +1 -0
  19. package/dist/parsing/alias_option.d.ts +6 -0
  20. package/dist/parsing/alias_option.d.ts.map +1 -0
  21. package/dist/parsing/ast_node.d.ts +100 -0
  22. package/dist/parsing/ast_node.d.ts.map +1 -0
  23. package/dist/parsing/base_parser.d.ts +49 -0
  24. package/dist/parsing/base_parser.d.ts.map +1 -0
  25. package/dist/parsing/components/csv.d.ts +6 -0
  26. package/dist/parsing/components/csv.d.ts.map +1 -0
  27. package/dist/parsing/components/from.d.ts +7 -0
  28. package/dist/parsing/components/from.d.ts.map +1 -0
  29. package/dist/parsing/components/headers.d.ts +7 -0
  30. package/dist/parsing/components/headers.d.ts.map +1 -0
  31. package/dist/parsing/components/json.d.ts +6 -0
  32. package/dist/parsing/components/json.d.ts.map +1 -0
  33. package/dist/parsing/components/null.d.ts +6 -0
  34. package/dist/parsing/components/null.d.ts.map +1 -0
  35. package/dist/parsing/components/post.d.ts +6 -0
  36. package/dist/parsing/components/post.d.ts.map +1 -0
  37. package/dist/parsing/components/text.d.ts +6 -0
  38. package/dist/parsing/components/text.d.ts.map +1 -0
  39. package/dist/parsing/context.d.ts +38 -0
  40. package/dist/parsing/context.d.ts.map +1 -0
  41. package/dist/parsing/data_structures/associative_array.d.ts +28 -0
  42. package/dist/parsing/data_structures/associative_array.d.ts.map +1 -0
  43. package/dist/parsing/data_structures/json_array.d.ts +26 -0
  44. package/dist/parsing/data_structures/json_array.d.ts.map +1 -0
  45. package/dist/parsing/data_structures/key_value_pair.d.ts +25 -0
  46. package/dist/parsing/data_structures/key_value_pair.d.ts.map +1 -0
  47. package/dist/parsing/data_structures/lookup.d.ts +25 -0
  48. package/dist/parsing/data_structures/lookup.d.ts.map +1 -0
  49. package/dist/parsing/data_structures/range_lookup.d.ts +14 -0
  50. package/dist/parsing/data_structures/range_lookup.d.ts.map +1 -0
  51. package/dist/parsing/expressions/expression.d.ts +53 -0
  52. package/dist/parsing/expressions/expression.d.ts.map +1 -0
  53. package/dist/parsing/expressions/f_string.d.ts +21 -0
  54. package/dist/parsing/expressions/f_string.d.ts.map +1 -0
  55. package/dist/parsing/expressions/identifier.d.ts +17 -0
  56. package/dist/parsing/expressions/identifier.d.ts.map +1 -0
  57. package/dist/parsing/expressions/number.d.ts +25 -0
  58. package/dist/parsing/expressions/number.d.ts.map +1 -0
  59. package/dist/parsing/expressions/operator.d.ts +79 -0
  60. package/dist/parsing/expressions/operator.d.ts.map +1 -0
  61. package/dist/parsing/expressions/reference.d.ts +29 -0
  62. package/dist/parsing/expressions/reference.d.ts.map +1 -0
  63. package/dist/parsing/expressions/string.d.ts +23 -0
  64. package/dist/parsing/expressions/string.d.ts.map +1 -0
  65. package/dist/parsing/functions/aggregate_function.d.ts +42 -0
  66. package/dist/parsing/functions/aggregate_function.d.ts.map +1 -0
  67. package/dist/parsing/functions/async_function.d.ts +52 -0
  68. package/dist/parsing/functions/async_function.d.ts.map +1 -0
  69. package/dist/parsing/functions/avg.d.ts +15 -0
  70. package/dist/parsing/functions/avg.d.ts.map +1 -0
  71. package/dist/parsing/functions/avg.js +20 -2
  72. package/dist/parsing/functions/avg.js.map +1 -1
  73. package/dist/parsing/functions/collect.d.ts +21 -0
  74. package/dist/parsing/functions/collect.d.ts.map +1 -0
  75. package/dist/parsing/functions/collect.js +20 -2
  76. package/dist/parsing/functions/collect.js.map +1 -1
  77. package/dist/parsing/functions/extensibility/index.d.ts +37 -0
  78. package/dist/parsing/functions/extensibility/index.d.ts.map +1 -0
  79. package/dist/parsing/functions/extensibility/index.js +50 -0
  80. package/dist/parsing/functions/extensibility/index.js.map +1 -0
  81. package/dist/parsing/functions/function.d.ts +36 -0
  82. package/dist/parsing/functions/function.d.ts.map +1 -0
  83. package/dist/parsing/functions/function_factory.d.ts +174 -0
  84. package/dist/parsing/functions/function_factory.d.ts.map +1 -0
  85. package/dist/parsing/functions/function_factory.js +44 -47
  86. package/dist/parsing/functions/function_factory.js.map +1 -1
  87. package/dist/parsing/functions/function_metadata.d.ts +134 -0
  88. package/dist/parsing/functions/function_metadata.d.ts.map +1 -0
  89. package/dist/parsing/functions/function_metadata.js +103 -153
  90. package/dist/parsing/functions/function_metadata.js.map +1 -1
  91. package/dist/parsing/functions/functions.d.ts +21 -0
  92. package/dist/parsing/functions/functions.d.ts.map +1 -0
  93. package/dist/parsing/functions/functions.js +37 -2
  94. package/dist/parsing/functions/functions.js.map +1 -1
  95. package/dist/parsing/functions/join.d.ts +9 -0
  96. package/dist/parsing/functions/join.d.ts.map +1 -0
  97. package/dist/parsing/functions/join.js +21 -2
  98. package/dist/parsing/functions/join.js.map +1 -1
  99. package/dist/parsing/functions/predicate_function.d.ts +19 -0
  100. package/dist/parsing/functions/predicate_function.d.ts.map +1 -0
  101. package/dist/parsing/functions/predicate_function.js +3 -0
  102. package/dist/parsing/functions/predicate_function.js.map +1 -1
  103. package/dist/parsing/functions/predicate_sum.d.ts +7 -0
  104. package/dist/parsing/functions/predicate_sum.d.ts.map +1 -0
  105. package/dist/parsing/functions/predicate_sum.js +23 -2
  106. package/dist/parsing/functions/predicate_sum.js.map +1 -1
  107. package/dist/parsing/functions/rand.d.ts +7 -0
  108. package/dist/parsing/functions/rand.d.ts.map +1 -0
  109. package/dist/parsing/functions/rand.js +18 -2
  110. package/dist/parsing/functions/rand.js.map +1 -1
  111. package/dist/parsing/functions/range.d.ts +7 -0
  112. package/dist/parsing/functions/range.d.ts.map +1 -0
  113. package/dist/parsing/functions/range.js +21 -2
  114. package/dist/parsing/functions/range.js.map +1 -1
  115. package/dist/parsing/functions/reducer_element.d.ts +6 -0
  116. package/dist/parsing/functions/reducer_element.d.ts.map +1 -0
  117. package/dist/parsing/functions/replace.d.ts +7 -0
  118. package/dist/parsing/functions/replace.d.ts.map +1 -0
  119. package/dist/parsing/functions/replace.js +22 -2
  120. package/dist/parsing/functions/replace.js.map +1 -1
  121. package/dist/parsing/functions/round.d.ts +7 -0
  122. package/dist/parsing/functions/round.d.ts.map +1 -0
  123. package/dist/parsing/functions/round.js +20 -2
  124. package/dist/parsing/functions/round.js.map +1 -1
  125. package/dist/parsing/functions/size.d.ts +7 -0
  126. package/dist/parsing/functions/size.d.ts.map +1 -0
  127. package/dist/parsing/functions/size.js +20 -2
  128. package/dist/parsing/functions/size.js.map +1 -1
  129. package/dist/parsing/functions/split.d.ts +9 -0
  130. package/dist/parsing/functions/split.d.ts.map +1 -0
  131. package/dist/parsing/functions/split.js +21 -2
  132. package/dist/parsing/functions/split.js.map +1 -1
  133. package/dist/parsing/functions/stringify.d.ts +9 -0
  134. package/dist/parsing/functions/stringify.d.ts.map +1 -0
  135. package/dist/parsing/functions/stringify.js +20 -2
  136. package/dist/parsing/functions/stringify.js.map +1 -1
  137. package/dist/parsing/functions/sum.d.ts +14 -0
  138. package/dist/parsing/functions/sum.d.ts.map +1 -0
  139. package/dist/parsing/functions/sum.js +20 -2
  140. package/dist/parsing/functions/sum.js.map +1 -1
  141. package/dist/parsing/functions/to_json.d.ts +7 -0
  142. package/dist/parsing/functions/to_json.d.ts.map +1 -0
  143. package/dist/parsing/functions/to_json.js +20 -2
  144. package/dist/parsing/functions/to_json.js.map +1 -1
  145. package/dist/parsing/functions/value_holder.d.ts +8 -0
  146. package/dist/parsing/functions/value_holder.d.ts.map +1 -0
  147. package/dist/parsing/logic/case.d.ts +7 -0
  148. package/dist/parsing/logic/case.d.ts.map +1 -0
  149. package/dist/parsing/logic/else.d.ts +7 -0
  150. package/dist/parsing/logic/else.d.ts.map +1 -0
  151. package/dist/parsing/logic/end.d.ts +6 -0
  152. package/dist/parsing/logic/end.d.ts.map +1 -0
  153. package/dist/parsing/logic/then.d.ts +7 -0
  154. package/dist/parsing/logic/then.d.ts.map +1 -0
  155. package/dist/parsing/logic/when.d.ts +7 -0
  156. package/dist/parsing/logic/when.d.ts.map +1 -0
  157. package/dist/parsing/operations/aggregated_return.d.ts +8 -0
  158. package/dist/parsing/operations/aggregated_return.d.ts.map +1 -0
  159. package/dist/parsing/operations/aggregated_with.d.ts +8 -0
  160. package/dist/parsing/operations/aggregated_with.d.ts.map +1 -0
  161. package/dist/parsing/operations/group_by.d.ts +35 -0
  162. package/dist/parsing/operations/group_by.d.ts.map +1 -0
  163. package/dist/parsing/operations/limit.d.ts +10 -0
  164. package/dist/parsing/operations/limit.d.ts.map +1 -0
  165. package/dist/parsing/operations/load.d.ts +48 -0
  166. package/dist/parsing/operations/load.d.ts.map +1 -0
  167. package/dist/parsing/operations/operation.d.ts +39 -0
  168. package/dist/parsing/operations/operation.d.ts.map +1 -0
  169. package/dist/parsing/operations/projection.d.ts +8 -0
  170. package/dist/parsing/operations/projection.d.ts.map +1 -0
  171. package/dist/parsing/operations/return.d.ts +23 -0
  172. package/dist/parsing/operations/return.d.ts.map +1 -0
  173. package/dist/parsing/operations/unwind.d.ts +12 -0
  174. package/dist/parsing/operations/unwind.d.ts.map +1 -0
  175. package/dist/parsing/operations/where.d.ts +26 -0
  176. package/dist/parsing/operations/where.d.ts.map +1 -0
  177. package/dist/parsing/operations/with.d.ts +17 -0
  178. package/dist/parsing/operations/with.d.ts.map +1 -0
  179. package/dist/parsing/parser.d.ts +66 -0
  180. package/dist/parsing/parser.d.ts.map +1 -0
  181. package/dist/parsing/parser.js +2 -3
  182. package/dist/parsing/parser.js.map +1 -1
  183. package/dist/parsing/token_to_node.d.ts +7 -0
  184. package/dist/parsing/token_to_node.d.ts.map +1 -0
  185. package/dist/tokenization/keyword.d.ts +43 -0
  186. package/dist/tokenization/keyword.d.ts.map +1 -0
  187. package/dist/tokenization/operator.d.ts +22 -0
  188. package/dist/tokenization/operator.d.ts.map +1 -0
  189. package/dist/tokenization/string_walker.d.ts +55 -0
  190. package/dist/tokenization/string_walker.d.ts.map +1 -0
  191. package/dist/tokenization/symbol.d.ts +15 -0
  192. package/dist/tokenization/symbol.d.ts.map +1 -0
  193. package/dist/tokenization/token.d.ts +176 -0
  194. package/dist/tokenization/token.d.ts.map +1 -0
  195. package/dist/tokenization/token_mapper.d.ts +40 -0
  196. package/dist/tokenization/token_mapper.d.ts.map +1 -0
  197. package/dist/tokenization/token_type.d.ts +16 -0
  198. package/dist/tokenization/token_type.d.ts.map +1 -0
  199. package/dist/tokenization/tokenizer.d.ts +45 -0
  200. package/dist/tokenization/tokenizer.d.ts.map +1 -0
  201. package/dist/tokenization/trie.d.ts +41 -0
  202. package/dist/tokenization/trie.d.ts.map +1 -0
  203. package/dist/utils/object_utils.d.ts +15 -0
  204. package/dist/utils/object_utils.d.ts.map +1 -0
  205. package/dist/utils/string_utils.d.ts +51 -0
  206. package/dist/utils/string_utils.d.ts.map +1 -0
  207. package/docs/flowquery.min.js +1 -1
  208. package/flowquery-vscode/flowQueryEngine/flowquery.min.js +1 -1
  209. package/misc/apps/RAG/.env.example +14 -0
  210. package/misc/apps/RAG/README.md +0 -7
  211. package/misc/apps/RAG/package.json +16 -7
  212. package/misc/apps/RAG/public/index.html +18 -0
  213. package/misc/apps/RAG/src/App.css +42 -0
  214. package/misc/apps/RAG/src/App.tsx +50 -0
  215. package/misc/apps/RAG/src/components/ApiKeySettings.tsx +245 -0
  216. package/misc/apps/RAG/src/components/ChatContainer.css +67 -0
  217. package/misc/apps/RAG/src/components/ChatContainer.tsx +239 -0
  218. package/misc/apps/RAG/src/components/ChatInput.css +23 -0
  219. package/misc/apps/RAG/src/components/ChatInput.tsx +62 -0
  220. package/misc/apps/RAG/src/components/ChatMessage.css +136 -0
  221. package/misc/apps/RAG/src/components/ChatMessage.tsx +152 -0
  222. package/misc/apps/RAG/src/components/FlowQueryAgent.ts +390 -0
  223. package/misc/apps/RAG/src/components/FlowQueryRunner.css +104 -0
  224. package/misc/apps/RAG/src/components/FlowQueryRunner.tsx +332 -0
  225. package/misc/apps/RAG/src/components/index.ts +15 -0
  226. package/misc/apps/RAG/src/index.tsx +17 -0
  227. package/misc/apps/RAG/src/plugins/PluginRegistry.ts +136 -0
  228. package/misc/apps/RAG/src/plugins/README.md +139 -0
  229. package/misc/apps/RAG/src/plugins/index.ts +72 -0
  230. package/misc/apps/RAG/src/plugins/loaders/CatFacts.ts +79 -0
  231. package/misc/apps/RAG/src/plugins/loaders/FetchJson.ts +71 -0
  232. package/misc/apps/RAG/src/plugins/loaders/Llm.ts +441 -0
  233. package/misc/apps/RAG/src/plugins/loaders/MockData.ts +161 -0
  234. package/misc/apps/RAG/src/plugins/types.ts +52 -0
  235. package/misc/apps/RAG/src/prompts/FlowQuerySystemPrompt.ts +385 -0
  236. package/misc/apps/RAG/src/prompts/index.ts +10 -0
  237. package/misc/apps/RAG/src/utils/FlowQueryExecutor.ts +131 -0
  238. package/misc/apps/RAG/src/utils/FlowQueryExtractor.ts +203 -0
  239. package/misc/apps/RAG/src/utils/index.ts +9 -0
  240. package/misc/apps/RAG/tsconfig.json +4 -2
  241. package/misc/apps/RAG/webpack.config.js +23 -12
  242. package/package.json +7 -1
  243. package/src/extensibility.ts +9 -0
  244. package/src/parsing/functions/avg.ts +10 -0
  245. package/src/parsing/functions/collect.ts +10 -0
  246. package/src/parsing/functions/extensibility/index.ts +54 -0
  247. package/src/parsing/functions/function_factory.ts +51 -48
  248. package/src/parsing/functions/function_metadata.ts +132 -156
  249. package/src/parsing/functions/functions.ts +27 -0
  250. package/src/parsing/functions/join.ts +11 -0
  251. package/src/parsing/functions/predicate_function.ts +4 -0
  252. package/src/parsing/functions/predicate_sum.ts +13 -0
  253. package/src/parsing/functions/rand.ts +8 -0
  254. package/src/parsing/functions/range.ts +11 -0
  255. package/src/parsing/functions/replace.ts +12 -0
  256. package/src/parsing/functions/round.ts +10 -0
  257. package/src/parsing/functions/size.ts +10 -0
  258. package/src/parsing/functions/split.ts +11 -0
  259. package/src/parsing/functions/stringify.ts +10 -0
  260. package/src/parsing/functions/sum.ts +10 -0
  261. package/src/parsing/functions/to_json.ts +10 -0
  262. package/src/parsing/parser.ts +2 -3
  263. package/tests/parsing/function_plugins.test.ts +11 -11
  264. package/tsconfig.json +4 -1
  265. package/dist/parsing/functions/predicate_function_factory.js +0 -19
  266. package/dist/parsing/functions/predicate_function_factory.js.map +0 -1
  267. package/misc/apps/RAG/src/index.ts +0 -20
  268. package/src/parsing/functions/predicate_function_factory.ts +0 -15
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Represents a node in the Abstract Syntax Tree (AST).
3
+ *
4
+ * The AST is a tree representation of the parsed FlowQuery statement structure.
5
+ * Each node can have children and maintains a reference to its parent.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const root = new ASTNode();
10
+ * const child = new ASTNode();
11
+ * root.addChild(child);
12
+ * ```
13
+ */
14
+ declare class ASTNode {
15
+ protected _parent: ASTNode | null;
16
+ protected children: ASTNode[];
17
+ /**
18
+ * Adds a child node to this node and sets the child's parent reference.
19
+ *
20
+ * @param child - The child node to add
21
+ */
22
+ addChild(child: ASTNode): void;
23
+ /**
24
+ * Returns the first child node.
25
+ *
26
+ * @returns The first child node
27
+ * @throws {Error} If the node has no children
28
+ */
29
+ firstChild(): ASTNode;
30
+ /**
31
+ * Returns the last child node.
32
+ *
33
+ * @returns The last child node
34
+ * @throws {Error} If the node has no children
35
+ */
36
+ lastChild(): ASTNode;
37
+ /**
38
+ * Returns all child nodes.
39
+ *
40
+ * @returns Array of child nodes
41
+ */
42
+ getChildren(): ASTNode[];
43
+ /**
44
+ * Returns the number of child nodes.
45
+ *
46
+ * @returns The count of children
47
+ */
48
+ childCount(): number;
49
+ /**
50
+ * Returns the value of this node. Override in subclasses to provide specific values.
51
+ *
52
+ * @returns The node's value, or null if not applicable
53
+ */
54
+ value(): any;
55
+ /**
56
+ * Checks if this node represents an operator.
57
+ *
58
+ * @returns True if this is an operator node, false otherwise
59
+ */
60
+ isOperator(): boolean;
61
+ /**
62
+ * Checks if this node represents an operand (the opposite of an operator).
63
+ *
64
+ * @returns True if this is an operand node, false otherwise
65
+ */
66
+ isOperand(): boolean;
67
+ /**
68
+ * Gets the operator precedence for this node. Higher values indicate higher precedence.
69
+ *
70
+ * @returns The precedence value (0 for non-operators)
71
+ */
72
+ get precedence(): number;
73
+ /**
74
+ * Indicates whether this operator is left-associative.
75
+ *
76
+ * @returns True if left-associative, false otherwise
77
+ */
78
+ get leftAssociative(): boolean;
79
+ /**
80
+ * Prints a string representation of the AST tree starting from this node.
81
+ *
82
+ * @returns A formatted string showing the tree structure
83
+ */
84
+ print(): string;
85
+ /**
86
+ * Generator function for recursively printing the tree structure.
87
+ *
88
+ * @param indent - The current indentation level
89
+ * @yields Lines representing each node in the tree
90
+ */
91
+ private _print;
92
+ /**
93
+ * Returns a string representation of this node. Override in subclasses for custom formatting.
94
+ *
95
+ * @returns The string representation
96
+ */
97
+ protected toString(): string;
98
+ }
99
+ export default ASTNode;
100
+ //# sourceMappingURL=ast_node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast_node.d.ts","sourceRoot":"","sources":["../../src/parsing/ast_node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAM,OAAO;IACT,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAQ;IACzC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAM;IAEnC;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAKrC;;;;;OAKG;IACI,UAAU,IAAI,OAAO;IAO5B;;;;;OAKG;IACI,SAAS,IAAI,OAAO;IAO3B;;;;OAIG;IACI,WAAW,IAAI,OAAO,EAAE;IAI/B;;;;OAIG;IACI,UAAU,IAAI,MAAM;IAI3B;;;;OAIG;IACI,KAAK,IAAI,GAAG;IAInB;;;;OAIG;IACI,UAAU,IAAI,OAAO;IAI5B;;;;OAIG;IACI,SAAS,IAAI,OAAO;IAI3B;;;;OAIG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;OAIG;IACH,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED;;;;OAIG;IACI,KAAK,IAAI,MAAM;IAItB;;;;;OAKG;IACH,OAAO,CAAE,MAAM;IAWf;;;;OAIG;IACH,SAAS,CAAC,QAAQ,IAAI,MAAM;CAG/B;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,49 @@
1
+ import Token from "../tokenization/token";
2
+ /**
3
+ * Base class for parsers providing common token manipulation functionality.
4
+ *
5
+ * This class handles tokenization and provides utility methods for navigating
6
+ * through tokens, peeking ahead, and checking token sequences.
7
+ */
8
+ declare class BaseParser {
9
+ private tokens;
10
+ private tokenIndex;
11
+ /**
12
+ * Tokenizes a statement and initializes the token array.
13
+ *
14
+ * @param statement - The input statement to tokenize
15
+ */
16
+ protected tokenize(statement: string): void;
17
+ /**
18
+ * Advances to the next token in the sequence.
19
+ */
20
+ protected setNextToken(): void;
21
+ /**
22
+ * Peeks at the next token without advancing the current position.
23
+ *
24
+ * @returns The next token, or null if at the end of the token stream
25
+ */
26
+ protected peek(): Token | null;
27
+ /**
28
+ * Checks if a sequence of tokens appears ahead in the token stream.
29
+ *
30
+ * @param tokens - The sequence of tokens to look for
31
+ * @param skipWhitespaceAndComments - Whether to skip whitespace and comments when matching
32
+ * @returns True if the token sequence is found ahead, false otherwise
33
+ */
34
+ protected ahead(tokens: Token[], skipWhitespaceAndComments?: boolean): boolean;
35
+ /**
36
+ * Gets the current token.
37
+ *
38
+ * @returns The current token, or EOF if at the end
39
+ */
40
+ protected get token(): Token;
41
+ /**
42
+ * Gets the previous token.
43
+ *
44
+ * @returns The previous token, or EOF if at the beginning
45
+ */
46
+ protected get previousToken(): Token;
47
+ }
48
+ export default BaseParser;
49
+ //# sourceMappingURL=base_parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base_parser.d.ts","sourceRoot":"","sources":["../../src/parsing/base_parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAG1C;;;;;GAKG;AACH,cAAM,UAAU;IACZ,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,UAAU,CAAa;IAE/B;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAK3C;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B;;;;OAIG;IACH,SAAS,CAAC,IAAI,IAAI,KAAK,GAAG,IAAI;IAO9B;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,yBAAyB,GAAE,OAAc,GAAG,OAAO;IAiBpF;;;;OAIG;IACH,SAAS,KAAK,KAAK,IAAI,KAAK,CAK3B;IAED;;;;OAIG;IACH,SAAS,KAAK,aAAa,IAAI,KAAK,CAKnC;CACJ;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class CSV extends ASTNode {
3
+ constructor();
4
+ }
5
+ export default CSV;
6
+ //# sourceMappingURL=csv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/csv.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,GAAI,SAAQ,OAAO;;CAIxB;AAED,eAAe,GAAG,CAAC"}
@@ -0,0 +1,7 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class From extends ASTNode {
3
+ constructor();
4
+ value(): string;
5
+ }
6
+ export default From;
7
+ //# sourceMappingURL=from.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/from.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,IAAK,SAAQ,OAAO;;IAIjB,KAAK,IAAI,MAAM;CAGvB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,7 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class Headers extends ASTNode {
3
+ constructor();
4
+ value(): object;
5
+ }
6
+ export default Headers;
7
+ //# sourceMappingURL=headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/headers.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,OAAQ,SAAQ,OAAO;;IAIpB,KAAK,IAAI,MAAM;CAGvB;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class JSON extends ASTNode {
3
+ constructor();
4
+ }
5
+ export default JSON;
6
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/json.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,IAAK,SAAQ,OAAO;;CAIzB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class Null extends ASTNode {
3
+ constructor();
4
+ }
5
+ export default Null;
6
+ //# sourceMappingURL=null.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/null.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,IAAK,SAAQ,OAAO;;CAIzB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class Post extends ASTNode {
3
+ constructor();
4
+ }
5
+ export default Post;
6
+ //# sourceMappingURL=post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/post.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,IAAK,SAAQ,OAAO;;CAIzB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class Text extends ASTNode {
3
+ constructor();
4
+ }
5
+ export default Text;
6
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/parsing/components/text.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,IAAK,SAAQ,OAAO;;CAIzB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,38 @@
1
+ import ASTNode from "./ast_node";
2
+ /**
3
+ * Maintains a stack of AST nodes to track parsing context.
4
+ *
5
+ * Used during parsing to maintain the current context and check for specific node types
6
+ * in the parsing hierarchy, which helps with context-sensitive parsing decisions.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const context = new Context();
11
+ * context.push(node);
12
+ * const hasReturn = context.containsType(Return);
13
+ * ```
14
+ */
15
+ declare class Context {
16
+ private stack;
17
+ /**
18
+ * Pushes a node onto the context stack.
19
+ *
20
+ * @param node - The AST node to push
21
+ */
22
+ push(node: ASTNode): void;
23
+ /**
24
+ * Pops the top node from the context stack.
25
+ *
26
+ * @returns The popped node, or undefined if the stack is empty
27
+ */
28
+ pop(): ASTNode | undefined;
29
+ /**
30
+ * Checks if the stack contains a node of the specified type.
31
+ *
32
+ * @param type - The constructor of the node type to search for
33
+ * @returns True if a node of the specified type is found in the stack, false otherwise
34
+ */
35
+ containsType(type: new (...args: any[]) => ASTNode): boolean;
36
+ }
37
+ export default Context;
38
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/parsing/context.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC;;;;;;;;;;;;GAYG;AACH,cAAM,OAAO;IACT,OAAO,CAAC,KAAK,CAAiB;IAE9B;;;;OAIG;IACI,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAIhC;;;;OAIG;IACI,GAAG,IAAI,OAAO,GAAG,SAAS;IAIjC;;;;;OAKG;IACI,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,GAAG,OAAO;CAGtE;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,28 @@
1
+ import ASTNode from "../ast_node";
2
+ import KeyValuePair from "./key_value_pair";
3
+ /**
4
+ * Represents an associative array (object/dictionary) in the AST.
5
+ *
6
+ * Associative arrays map string keys to values, similar to JSON objects.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // For { name: "Alice", age: 30 }
11
+ * const obj = new AssociativeArray();
12
+ * obj.addKeyValue(new KeyValuePair("name", nameExpr));
13
+ * obj.addKeyValue(new KeyValuePair("age", ageExpr));
14
+ * ```
15
+ */
16
+ declare class AssociativeArray extends ASTNode {
17
+ /**
18
+ * Adds a key-value pair to the associative array.
19
+ *
20
+ * @param keyValuePair - The key-value pair to add
21
+ */
22
+ addKeyValue(keyValuePair: KeyValuePair): void;
23
+ toString(): string;
24
+ private _value;
25
+ value(): Record<string, any>;
26
+ }
27
+ export default AssociativeArray;
28
+ //# sourceMappingURL=associative_array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"associative_array.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/associative_array.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,cAAM,gBAAiB,SAAQ,OAAO;IAClC;;;;OAIG;IACI,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAI7C,QAAQ,IAAI,MAAM;IAGzB,OAAO,CAAE,MAAM;IAQR,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGtC;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import ASTNode from "../ast_node";
2
+ /**
3
+ * Represents a JSON array in the AST.
4
+ *
5
+ * JSON arrays are ordered collections of values.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // For [1, 2, 3]
10
+ * const arr = new JSONArray();
11
+ * arr.addValue(new Number("1"));
12
+ * arr.addValue(new Number("2"));
13
+ * arr.addValue(new Number("3"));
14
+ * ```
15
+ */
16
+ declare class JSONArray extends ASTNode {
17
+ /**
18
+ * Adds a value to the array.
19
+ *
20
+ * @param value - The AST node representing the value to add
21
+ */
22
+ addValue(value: ASTNode): void;
23
+ value(): any[];
24
+ }
25
+ export default JSONArray;
26
+ //# sourceMappingURL=json_array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_array.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/json_array.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;;;;;;GAaG;AACH,cAAM,SAAU,SAAQ,OAAO;IAC3B;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAG9B,KAAK,IAAI,GAAG,EAAE;CAGxB;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,25 @@
1
+ import ASTNode from "../ast_node";
2
+ /**
3
+ * Represents a key-value pair in an associative array.
4
+ *
5
+ * Used to build object literals in FlowQuery.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const kvp = new KeyValuePair("name", new String("Alice"));
10
+ * ```
11
+ */
12
+ declare class KeyValuePair extends ASTNode {
13
+ /**
14
+ * Creates a new key-value pair.
15
+ *
16
+ * @param key - The key string
17
+ * @param value - The AST node representing the value
18
+ */
19
+ constructor(key: string, value: ASTNode);
20
+ get key(): string;
21
+ get _value(): any;
22
+ toString(): string;
23
+ }
24
+ export default KeyValuePair;
25
+ //# sourceMappingURL=key_value_pair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key_value_pair.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/key_value_pair.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC;;;;;;;;;GASG;AACH,cAAM,YAAa,SAAQ,OAAO;IAC9B;;;;;OAKG;gBACS,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAKvC,IAAW,GAAG,IAAI,MAAM,CAEvB;IACD,IAAW,MAAM,IAAI,GAAG,CAEvB;IACM,QAAQ,IAAI,MAAM;CAG5B;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,25 @@
1
+ import ASTNode from "../ast_node";
2
+ /**
3
+ * Represents a lookup operation (array/object indexing) in the AST.
4
+ *
5
+ * Lookups access elements from arrays or properties from objects using an index or key.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // For array[0] or obj.property or obj["key"]
10
+ * const lookup = new Lookup();
11
+ * lookup.variable = arrayOrObjNode;
12
+ * lookup.index = indexNode;
13
+ * ```
14
+ */
15
+ declare class Lookup extends ASTNode {
16
+ constructor();
17
+ set index(index: ASTNode);
18
+ get index(): ASTNode;
19
+ set variable(variable: ASTNode);
20
+ get variable(): ASTNode;
21
+ isOperand(): boolean;
22
+ value(): any;
23
+ }
24
+ export default Lookup;
25
+ //# sourceMappingURL=lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/lookup.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;;;;;GAYG;AACH,cAAM,MAAO,SAAQ,OAAO;;IAIxB,IAAW,KAAK,CAAC,KAAK,EAAE,OAAO,EAE9B;IACD,IAAW,KAAK,IAAI,OAAO,CAE1B;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAEpC;IACD,IAAW,QAAQ,IAAI,OAAO,CAE7B;IACM,SAAS,IAAI,OAAO;IAGpB,KAAK,IAAI,GAAG;CAGtB;AAED,eAAe,MAAM,CAAC"}
@@ -0,0 +1,14 @@
1
+ import ASTNode from "../ast_node";
2
+ declare class RangeLookup extends ASTNode {
3
+ constructor();
4
+ set from(from: ASTNode);
5
+ get from(): ASTNode;
6
+ set to(to: ASTNode);
7
+ get to(): ASTNode;
8
+ set variable(variable: ASTNode);
9
+ get variable(): ASTNode;
10
+ isOperand(): boolean;
11
+ value(): any;
12
+ }
13
+ export default RangeLookup;
14
+ //# sourceMappingURL=range_lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range_lookup.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/range_lookup.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,WAAY,SAAQ,OAAO;;IAI7B,IAAW,IAAI,CAAC,IAAI,EAAE,OAAO,EAE5B;IACD,IAAW,IAAI,IAAI,OAAO,CAEzB;IACD,IAAW,EAAE,CAAC,EAAE,EAAE,OAAO,EAExB;IACD,IAAW,EAAE,IAAI,OAAO,CAEvB;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAEpC;IACD,IAAW,QAAQ,IAAI,OAAO,CAE7B;IACM,SAAS,IAAI,OAAO;IAGpB,KAAK,IAAI,GAAG;CAMtB;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,53 @@
1
+ import ASTNode from "../ast_node";
2
+ import AggregateFunction from "../functions/aggregate_function";
3
+ /**
4
+ * Represents an expression in the FlowQuery AST.
5
+ *
6
+ * Expressions are built using the Shunting Yard algorithm to handle operator
7
+ * precedence and associativity. They can contain operands (numbers, strings, identifiers)
8
+ * and operators (arithmetic, logical, comparison).
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const expr = new Expression();
13
+ * expr.addNode(numberNode);
14
+ * expr.addNode(plusOperator);
15
+ * expr.addNode(anotherNumberNode);
16
+ * expr.finish();
17
+ * ```
18
+ */
19
+ declare class Expression extends ASTNode {
20
+ private operators;
21
+ private output;
22
+ private _alias;
23
+ private _overridden;
24
+ private _reducers;
25
+ /**
26
+ * Adds a node (operand or operator) to the expression.
27
+ *
28
+ * Uses the Shunting Yard algorithm to maintain correct operator precedence.
29
+ *
30
+ * @param node - The AST node to add (operand or operator)
31
+ */
32
+ addNode(node: ASTNode): void;
33
+ /**
34
+ * Finalizes the expression by converting it to a tree structure.
35
+ *
36
+ * Should be called after all nodes have been added.
37
+ */
38
+ finish(): void;
39
+ private toTree;
40
+ nodesAdded(): boolean;
41
+ value(): any;
42
+ setAlias(alias: string): void;
43
+ set alias(alias: string);
44
+ get alias(): string | null;
45
+ toString(): string;
46
+ reducers(): AggregateFunction[];
47
+ private _extract_reducers;
48
+ mappable(): boolean;
49
+ has_reducers(): boolean;
50
+ set overridden(value: any);
51
+ }
52
+ export default Expression;
53
+ //# sourceMappingURL=expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/expression.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAGhE;;;;;;;;;;;;;;;GAeG;AACH,cAAM,UAAW,SAAQ,OAAO;IAC5B,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,SAAS,CAAoC;IAErD;;;;;;OAMG;IACI,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAsBnC;;;;OAIG;IACI,MAAM,IAAI,IAAI;IAQrB,OAAO,CAAC,MAAM;IAWP,UAAU,IAAI,OAAO;IAIrB,KAAK,IAAI,GAAG;IAUZ,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIpC,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,IAAW,KAAK,IAAI,MAAM,GAAG,IAAI,CAKhC;IAEM,QAAQ,IAAI,MAAM;IAOlB,QAAQ,IAAI,iBAAiB,EAAE;IAMtC,OAAO,CAAE,iBAAiB;IAQnB,QAAQ,IAAI,OAAO;IAGnB,YAAY,IAAI,OAAO;IAG9B,IAAW,UAAU,CAAC,KAAK,EAAE,GAAG,EAE/B;CACJ;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import ASTNode from "../ast_node";
2
+ /**
3
+ * Represents a formatted string (f-string) in the AST.
4
+ *
5
+ * F-strings allow embedding expressions within string literals.
6
+ * Child nodes represent the parts of the f-string (literal strings and expressions).
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // For f"Hello {name}!"
11
+ * const fstr = new FString();
12
+ * fstr.addChild(new String("Hello "));
13
+ * fstr.addChild(nameExpression);
14
+ * fstr.addChild(new String("!"));
15
+ * ```
16
+ */
17
+ declare class FString extends ASTNode {
18
+ value(): string;
19
+ }
20
+ export default FString;
21
+ //# sourceMappingURL=f_string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"f_string.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/f_string.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC;;;;;;;;;;;;;;GAcG;AACH,cAAM,OAAQ,SAAQ,OAAO;IAClB,KAAK,IAAI,MAAM;CAIzB;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,17 @@
1
+ import String from "./string";
2
+ /**
3
+ * Represents an identifier in the AST.
4
+ *
5
+ * Identifiers are used for variable names, property names, and similar constructs.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const id = new Identifier("myVariable");
10
+ * ```
11
+ */
12
+ declare class Identifier extends String {
13
+ toString(): string;
14
+ value(): any;
15
+ }
16
+ export default Identifier;
17
+ //# sourceMappingURL=identifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B;;;;;;;;;GASG;AACH,cAAM,UAAW,SAAQ,MAAM;IACpB,QAAQ,IAAI,MAAM;IAGlB,KAAK,IAAI,GAAG;CAGtB;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,25 @@
1
+ import ASTNode from "../ast_node";
2
+ /**
3
+ * Represents a numeric literal in the AST.
4
+ *
5
+ * Parses string representations of numbers into integer or float values.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const num = new Number("42");
10
+ * console.log(num.value()); // 42
11
+ * ```
12
+ */
13
+ declare class Number extends ASTNode {
14
+ private _value;
15
+ /**
16
+ * Creates a new Number node by parsing the string value.
17
+ *
18
+ * @param value - The string representation of the number
19
+ */
20
+ constructor(value: string);
21
+ value(): number;
22
+ protected toString(): string;
23
+ }
24
+ export default Number;
25
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/number.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;;;GAUG;AACH,cAAM,MAAO,SAAQ,OAAO;IACxB,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;OAIG;gBACS,KAAK,EAAE,MAAM;IASlB,KAAK,IAAI,MAAM;IAItB,SAAS,CAAC,QAAQ,IAAI,MAAM;CAG/B;AAED,eAAe,MAAM,CAAC"}
@@ -0,0 +1,79 @@
1
+ import ASTNode from "../ast_node";
2
+ declare abstract class Operator extends ASTNode {
3
+ private _precedence;
4
+ private _leftAssociative;
5
+ constructor(precedence: number, leftAssociative: boolean);
6
+ isOperator(): boolean;
7
+ get precedence(): number;
8
+ get leftAssociative(): boolean;
9
+ abstract value(): number;
10
+ get lhs(): ASTNode;
11
+ get rhs(): ASTNode;
12
+ }
13
+ declare class Add extends Operator {
14
+ constructor();
15
+ value(): number;
16
+ }
17
+ declare class Subtract extends Operator {
18
+ constructor();
19
+ value(): number;
20
+ }
21
+ declare class Multiply extends Operator {
22
+ constructor();
23
+ value(): number;
24
+ }
25
+ declare class Divide extends Operator {
26
+ constructor();
27
+ value(): number;
28
+ }
29
+ declare class Modulo extends Operator {
30
+ constructor();
31
+ value(): number;
32
+ }
33
+ declare class Power extends Operator {
34
+ constructor();
35
+ value(): number;
36
+ }
37
+ declare class Equals extends Operator {
38
+ constructor();
39
+ value(): number;
40
+ }
41
+ declare class NotEquals extends Operator {
42
+ constructor();
43
+ value(): number;
44
+ }
45
+ declare class GreaterThan extends Operator {
46
+ constructor();
47
+ value(): number;
48
+ }
49
+ declare class LessThan extends Operator {
50
+ constructor();
51
+ value(): number;
52
+ }
53
+ declare class GreaterThanOrEqual extends Operator {
54
+ constructor();
55
+ value(): number;
56
+ }
57
+ declare class LessThanOrEqual extends Operator {
58
+ constructor();
59
+ value(): number;
60
+ }
61
+ declare class And extends Operator {
62
+ constructor();
63
+ value(): number;
64
+ }
65
+ declare class Or extends Operator {
66
+ constructor();
67
+ value(): number;
68
+ }
69
+ declare class Not extends Operator {
70
+ constructor();
71
+ isOperator(): boolean;
72
+ value(): number;
73
+ }
74
+ declare class Is extends Operator {
75
+ constructor();
76
+ value(): number;
77
+ }
78
+ export { Operator, Add, Subtract, Multiply, Divide, Modulo, Power, Equals, NotEquals, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, And, Or, Not, Is };
79
+ //# sourceMappingURL=operator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/operator.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,uBAAe,QAAS,SAAQ,OAAO;IACnC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,gBAAgB,CAAiB;gBAE7B,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO;IAMjD,UAAU,IAAI,OAAO;IAI5B,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,IAAW,eAAe,IAAI,OAAO,CAEpC;aACe,KAAK,IAAI,MAAM;IAC/B,IAAW,GAAG,IAAI,OAAO,CAExB;IACD,IAAW,GAAG,IAAI,OAAO,CAExB;CACJ;AAED,cAAM,GAAI,SAAQ,QAAQ;;IAIf,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,QAAS,SAAQ,QAAQ;;IAIpB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,QAAS,SAAQ,QAAQ;;IAIpB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,MAAO,SAAQ,QAAQ;;IAIlB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,MAAO,SAAQ,QAAQ;;IAIlB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,KAAM,SAAQ,QAAQ;;IAIjB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,MAAO,SAAQ,QAAQ;;IAIlB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,SAAU,SAAQ,QAAQ;;IAIrB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,WAAY,SAAQ,QAAQ;;IAIvB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,QAAS,SAAQ,QAAQ;;IAIpB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,kBAAmB,SAAQ,QAAQ;;IAI9B,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,eAAgB,SAAQ,QAAQ;;IAI3B,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,GAAI,SAAQ,QAAQ;;IAIf,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,EAAG,SAAQ,QAAQ;;IAId,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,GAAI,SAAQ,QAAQ;;IAIf,UAAU,IAAI,OAAO;IAGrB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,EAAG,SAAQ,QAAQ;;IAId,KAAK,IAAI,MAAM;CAGzB;AAED,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC"}