@mpeggroup/mpeg-sdl-parser 4.1.1 → 4.1.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.
Files changed (1150) hide show
  1. package/README.md +13 -12
  2. package/dist/index.d.ts +82 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +82 -11833
  5. package/dist/src/analyser/checks/check-array-definition.d.ts +3 -0
  6. package/dist/src/analyser/checks/check-array-definition.d.ts.map +1 -0
  7. package/dist/src/analyser/checks/check-array-definition.js +54 -0
  8. package/dist/src/analyser/checks/check-array-element-access.d.ts +3 -0
  9. package/dist/src/analyser/checks/check-array-element-access.d.ts.map +1 -0
  10. package/dist/src/analyser/checks/check-array-element-access.js +19 -0
  11. package/dist/src/analyser/checks/check-class-declaration.d.ts +3 -0
  12. package/dist/src/analyser/checks/check-class-declaration.d.ts.map +1 -0
  13. package/dist/src/analyser/checks/check-class-declaration.js +252 -0
  14. package/dist/src/analyser/checks/check-computed-array-definition.d.ts +3 -0
  15. package/dist/src/analyser/checks/check-computed-array-definition.d.ts.map +1 -0
  16. package/dist/src/analyser/checks/check-computed-array-definition.js +29 -0
  17. package/dist/src/analyser/checks/check-computed-elementary-type-definition.d.ts +3 -0
  18. package/dist/src/analyser/checks/check-computed-elementary-type-definition.d.ts.map +1 -0
  19. package/dist/src/analyser/checks/check-computed-elementary-type-definition.js +27 -0
  20. package/dist/src/analyser/checks/check-elementary-type-definition.d.ts +3 -0
  21. package/dist/src/analyser/checks/check-elementary-type-definition.d.ts.map +1 -0
  22. package/dist/src/analyser/checks/check-elementary-type-definition.js +121 -0
  23. package/dist/src/analyser/checks/check-expression-binary.d.ts +3 -0
  24. package/dist/src/analyser/checks/check-expression-binary.d.ts.map +1 -0
  25. package/dist/src/analyser/checks/check-expression-binary.js +177 -0
  26. package/dist/src/analyser/checks/check-expression-lengthof.d.ts +3 -0
  27. package/dist/src/analyser/checks/check-expression-lengthof.d.ts.map +1 -0
  28. package/dist/src/analyser/checks/check-expression-lengthof.js +23 -0
  29. package/dist/src/analyser/checks/check-expression-unary.d.ts +3 -0
  30. package/dist/src/analyser/checks/check-expression-unary.d.ts.map +1 -0
  31. package/dist/src/analyser/checks/check-expression-unary.js +104 -0
  32. package/dist/src/analyser/checks/check-identifier.d.ts +3 -0
  33. package/dist/src/analyser/checks/check-identifier.d.ts.map +1 -0
  34. package/dist/src/analyser/checks/check-identifier.js +55 -0
  35. package/dist/src/analyser/checks/check-if-statement.d.ts +5 -0
  36. package/dist/src/analyser/checks/check-if-statement.d.ts.map +1 -0
  37. package/dist/src/analyser/checks/check-if-statement.js +122 -0
  38. package/dist/src/analyser/checks/check-map-declaration.d.ts +3 -0
  39. package/dist/src/analyser/checks/check-map-declaration.d.ts.map +1 -0
  40. package/dist/src/analyser/checks/check-map-declaration.js +130 -0
  41. package/dist/src/analyser/checks/check-map-definition.d.ts +3 -0
  42. package/dist/src/analyser/checks/check-map-definition.d.ts.map +1 -0
  43. package/dist/src/analyser/checks/check-map-definition.js +72 -0
  44. package/dist/src/analyser/checks/check-number-literal-float.d.ts +3 -0
  45. package/dist/src/analyser/checks/check-number-literal-float.d.ts.map +1 -0
  46. package/dist/src/analyser/checks/check-number-literal-float.js +17 -0
  47. package/dist/src/analyser/checks/check-parameter-list.d.ts +3 -0
  48. package/dist/src/analyser/checks/check-parameter-list.d.ts.map +1 -0
  49. package/dist/src/analyser/checks/check-parameter-list.js +26 -0
  50. package/dist/src/analyser/checks/check-specification.d.ts +3 -0
  51. package/dist/src/analyser/checks/check-specification.d.ts.map +1 -0
  52. package/dist/src/analyser/checks/check-specification.js +37 -0
  53. package/dist/src/analyser/checks/check-switch-statement.d.ts +3 -0
  54. package/dist/src/analyser/checks/check-switch-statement.d.ts.map +1 -0
  55. package/dist/src/analyser/checks/check-switch-statement.js +140 -0
  56. package/dist/src/analyser/checks/check.d.ts +15 -0
  57. package/dist/src/analyser/checks/check.d.ts.map +1 -0
  58. package/dist/src/analyser/checks/check.js +1 -0
  59. package/dist/src/analyser/create-sdl-analyser.d.ts +18 -0
  60. package/dist/src/analyser/create-sdl-analyser.d.ts.map +1 -0
  61. package/dist/src/analyser/create-sdl-analyser.js +72 -0
  62. package/dist/src/analyser/node-handler/abstract-analysis-node-handler.d.ts +63 -0
  63. package/dist/src/analyser/node-handler/abstract-analysis-node-handler.d.ts.map +1 -0
  64. package/dist/src/analyser/node-handler/abstract-analysis-node-handler.js +376 -0
  65. package/dist/src/analyser/node-handler/build-symbol-table-node-handler.d.ts +18 -0
  66. package/dist/src/analyser/node-handler/build-symbol-table-node-handler.d.ts.map +1 -0
  67. package/dist/src/analyser/node-handler/build-symbol-table-node-handler.js +350 -0
  68. package/dist/src/analyser/node-handler/specific-check-node-handler.d.ts +9 -0
  69. package/dist/src/analyser/node-handler/specific-check-node-handler.d.ts.map +1 -0
  70. package/dist/src/analyser/node-handler/specific-check-node-handler.js +29 -0
  71. package/dist/src/analyser/node-handler/validate-scope-node-handler.d.ts +18 -0
  72. package/dist/src/analyser/node-handler/validate-scope-node-handler.d.ts.map +1 -0
  73. package/dist/src/analyser/node-handler/validate-scope-node-handler.js +144 -0
  74. package/dist/src/analyser/node-handler/validate-type-node-handler.d.ts +13 -0
  75. package/dist/src/analyser/node-handler/validate-type-node-handler.d.ts.map +1 -0
  76. package/dist/src/analyser/node-handler/validate-type-node-handler.js +240 -0
  77. package/dist/src/analyser/sdl-analyser.d.ts +20 -0
  78. package/dist/src/analyser/sdl-analyser.d.ts.map +1 -0
  79. package/dist/src/analyser/sdl-analyser.js +69 -0
  80. package/dist/src/analyser/symbol-table.d.ts +103 -0
  81. package/dist/src/analyser/symbol-table.d.ts.map +1 -0
  82. package/dist/src/analyser/symbol-table.js +239 -0
  83. package/dist/src/analyser/util/symbol-table-utils.d.ts +67 -0
  84. package/dist/src/analyser/util/symbol-table-utils.d.ts.map +1 -0
  85. package/dist/src/analyser/util/symbol-table-utils.js +279 -0
  86. package/dist/src/analyser/util/type-utils.d.ts +14 -0
  87. package/dist/src/analyser/util/type-utils.d.ts.map +1 -0
  88. package/dist/src/analyser/util/type-utils.js +147 -0
  89. package/dist/src/ast/build/consume/consume-abstract-node.d.ts +20 -0
  90. package/dist/src/ast/build/consume/consume-abstract-node.d.ts.map +1 -0
  91. package/dist/src/ast/build/consume/consume-abstract-node.js +160 -0
  92. package/dist/src/ast/build/consume/consume-ast-node.d.ts +4 -0
  93. package/dist/src/ast/build/consume/consume-ast-node.d.ts.map +1 -0
  94. package/dist/src/ast/build/consume/consume-ast-node.js +297 -0
  95. package/dist/src/ast/build/consume/consume-primitive.d.ts +4 -0
  96. package/dist/src/ast/build/consume/consume-primitive.d.ts.map +1 -0
  97. package/dist/src/ast/build/consume/consume-primitive.js +47 -0
  98. package/dist/src/ast/build/consume/consume-trivia.d.ts +8 -0
  99. package/dist/src/ast/build/consume/consume-trivia.d.ts.map +1 -0
  100. package/dist/src/ast/build/consume/consume-trivia.js +67 -0
  101. package/dist/src/ast/build/consume/consume-white-space-and-missing-errors.d.ts +3 -0
  102. package/dist/src/ast/build/consume/consume-white-space-and-missing-errors.d.ts.map +1 -0
  103. package/dist/src/ast/build/consume/consume-white-space-and-missing-errors.js +17 -0
  104. package/dist/src/ast/build/node/build-aggregate-output-value.d.ts +4 -0
  105. package/dist/src/ast/build/node/build-aggregate-output-value.d.ts.map +1 -0
  106. package/dist/src/ast/build/node/build-aggregate-output-value.js +24 -0
  107. package/dist/src/ast/build/node/build-aligned-modifier.d.ts +4 -0
  108. package/dist/src/ast/build/node/build-aligned-modifier.d.ts.map +1 -0
  109. package/dist/src/ast/build/node/build-aligned-modifier.js +58 -0
  110. package/dist/src/ast/build/node/build-array-definition.d.ts +4 -0
  111. package/dist/src/ast/build/node/build-array-definition.d.ts.map +1 -0
  112. package/dist/src/ast/build/node/build-array-definition.js +57 -0
  113. package/dist/src/ast/build/node/build-array-element-access.d.ts +4 -0
  114. package/dist/src/ast/build/node/build-array-element-access.d.ts.map +1 -0
  115. package/dist/src/ast/build/node/build-array-element-access.js +19 -0
  116. package/dist/src/ast/build/node/build-base64-string-literal.d.ts +4 -0
  117. package/dist/src/ast/build/node/build-base64-string-literal.d.ts.map +1 -0
  118. package/dist/src/ast/build/node/build-base64-string-literal.js +24 -0
  119. package/dist/src/ast/build/node/build-binary-expression.d.ts +4 -0
  120. package/dist/src/ast/build/node/build-binary-expression.d.ts.map +1 -0
  121. package/dist/src/ast/build/node/build-binary-expression.js +90 -0
  122. package/dist/src/ast/build/node/build-binary-literal.d.ts +4 -0
  123. package/dist/src/ast/build/node/build-binary-literal.d.ts.map +1 -0
  124. package/dist/src/ast/build/node/build-binary-literal.js +16 -0
  125. package/dist/src/ast/build/node/build-bit-modifier.d.ts +4 -0
  126. package/dist/src/ast/build/node/build-bit-modifier.d.ts.map +1 -0
  127. package/dist/src/ast/build/node/build-bit-modifier.js +33 -0
  128. package/dist/src/ast/build/node/build-case-clause.d.ts +4 -0
  129. package/dist/src/ast/build/node/build-case-clause.d.ts.map +1 -0
  130. package/dist/src/ast/build/node/build-case-clause.js +43 -0
  131. package/dist/src/ast/build/node/build-class-declaration.d.ts +4 -0
  132. package/dist/src/ast/build/node/build-class-declaration.d.ts.map +1 -0
  133. package/dist/src/ast/build/node/build-class-declaration.js +46 -0
  134. package/dist/src/ast/build/node/build-class-definition.d.ts +4 -0
  135. package/dist/src/ast/build/node/build-class-definition.d.ts.map +1 -0
  136. package/dist/src/ast/build/node/build-class-definition.js +22 -0
  137. package/dist/src/ast/build/node/build-class-id-range.d.ts +4 -0
  138. package/dist/src/ast/build/node/build-class-id-range.d.ts.map +1 -0
  139. package/dist/src/ast/build/node/build-class-id-range.js +15 -0
  140. package/dist/src/ast/build/node/build-class-id.d.ts +4 -0
  141. package/dist/src/ast/build/node/build-class-id.d.ts.map +1 -0
  142. package/dist/src/ast/build/node/build-class-id.js +7 -0
  143. package/dist/src/ast/build/node/build-class-member-access.d.ts +4 -0
  144. package/dist/src/ast/build/node/build-class-member-access.d.ts.map +1 -0
  145. package/dist/src/ast/build/node/build-class-member-access.js +12 -0
  146. package/dist/src/ast/build/node/build-compound-statement.d.ts +4 -0
  147. package/dist/src/ast/build/node/build-compound-statement.d.ts.map +1 -0
  148. package/dist/src/ast/build/node/build-compound-statement.js +15 -0
  149. package/dist/src/ast/build/node/build-computed-array-definition.d.ts +4 -0
  150. package/dist/src/ast/build/node/build-computed-array-definition.d.ts.map +1 -0
  151. package/dist/src/ast/build/node/build-computed-array-definition.js +14 -0
  152. package/dist/src/ast/build/node/build-computed-elementary-type-definition.d.ts +4 -0
  153. package/dist/src/ast/build/node/build-computed-elementary-type-definition.d.ts.map +1 -0
  154. package/dist/src/ast/build/node/build-computed-elementary-type-definition.js +37 -0
  155. package/dist/src/ast/build/node/build-decimal-literal.d.ts +4 -0
  156. package/dist/src/ast/build/node/build-decimal-literal.d.ts.map +1 -0
  157. package/dist/src/ast/build/node/build-decimal-literal.js +6 -0
  158. package/dist/src/ast/build/node/build-default-clause.d.ts +4 -0
  159. package/dist/src/ast/build/node/build-default-clause.d.ts.map +1 -0
  160. package/dist/src/ast/build/node/build-default-clause.js +30 -0
  161. package/dist/src/ast/build/node/build-do-statement.d.ts +4 -0
  162. package/dist/src/ast/build/node/build-do-statement.d.ts.map +1 -0
  163. package/dist/src/ast/build/node/build-do-statement.js +24 -0
  164. package/dist/src/ast/build/node/build-elementary-type-definition.d.ts +4 -0
  165. package/dist/src/ast/build/node/build-elementary-type-definition.d.ts.map +1 -0
  166. package/dist/src/ast/build/node/build-elementary-type-definition.js +71 -0
  167. package/dist/src/ast/build/node/build-elementary-type-output-value.d.ts +4 -0
  168. package/dist/src/ast/build/node/build-elementary-type-output-value.d.ts.map +1 -0
  169. package/dist/src/ast/build/node/build-elementary-type-output-value.js +13 -0
  170. package/dist/src/ast/build/node/build-elementary-type.d.ts +4 -0
  171. package/dist/src/ast/build/node/build-elementary-type.d.ts.map +1 -0
  172. package/dist/src/ast/build/node/build-elementary-type.js +19 -0
  173. package/dist/src/ast/build/node/build-expandable-modifier.d.ts +4 -0
  174. package/dist/src/ast/build/node/build-expandable-modifier.d.ts.map +1 -0
  175. package/dist/src/ast/build/node/build-expandable-modifier.js +31 -0
  176. package/dist/src/ast/build/node/build-explicit-array-dimension.d.ts +4 -0
  177. package/dist/src/ast/build/node/build-explicit-array-dimension.d.ts.map +1 -0
  178. package/dist/src/ast/build/node/build-explicit-array-dimension.js +18 -0
  179. package/dist/src/ast/build/node/build-expression-statement.d.ts +4 -0
  180. package/dist/src/ast/build/node/build-expression-statement.d.ts.map +1 -0
  181. package/dist/src/ast/build/node/build-expression-statement.js +12 -0
  182. package/dist/src/ast/build/node/build-extended-class-id-range.d.ts +4 -0
  183. package/dist/src/ast/build/node/build-extended-class-id-range.d.ts.map +1 -0
  184. package/dist/src/ast/build/node/build-extended-class-id-range.js +10 -0
  185. package/dist/src/ast/build/node/build-extends-modifier.d.ts +4 -0
  186. package/dist/src/ast/build/node/build-extends-modifier.d.ts.map +1 -0
  187. package/dist/src/ast/build/node/build-extends-modifier.js +16 -0
  188. package/dist/src/ast/build/node/build-floating-point-literal.d.ts +4 -0
  189. package/dist/src/ast/build/node/build-floating-point-literal.d.ts.map +1 -0
  190. package/dist/src/ast/build/node/build-floating-point-literal.js +6 -0
  191. package/dist/src/ast/build/node/build-for-statement.d.ts +4 -0
  192. package/dist/src/ast/build/node/build-for-statement.d.ts.map +1 -0
  193. package/dist/src/ast/build/node/build-for-statement.js +53 -0
  194. package/dist/src/ast/build/node/build-hexadecimal-literal.d.ts +4 -0
  195. package/dist/src/ast/build/node/build-hexadecimal-literal.d.ts.map +1 -0
  196. package/dist/src/ast/build/node/build-hexadecimal-literal.js +16 -0
  197. package/dist/src/ast/build/node/build-identifier.d.ts +4 -0
  198. package/dist/src/ast/build/node/build-identifier.d.ts.map +1 -0
  199. package/dist/src/ast/build/node/build-identifier.js +4 -0
  200. package/dist/src/ast/build/node/build-if-statement.d.ts +4 -0
  201. package/dist/src/ast/build/node/build-if-statement.d.ts.map +1 -0
  202. package/dist/src/ast/build/node/build-if-statement.js +31 -0
  203. package/dist/src/ast/build/node/build-implicit-array-dimension.d.ts +4 -0
  204. package/dist/src/ast/build/node/build-implicit-array-dimension.d.ts.map +1 -0
  205. package/dist/src/ast/build/node/build-implicit-array-dimension.js +37 -0
  206. package/dist/src/ast/build/node/build-integer-literal.d.ts +4 -0
  207. package/dist/src/ast/build/node/build-integer-literal.d.ts.map +1 -0
  208. package/dist/src/ast/build/node/build-integer-literal.js +6 -0
  209. package/dist/src/ast/build/node/build-length-attribute.d.ts +4 -0
  210. package/dist/src/ast/build/node/build-length-attribute.d.ts.map +1 -0
  211. package/dist/src/ast/build/node/build-length-attribute.js +18 -0
  212. package/dist/src/ast/build/node/build-lengthof-expression.d.ts +4 -0
  213. package/dist/src/ast/build/node/build-lengthof-expression.d.ts.map +1 -0
  214. package/dist/src/ast/build/node/build-lengthof-expression.js +14 -0
  215. package/dist/src/ast/build/node/build-map-declaration.d.ts +4 -0
  216. package/dist/src/ast/build/node/build-map-declaration.d.ts.map +1 -0
  217. package/dist/src/ast/build/node/build-map-declaration.js +43 -0
  218. package/dist/src/ast/build/node/build-map-definition.d.ts +4 -0
  219. package/dist/src/ast/build/node/build-map-definition.d.ts.map +1 -0
  220. package/dist/src/ast/build/node/build-map-definition.js +42 -0
  221. package/dist/src/ast/build/node/build-map-entry.d.ts +4 -0
  222. package/dist/src/ast/build/node/build-map-entry.d.ts.map +1 -0
  223. package/dist/src/ast/build/node/build-map-entry.js +14 -0
  224. package/dist/src/ast/build/node/build-missing-error.d.ts +4 -0
  225. package/dist/src/ast/build/node/build-missing-error.d.ts.map +1 -0
  226. package/dist/src/ast/build/node/build-missing-error.js +7 -0
  227. package/dist/src/ast/build/node/build-multiple-character-literal.d.ts +4 -0
  228. package/dist/src/ast/build/node/build-multiple-character-literal.d.ts.map +1 -0
  229. package/dist/src/ast/build/node/build-multiple-character-literal.js +38 -0
  230. package/dist/src/ast/build/node/build-parameter-list.d.ts +4 -0
  231. package/dist/src/ast/build/node/build-parameter-list.d.ts.map +1 -0
  232. package/dist/src/ast/build/node/build-parameter-list.js +20 -0
  233. package/dist/src/ast/build/node/build-parameter-value-list.d.ts +4 -0
  234. package/dist/src/ast/build/node/build-parameter-value-list.d.ts.map +1 -0
  235. package/dist/src/ast/build/node/build-parameter-value-list.js +20 -0
  236. package/dist/src/ast/build/node/build-parameter.d.ts +4 -0
  237. package/dist/src/ast/build/node/build-parameter.d.ts.map +1 -0
  238. package/dist/src/ast/build/node/build-parameter.js +25 -0
  239. package/dist/src/ast/build/node/build-partial-array-dimension.d.ts +4 -0
  240. package/dist/src/ast/build/node/build-partial-array-dimension.d.ts.map +1 -0
  241. package/dist/src/ast/build/node/build-partial-array-dimension.js +22 -0
  242. package/dist/src/ast/build/node/build-specification.d.ts +4 -0
  243. package/dist/src/ast/build/node/build-specification.d.ts.map +1 -0
  244. package/dist/src/ast/build/node/build-specification.js +12 -0
  245. package/dist/src/ast/build/node/build-string-definition.d.ts +4 -0
  246. package/dist/src/ast/build/node/build-string-definition.d.ts.map +1 -0
  247. package/dist/src/ast/build/node/build-string-definition.js +50 -0
  248. package/dist/src/ast/build/node/build-switch-statement.d.ts +4 -0
  249. package/dist/src/ast/build/node/build-switch-statement.d.ts.map +1 -0
  250. package/dist/src/ast/build/node/build-switch-statement.js +28 -0
  251. package/dist/src/ast/build/node/build-token.d.ts +4 -0
  252. package/dist/src/ast/build/node/build-token.d.ts.map +1 -0
  253. package/dist/src/ast/build/node/build-token.js +16 -0
  254. package/dist/src/ast/build/node/build-unary-expression.d.ts +6 -0
  255. package/dist/src/ast/build/node/build-unary-expression.d.ts.map +1 -0
  256. package/dist/src/ast/build/node/build-unary-expression.js +53 -0
  257. package/dist/src/ast/build/node/build-unexpected-error.d.ts +4 -0
  258. package/dist/src/ast/build/node/build-unexpected-error.d.ts.map +1 -0
  259. package/dist/src/ast/build/node/build-unexpected-error.js +6 -0
  260. package/dist/src/ast/build/node/build-utf-string-literal.d.ts +4 -0
  261. package/dist/src/ast/build/node/build-utf-string-literal.d.ts.map +1 -0
  262. package/dist/src/ast/build/node/build-utf-string-literal.js +54 -0
  263. package/dist/src/ast/build/node/build-while-statement.d.ts +4 -0
  264. package/dist/src/ast/build/node/build-while-statement.d.ts.map +1 -0
  265. package/dist/src/ast/build/node/build-while-statement.js +12 -0
  266. package/dist/src/ast/build/util/array-dimension-kind-by-token-type-id-map.d.ts +3 -0
  267. package/dist/src/ast/build/util/array-dimension-kind-by-token-type-id-map.d.ts.map +1 -0
  268. package/dist/src/ast/build/util/array-dimension-kind-by-token-type-id-map.js +152 -0
  269. package/dist/src/ast/build/util/binary-operator-kind-by-token-type-id-map.d.ts +3 -0
  270. package/dist/src/ast/build/util/binary-operator-kind-by-token-type-id-map.d.ts.map +1 -0
  271. package/dist/src/ast/build/util/binary-operator-kind-by-token-type-id-map.js +145 -0
  272. package/dist/src/ast/build/util/build-context.d.ts +35 -0
  273. package/dist/src/ast/build/util/build-context.d.ts.map +1 -0
  274. package/dist/src/ast/build/util/build-context.js +1 -0
  275. package/dist/src/ast/build/util/class-id-kind-by-token-type-id-map.d.ts +3 -0
  276. package/dist/src/ast/build/util/class-id-kind-by-token-type-id-map.d.ts.map +1 -0
  277. package/dist/src/ast/build/util/class-id-kind-by-token-type-id-map.js +152 -0
  278. package/dist/src/ast/build/util/expression-kind-by-token-type-id-map.d.ts +3 -0
  279. package/dist/src/ast/build/util/expression-kind-by-token-type-id-map.d.ts.map +1 -0
  280. package/dist/src/ast/build/util/expression-kind-by-token-type-id-map.js +152 -0
  281. package/dist/src/ast/build/util/fetch-node.d.ts +13 -0
  282. package/dist/src/ast/build/util/fetch-node.d.ts.map +1 -0
  283. package/dist/src/ast/build/util/fetch-node.js +285 -0
  284. package/dist/src/ast/build/util/node-kind-by-token-type-id-map.d.ts +3 -0
  285. package/dist/src/ast/build/util/node-kind-by-token-type-id-map.d.ts.map +1 -0
  286. package/dist/src/ast/build/util/node-kind-by-token-type-id-map.js +193 -0
  287. package/dist/src/ast/build/util/statement-kind-by-token-type-id-map.d.ts +3 -0
  288. package/dist/src/ast/build/util/statement-kind-by-token-type-id-map.d.ts.map +1 -0
  289. package/dist/src/ast/build/util/statement-kind-by-token-type-id-map.js +178 -0
  290. package/dist/src/ast/build/util/string-literal-kind-by-token-type-id-map.d.ts +3 -0
  291. package/dist/src/ast/build/util/string-literal-kind-by-token-type-id-map.d.ts.map +1 -0
  292. package/dist/src/ast/build/util/string-literal-kind-by-token-type-id-map.js +150 -0
  293. package/dist/src/ast/build/util/token-kind-by-token-type-id-map.d.ts +3 -0
  294. package/dist/src/ast/build/util/token-kind-by-token-type-id-map.d.ts.map +1 -0
  295. package/dist/src/ast/build/util/token-kind-by-token-type-id-map.js +309 -0
  296. package/dist/src/ast/build-ast.d.ts +13 -0
  297. package/dist/src/ast/build-ast.d.ts.map +1 -0
  298. package/dist/src/ast/build-ast.js +65 -0
  299. package/dist/src/ast/node/abstract-array-definition.d.ts +12 -0
  300. package/dist/src/ast/node/abstract-array-definition.d.ts.map +1 -0
  301. package/dist/src/ast/node/abstract-array-definition.js +10 -0
  302. package/dist/src/ast/node/abstract-array-dimension.d.ts +12 -0
  303. package/dist/src/ast/node/abstract-array-dimension.d.ts.map +1 -0
  304. package/dist/src/ast/node/abstract-array-dimension.js +14 -0
  305. package/dist/src/ast/node/abstract-class-id.d.ts +8 -0
  306. package/dist/src/ast/node/abstract-class-id.d.ts.map +1 -0
  307. package/dist/src/ast/node/abstract-class-id.js +10 -0
  308. package/dist/src/ast/node/abstract-composite-node.d.ts +17 -0
  309. package/dist/src/ast/node/abstract-composite-node.d.ts.map +1 -0
  310. package/dist/src/ast/node/abstract-composite-node.js +47 -0
  311. package/dist/src/ast/node/abstract-elementary-type-definition.d.ts +19 -0
  312. package/dist/src/ast/node/abstract-elementary-type-definition.d.ts.map +1 -0
  313. package/dist/src/ast/node/abstract-elementary-type-definition.js +18 -0
  314. package/dist/src/ast/node/abstract-expression.d.ts +8 -0
  315. package/dist/src/ast/node/abstract-expression.d.ts.map +1 -0
  316. package/dist/src/ast/node/abstract-expression.js +10 -0
  317. package/dist/src/ast/node/abstract-leaf-node.d.ts +6 -0
  318. package/dist/src/ast/node/abstract-leaf-node.d.ts.map +1 -0
  319. package/dist/src/ast/node/abstract-leaf-node.js +6 -0
  320. package/dist/src/ast/node/abstract-node.d.ts +12 -0
  321. package/dist/src/ast/node/abstract-node.d.ts.map +1 -0
  322. package/dist/src/ast/node/abstract-node.js +11 -0
  323. package/dist/src/ast/node/abstract-statement.d.ts +9 -0
  324. package/dist/src/ast/node/abstract-statement.d.ts.map +1 -0
  325. package/dist/src/ast/node/abstract-statement.js +12 -0
  326. package/dist/src/ast/node/aggregate-output-value.d.ts +14 -0
  327. package/dist/src/ast/node/aggregate-output-value.d.ts.map +1 -0
  328. package/dist/src/ast/node/aggregate-output-value.js +15 -0
  329. package/dist/src/ast/node/aligned-modifier.d.ts +13 -0
  330. package/dist/src/ast/node/aligned-modifier.d.ts.map +1 -0
  331. package/dist/src/ast/node/aligned-modifier.js +17 -0
  332. package/dist/src/ast/node/array-definition.d.ts +24 -0
  333. package/dist/src/ast/node/array-definition.d.ts.map +1 -0
  334. package/dist/src/ast/node/array-definition.js +25 -0
  335. package/dist/src/ast/node/array-element-access.d.ts +14 -0
  336. package/dist/src/ast/node/array-element-access.d.ts.map +1 -0
  337. package/dist/src/ast/node/array-element-access.js +13 -0
  338. package/dist/src/ast/node/binary-expression.d.ts +15 -0
  339. package/dist/src/ast/node/binary-expression.d.ts.map +1 -0
  340. package/dist/src/ast/node/binary-expression.js +15 -0
  341. package/dist/src/ast/node/bit-modifier.d.ts +19 -0
  342. package/dist/src/ast/node/bit-modifier.d.ts.map +1 -0
  343. package/dist/src/ast/node/bit-modifier.js +23 -0
  344. package/dist/src/ast/node/case-clause.d.ts +18 -0
  345. package/dist/src/ast/node/case-clause.d.ts.map +1 -0
  346. package/dist/src/ast/node/case-clause.js +23 -0
  347. package/dist/src/ast/node/class-declaration.d.ts +25 -0
  348. package/dist/src/ast/node/class-declaration.d.ts.map +1 -0
  349. package/dist/src/ast/node/class-declaration.js +29 -0
  350. package/dist/src/ast/node/class-definition.d.ts +15 -0
  351. package/dist/src/ast/node/class-definition.d.ts.map +1 -0
  352. package/dist/src/ast/node/class-definition.js +17 -0
  353. package/dist/src/ast/node/class-id-range.d.ts +12 -0
  354. package/dist/src/ast/node/class-id-range.d.ts.map +1 -0
  355. package/dist/src/ast/node/class-id-range.js +13 -0
  356. package/dist/src/ast/node/class-id.d.ts +9 -0
  357. package/dist/src/ast/node/class-id.d.ts.map +1 -0
  358. package/dist/src/ast/node/class-id.js +9 -0
  359. package/dist/src/ast/node/class-member-access.d.ts +11 -0
  360. package/dist/src/ast/node/class-member-access.d.ts.map +1 -0
  361. package/dist/src/ast/node/class-member-access.js +11 -0
  362. package/dist/src/ast/node/compound-statement.d.ts +11 -0
  363. package/dist/src/ast/node/compound-statement.d.ts.map +1 -0
  364. package/dist/src/ast/node/compound-statement.js +13 -0
  365. package/dist/src/ast/node/computed-array-definition.d.ts +14 -0
  366. package/dist/src/ast/node/computed-array-definition.d.ts.map +1 -0
  367. package/dist/src/ast/node/computed-array-definition.js +13 -0
  368. package/dist/src/ast/node/computed-elementary-type-definition.d.ts +13 -0
  369. package/dist/src/ast/node/computed-elementary-type-definition.d.ts.map +1 -0
  370. package/dist/src/ast/node/computed-elementary-type-definition.js +9 -0
  371. package/dist/src/ast/node/default-clause.d.ts +14 -0
  372. package/dist/src/ast/node/default-clause.d.ts.map +1 -0
  373. package/dist/src/ast/node/default-clause.js +17 -0
  374. package/dist/src/ast/node/do-statement.d.ts +19 -0
  375. package/dist/src/ast/node/do-statement.d.ts.map +1 -0
  376. package/dist/src/ast/node/do-statement.js +21 -0
  377. package/dist/src/ast/node/elementary-type-definition.d.ts +21 -0
  378. package/dist/src/ast/node/elementary-type-definition.d.ts.map +1 -0
  379. package/dist/src/ast/node/elementary-type-definition.js +21 -0
  380. package/dist/src/ast/node/elementary-type-output-value.d.ts +11 -0
  381. package/dist/src/ast/node/elementary-type-output-value.d.ts.map +1 -0
  382. package/dist/src/ast/node/elementary-type-output-value.js +11 -0
  383. package/dist/src/ast/node/elementary-type.d.ts +10 -0
  384. package/dist/src/ast/node/elementary-type.d.ts.map +1 -0
  385. package/dist/src/ast/node/elementary-type.js +11 -0
  386. package/dist/src/ast/node/enum/array-dimension-kind.d.ts +12 -0
  387. package/dist/src/ast/node/enum/array-dimension-kind.d.ts.map +1 -0
  388. package/dist/src/ast/node/enum/array-dimension-kind.js +12 -0
  389. package/dist/src/ast/node/enum/binary-operator-kind.d.ts +42 -0
  390. package/dist/src/ast/node/enum/binary-operator-kind.d.ts.map +1 -0
  391. package/dist/src/ast/node/enum/binary-operator-kind.js +42 -0
  392. package/dist/src/ast/node/enum/class-id-kind.d.ts +13 -0
  393. package/dist/src/ast/node/enum/class-id-kind.d.ts.map +1 -0
  394. package/dist/src/ast/node/enum/class-id-kind.js +13 -0
  395. package/dist/src/ast/node/enum/elementary-type-kind.d.ts +14 -0
  396. package/dist/src/ast/node/enum/elementary-type-kind.d.ts.map +1 -0
  397. package/dist/src/ast/node/enum/elementary-type-kind.js +14 -0
  398. package/dist/src/ast/node/enum/expression-kind.d.ts +12 -0
  399. package/dist/src/ast/node/enum/expression-kind.d.ts.map +1 -0
  400. package/dist/src/ast/node/enum/expression-kind.js +12 -0
  401. package/dist/src/ast/node/enum/node-kind.d.ts +58 -0
  402. package/dist/src/ast/node/enum/node-kind.d.ts.map +1 -0
  403. package/dist/src/ast/node/enum/node-kind.js +58 -0
  404. package/dist/src/ast/node/enum/number-literal-kind.d.ts +18 -0
  405. package/dist/src/ast/node/enum/number-literal-kind.d.ts.map +1 -0
  406. package/dist/src/ast/node/enum/number-literal-kind.js +18 -0
  407. package/dist/src/ast/node/enum/statement-kind.d.ts +38 -0
  408. package/dist/src/ast/node/enum/statement-kind.d.ts.map +1 -0
  409. package/dist/src/ast/node/enum/statement-kind.js +38 -0
  410. package/dist/src/ast/node/enum/string-literal-kind.d.ts +14 -0
  411. package/dist/src/ast/node/enum/string-literal-kind.d.ts.map +1 -0
  412. package/dist/src/ast/node/enum/string-literal-kind.js +14 -0
  413. package/dist/src/ast/node/enum/string-variable-kind.d.ts +26 -0
  414. package/dist/src/ast/node/enum/string-variable-kind.d.ts.map +1 -0
  415. package/dist/src/ast/node/enum/string-variable-kind.js +26 -0
  416. package/dist/src/ast/node/enum/token-kind.d.ts +88 -0
  417. package/dist/src/ast/node/enum/token-kind.d.ts.map +1 -0
  418. package/dist/src/ast/node/enum/token-kind.js +88 -0
  419. package/dist/src/ast/node/expandable-modifier.d.ts +13 -0
  420. package/dist/src/ast/node/expandable-modifier.d.ts.map +1 -0
  421. package/dist/src/ast/node/expandable-modifier.js +15 -0
  422. package/dist/src/ast/node/explicit-array-dimension.d.ts +12 -0
  423. package/dist/src/ast/node/explicit-array-dimension.d.ts.map +1 -0
  424. package/dist/src/ast/node/explicit-array-dimension.js +9 -0
  425. package/dist/src/ast/node/expression-statement.d.ts +13 -0
  426. package/dist/src/ast/node/expression-statement.d.ts.map +1 -0
  427. package/dist/src/ast/node/expression-statement.js +11 -0
  428. package/dist/src/ast/node/extended-class-id-range.d.ts +12 -0
  429. package/dist/src/ast/node/extended-class-id-range.d.ts.map +1 -0
  430. package/dist/src/ast/node/extended-class-id-range.js +11 -0
  431. package/dist/src/ast/node/extends-modifier.d.ts +13 -0
  432. package/dist/src/ast/node/extends-modifier.d.ts.map +1 -0
  433. package/dist/src/ast/node/extends-modifier.js +13 -0
  434. package/dist/src/ast/node/for-statement.d.ts +20 -0
  435. package/dist/src/ast/node/for-statement.d.ts.map +1 -0
  436. package/dist/src/ast/node/for-statement.js +31 -0
  437. package/dist/src/ast/node/identifier.d.ts +7 -0
  438. package/dist/src/ast/node/identifier.d.ts.map +1 -0
  439. package/dist/src/ast/node/identifier.js +9 -0
  440. package/dist/src/ast/node/if-statement.d.ts +18 -0
  441. package/dist/src/ast/node/if-statement.d.ts.map +1 -0
  442. package/dist/src/ast/node/if-statement.js +21 -0
  443. package/dist/src/ast/node/implicit-array-dimension.d.ts +14 -0
  444. package/dist/src/ast/node/implicit-array-dimension.d.ts.map +1 -0
  445. package/dist/src/ast/node/implicit-array-dimension.js +13 -0
  446. package/dist/src/ast/node/length-attribute.d.ts +14 -0
  447. package/dist/src/ast/node/length-attribute.d.ts.map +1 -0
  448. package/dist/src/ast/node/length-attribute.js +13 -0
  449. package/dist/src/ast/node/length-of-expression.d.ts +13 -0
  450. package/dist/src/ast/node/length-of-expression.d.ts.map +1 -0
  451. package/dist/src/ast/node/length-of-expression.js +15 -0
  452. package/dist/src/ast/node/map-declaration.d.ts +21 -0
  453. package/dist/src/ast/node/map-declaration.d.ts.map +1 -0
  454. package/dist/src/ast/node/map-declaration.js +27 -0
  455. package/dist/src/ast/node/map-definition.d.ts +19 -0
  456. package/dist/src/ast/node/map-definition.d.ts.map +1 -0
  457. package/dist/src/ast/node/map-definition.js +25 -0
  458. package/dist/src/ast/node/map-entry.d.ts +13 -0
  459. package/dist/src/ast/node/map-entry.d.ts.map +1 -0
  460. package/dist/src/ast/node/map-entry.js +13 -0
  461. package/dist/src/ast/node/missing-error.d.ts +6 -0
  462. package/dist/src/ast/node/missing-error.d.ts.map +1 -0
  463. package/dist/src/ast/node/missing-error.js +7 -0
  464. package/dist/src/ast/node/number-literal.d.ts +11 -0
  465. package/dist/src/ast/node/number-literal.d.ts.map +1 -0
  466. package/dist/src/ast/node/number-literal.js +15 -0
  467. package/dist/src/ast/node/parameter-list.d.ts +13 -0
  468. package/dist/src/ast/node/parameter-list.d.ts.map +1 -0
  469. package/dist/src/ast/node/parameter-list.js +15 -0
  470. package/dist/src/ast/node/parameter-value-list.d.ts +15 -0
  471. package/dist/src/ast/node/parameter-value-list.d.ts.map +1 -0
  472. package/dist/src/ast/node/parameter-value-list.js +15 -0
  473. package/dist/src/ast/node/parameter.d.ts +12 -0
  474. package/dist/src/ast/node/parameter.d.ts.map +1 -0
  475. package/dist/src/ast/node/parameter.js +13 -0
  476. package/dist/src/ast/node/partial-array-dimension.d.ts +14 -0
  477. package/dist/src/ast/node/partial-array-dimension.d.ts.map +1 -0
  478. package/dist/src/ast/node/partial-array-dimension.js +13 -0
  479. package/dist/src/ast/node/specification.d.ts +9 -0
  480. package/dist/src/ast/node/specification.d.ts.map +1 -0
  481. package/dist/src/ast/node/specification.js +7 -0
  482. package/dist/src/ast/node/string-definition.d.ts +20 -0
  483. package/dist/src/ast/node/string-definition.d.ts.map +1 -0
  484. package/dist/src/ast/node/string-definition.js +25 -0
  485. package/dist/src/ast/node/string-literal.d.ts +12 -0
  486. package/dist/src/ast/node/string-literal.d.ts.map +1 -0
  487. package/dist/src/ast/node/string-literal.js +16 -0
  488. package/dist/src/ast/node/switch-statement.d.ts +21 -0
  489. package/dist/src/ast/node/switch-statement.d.ts.map +1 -0
  490. package/dist/src/ast/node/switch-statement.js +23 -0
  491. package/dist/src/ast/node/token.d.ts +11 -0
  492. package/dist/src/ast/node/token.d.ts.map +1 -0
  493. package/dist/src/ast/node/token.js +16 -0
  494. package/dist/src/ast/node/trivia.d.ts +13 -0
  495. package/dist/src/ast/node/trivia.d.ts.map +1 -0
  496. package/dist/src/ast/node/trivia.js +1 -0
  497. package/dist/src/ast/node/unary-expression.d.ts +19 -0
  498. package/dist/src/ast/node/unary-expression.d.ts.map +1 -0
  499. package/dist/src/ast/node/unary-expression.js +21 -0
  500. package/dist/src/ast/node/unexpected-error.d.ts +8 -0
  501. package/dist/src/ast/node/unexpected-error.d.ts.map +1 -0
  502. package/dist/src/ast/node/unexpected-error.js +9 -0
  503. package/dist/src/ast/node/while-statement.d.ts +16 -0
  504. package/dist/src/ast/node/while-statement.d.ts.map +1 -0
  505. package/dist/src/ast/node/while-statement.js +17 -0
  506. package/dist/src/ast/util/types.d.ts +39 -0
  507. package/dist/src/ast/util/types.d.ts.map +1 -0
  508. package/dist/src/ast/util/types.js +58 -0
  509. package/dist/src/ast/visitor/node-handler.d.ts +13 -0
  510. package/dist/src/ast/visitor/node-handler.d.ts.map +1 -0
  511. package/dist/src/ast/visitor/node-handler.js +1 -0
  512. package/dist/src/ast/visitor/node-visitor.d.ts +13 -0
  513. package/dist/src/ast/visitor/node-visitor.d.ts.map +1 -0
  514. package/dist/src/ast/visitor/node-visitor.js +1 -0
  515. package/dist/src/ast/visitor/traversing-visitor.d.ts +17 -0
  516. package/dist/src/ast/visitor/traversing-visitor.d.ts.map +1 -0
  517. package/dist/src/ast/visitor/traversing-visitor.js +51 -0
  518. package/dist/src/completion/completion-rules.d.ts +10 -0
  519. package/dist/src/completion/completion-rules.d.ts.map +1 -0
  520. package/dist/src/completion/completion-rules.js +345 -0
  521. package/dist/src/completion/get-potential-syntactic-tokens.d.ts +10 -0
  522. package/dist/src/completion/get-potential-syntactic-tokens.d.ts.map +1 -0
  523. package/dist/src/completion/get-potential-syntactic-tokens.js +33 -0
  524. package/dist/src/completion/get-potential-token-type-ids.d.ts +10 -0
  525. package/dist/src/completion/get-potential-token-type-ids.d.ts.map +1 -0
  526. package/dist/src/completion/get-potential-token-type-ids.js +74 -0
  527. package/dist/src/completion/hierarchical-map.d.ts +11 -0
  528. package/dist/src/completion/hierarchical-map.d.ts.map +1 -0
  529. package/dist/src/completion/hierarchical-map.js +35 -0
  530. package/dist/src/completion/rules/abstract-types.d.ts +7 -0
  531. package/dist/src/completion/rules/abstract-types.d.ts.map +1 -0
  532. package/dist/src/completion/rules/abstract-types.js +165 -0
  533. package/dist/src/completion/rules/aggregate-output-value-rules.d.ts +8 -0
  534. package/dist/src/completion/rules/aggregate-output-value-rules.d.ts.map +1 -0
  535. package/dist/src/completion/rules/aggregate-output-value-rules.js +29 -0
  536. package/dist/src/completion/rules/aligned-modifier-rules.d.ts +8 -0
  537. package/dist/src/completion/rules/aligned-modifier-rules.d.ts.map +1 -0
  538. package/dist/src/completion/rules/aligned-modifier-rules.js +42 -0
  539. package/dist/src/completion/rules/array-definition-rules.d.ts +14 -0
  540. package/dist/src/completion/rules/array-definition-rules.d.ts.map +1 -0
  541. package/dist/src/completion/rules/array-definition-rules.js +78 -0
  542. package/dist/src/completion/rules/array-element-access-rules.d.ts +8 -0
  543. package/dist/src/completion/rules/array-element-access-rules.d.ts.map +1 -0
  544. package/dist/src/completion/rules/array-element-access-rules.js +17 -0
  545. package/dist/src/completion/rules/assignment-expression-rules.d.ts +8 -0
  546. package/dist/src/completion/rules/assignment-expression-rules.d.ts.map +1 -0
  547. package/dist/src/completion/rules/assignment-expression-rules.js +17 -0
  548. package/dist/src/completion/rules/binary-expression-rules.d.ts +8 -0
  549. package/dist/src/completion/rules/binary-expression-rules.d.ts.map +1 -0
  550. package/dist/src/completion/rules/binary-expression-rules.js +21 -0
  551. package/dist/src/completion/rules/bit-modifier-rules.d.ts +8 -0
  552. package/dist/src/completion/rules/bit-modifier-rules.d.ts.map +1 -0
  553. package/dist/src/completion/rules/bit-modifier-rules.js +24 -0
  554. package/dist/src/completion/rules/case-clause-rules.d.ts +8 -0
  555. package/dist/src/completion/rules/case-clause-rules.d.ts.map +1 -0
  556. package/dist/src/completion/rules/case-clause-rules.js +37 -0
  557. package/dist/src/completion/rules/class-declaration-rules.d.ts +8 -0
  558. package/dist/src/completion/rules/class-declaration-rules.d.ts.map +1 -0
  559. package/dist/src/completion/rules/class-declaration-rules.js +59 -0
  560. package/dist/src/completion/rules/class-definition-rules.d.ts +11 -0
  561. package/dist/src/completion/rules/class-definition-rules.d.ts.map +1 -0
  562. package/dist/src/completion/rules/class-definition-rules.js +24 -0
  563. package/dist/src/completion/rules/class-id-range-rules.d.ts +5 -0
  564. package/dist/src/completion/rules/class-id-range-rules.d.ts.map +1 -0
  565. package/dist/src/completion/rules/class-id-range-rules.js +16 -0
  566. package/dist/src/completion/rules/class-id-rules.d.ts +5 -0
  567. package/dist/src/completion/rules/class-id-rules.d.ts.map +1 -0
  568. package/dist/src/completion/rules/class-id-rules.js +8 -0
  569. package/dist/src/completion/rules/class-member-access-rules.d.ts +5 -0
  570. package/dist/src/completion/rules/class-member-access-rules.d.ts.map +1 -0
  571. package/dist/src/completion/rules/class-member-access-rules.js +6 -0
  572. package/dist/src/completion/rules/compound-statement-rules.d.ts +8 -0
  573. package/dist/src/completion/rules/compound-statement-rules.d.ts.map +1 -0
  574. package/dist/src/completion/rules/compound-statement-rules.js +17 -0
  575. package/dist/src/completion/rules/computed-array-definition-rules.d.ts +8 -0
  576. package/dist/src/completion/rules/computed-array-definition-rules.d.ts.map +1 -0
  577. package/dist/src/completion/rules/computed-array-definition-rules.js +24 -0
  578. package/dist/src/completion/rules/computed-elementary-type-rules.d.ts +14 -0
  579. package/dist/src/completion/rules/computed-elementary-type-rules.d.ts.map +1 -0
  580. package/dist/src/completion/rules/computed-elementary-type-rules.js +35 -0
  581. package/dist/src/completion/rules/default-clause-rules.d.ts +8 -0
  582. package/dist/src/completion/rules/default-clause-rules.d.ts.map +1 -0
  583. package/dist/src/completion/rules/default-clause-rules.js +21 -0
  584. package/dist/src/completion/rules/do-statement-rules.d.ts +8 -0
  585. package/dist/src/completion/rules/do-statement-rules.d.ts.map +1 -0
  586. package/dist/src/completion/rules/do-statement-rules.js +33 -0
  587. package/dist/src/completion/rules/elementary-type-definition-rules.d.ts +11 -0
  588. package/dist/src/completion/rules/elementary-type-definition-rules.d.ts.map +1 -0
  589. package/dist/src/completion/rules/elementary-type-definition-rules.js +52 -0
  590. package/dist/src/completion/rules/elementary-type-output-value-rules.d.ts +5 -0
  591. package/dist/src/completion/rules/elementary-type-output-value-rules.d.ts.map +1 -0
  592. package/dist/src/completion/rules/elementary-type-output-value-rules.js +12 -0
  593. package/dist/src/completion/rules/elementary-type-rules.d.ts +8 -0
  594. package/dist/src/completion/rules/elementary-type-rules.d.ts.map +1 -0
  595. package/dist/src/completion/rules/elementary-type-rules.js +12 -0
  596. package/dist/src/completion/rules/expandable-modifier-rules.d.ts +5 -0
  597. package/dist/src/completion/rules/expandable-modifier-rules.d.ts.map +1 -0
  598. package/dist/src/completion/rules/expandable-modifier-rules.js +20 -0
  599. package/dist/src/completion/rules/explicit-array-dimension-rules.d.ts +8 -0
  600. package/dist/src/completion/rules/explicit-array-dimension-rules.d.ts.map +1 -0
  601. package/dist/src/completion/rules/explicit-array-dimension-rules.js +17 -0
  602. package/dist/src/completion/rules/expression-statement-rules.d.ts +8 -0
  603. package/dist/src/completion/rules/expression-statement-rules.d.ts.map +1 -0
  604. package/dist/src/completion/rules/expression-statement-rules.js +17 -0
  605. package/dist/src/completion/rules/extended-class-id-range-rules.d.ts +8 -0
  606. package/dist/src/completion/rules/extended-class-id-range-rules.d.ts.map +1 -0
  607. package/dist/src/completion/rules/extended-class-id-range-rules.js +16 -0
  608. package/dist/src/completion/rules/extends-modifier-rules.d.ts +5 -0
  609. package/dist/src/completion/rules/extends-modifier-rules.d.ts.map +1 -0
  610. package/dist/src/completion/rules/extends-modifier-rules.js +16 -0
  611. package/dist/src/completion/rules/for-statement-rules.d.ts +11 -0
  612. package/dist/src/completion/rules/for-statement-rules.d.ts.map +1 -0
  613. package/dist/src/completion/rules/for-statement-rules.js +37 -0
  614. package/dist/src/completion/rules/if-statement-rules.d.ts +8 -0
  615. package/dist/src/completion/rules/if-statement-rules.d.ts.map +1 -0
  616. package/dist/src/completion/rules/if-statement-rules.js +33 -0
  617. package/dist/src/completion/rules/implicit-array-dimension-rules.d.ts +11 -0
  618. package/dist/src/completion/rules/implicit-array-dimension-rules.d.ts.map +1 -0
  619. package/dist/src/completion/rules/implicit-array-dimension-rules.js +20 -0
  620. package/dist/src/completion/rules/length-attribute-rules.d.ts +8 -0
  621. package/dist/src/completion/rules/length-attribute-rules.d.ts.map +1 -0
  622. package/dist/src/completion/rules/length-attribute-rules.js +14 -0
  623. package/dist/src/completion/rules/lengthof-expression-rules.d.ts +8 -0
  624. package/dist/src/completion/rules/lengthof-expression-rules.d.ts.map +1 -0
  625. package/dist/src/completion/rules/lengthof-expression-rules.js +21 -0
  626. package/dist/src/completion/rules/map-declaration-rules.d.ts +11 -0
  627. package/dist/src/completion/rules/map-declaration-rules.d.ts.map +1 -0
  628. package/dist/src/completion/rules/map-declaration-rules.js +44 -0
  629. package/dist/src/completion/rules/map-definition-rules.d.ts +11 -0
  630. package/dist/src/completion/rules/map-definition-rules.d.ts.map +1 -0
  631. package/dist/src/completion/rules/map-definition-rules.js +45 -0
  632. package/dist/src/completion/rules/map-entry-rules.d.ts +5 -0
  633. package/dist/src/completion/rules/map-entry-rules.d.ts.map +1 -0
  634. package/dist/src/completion/rules/map-entry-rules.js +16 -0
  635. package/dist/src/completion/rules/parameter-list-rules.d.ts +8 -0
  636. package/dist/src/completion/rules/parameter-list-rules.d.ts.map +1 -0
  637. package/dist/src/completion/rules/parameter-list-rules.js +20 -0
  638. package/dist/src/completion/rules/parameter-rules.d.ts +11 -0
  639. package/dist/src/completion/rules/parameter-rules.d.ts.map +1 -0
  640. package/dist/src/completion/rules/parameter-rules.js +16 -0
  641. package/dist/src/completion/rules/parameter-value-list-rules.d.ts +8 -0
  642. package/dist/src/completion/rules/parameter-value-list-rules.d.ts.map +1 -0
  643. package/dist/src/completion/rules/parameter-value-list-rules.js +21 -0
  644. package/dist/src/completion/rules/partial-array-dimension-rules.d.ts +14 -0
  645. package/dist/src/completion/rules/partial-array-dimension-rules.d.ts.map +1 -0
  646. package/dist/src/completion/rules/partial-array-dimension-rules.js +25 -0
  647. package/dist/src/completion/rules/specification-rules.d.ts +5 -0
  648. package/dist/src/completion/rules/specification-rules.d.ts.map +1 -0
  649. package/dist/src/completion/rules/specification-rules.js +36 -0
  650. package/dist/src/completion/rules/string-definition-rules.d.ts +11 -0
  651. package/dist/src/completion/rules/string-definition-rules.d.ts.map +1 -0
  652. package/dist/src/completion/rules/string-definition-rules.js +74 -0
  653. package/dist/src/completion/rules/switch-statement-rules.d.ts +8 -0
  654. package/dist/src/completion/rules/switch-statement-rules.d.ts.map +1 -0
  655. package/dist/src/completion/rules/switch-statement-rules.js +37 -0
  656. package/dist/src/completion/rules/unary-expression-rules.d.ts +5 -0
  657. package/dist/src/completion/rules/unary-expression-rules.d.ts.map +1 -0
  658. package/dist/src/completion/rules/unary-expression-rules.js +33 -0
  659. package/dist/src/completion/rules/utf-string-literal-rules.d.ts +5 -0
  660. package/dist/src/completion/rules/utf-string-literal-rules.d.ts.map +1 -0
  661. package/dist/src/completion/rules/utf-string-literal-rules.js +16 -0
  662. package/dist/src/completion/rules/while-statement-rules.d.ts +8 -0
  663. package/dist/src/completion/rules/while-statement-rules.d.ts.map +1 -0
  664. package/dist/src/completion/rules/while-statement-rules.js +29 -0
  665. package/dist/src/lezer/context-tracker.d.ts +4 -0
  666. package/dist/src/lezer/context-tracker.d.ts.map +1 -0
  667. package/dist/src/lezer/context-tracker.js +35 -0
  668. package/dist/src/lezer/create-sdl-parser.d.ts +10 -0
  669. package/dist/src/lezer/create-sdl-parser.d.ts.map +1 -0
  670. package/dist/src/lezer/create-sdl-parser.js +76 -0
  671. package/dist/src/lezer/create-syntax-error-from-text-and-cursor.d.ts +12 -0
  672. package/dist/src/lezer/create-syntax-error-from-text-and-cursor.d.ts.map +1 -0
  673. package/dist/src/lezer/create-syntax-error-from-text-and-cursor.js +68 -0
  674. package/dist/src/lezer/create-syntax-error-from-text-and-position.d.ts +11 -0
  675. package/dist/src/lezer/create-syntax-error-from-text-and-position.d.ts.map +1 -0
  676. package/dist/src/lezer/create-syntax-error-from-text-and-position.js +24 -0
  677. package/dist/src/lezer/parser.d.ts +3 -0
  678. package/dist/src/lezer/parser.d.ts.map +1 -0
  679. package/dist/src/lezer/parser.js +60 -0
  680. package/dist/src/lezer/parser.terms.d.ts +2 -0
  681. package/dist/src/lezer/parser.terms.d.ts.map +1 -0
  682. package/dist/src/lezer/parser.terms.js +2 -0
  683. package/dist/src/lezer/props/fold-node-prop-source.d.ts +2 -0
  684. package/dist/src/lezer/props/fold-node-prop-source.d.ts.map +1 -0
  685. package/dist/src/lezer/props/fold-node-prop-source.js +24 -0
  686. package/dist/src/lezer/props/primitive-node-prop-source.d.ts +4 -0
  687. package/dist/src/lezer/props/primitive-node-prop-source.d.ts.map +1 -0
  688. package/dist/src/lezer/props/primitive-node-prop-source.js +13 -0
  689. package/dist/src/lezer/props/style-tags-node-prop-source.d.ts +2 -0
  690. package/dist/src/lezer/props/style-tags-node-prop-source.d.ts.map +1 -0
  691. package/dist/src/lezer/props/style-tags-node-prop-source.js +181 -0
  692. package/dist/src/lezer/props/syntactic-token-node-prop-source.d.ts +5 -0
  693. package/dist/src/lezer/props/syntactic-token-node-prop-source.d.ts.map +1 -0
  694. package/dist/src/lezer/props/syntactic-token-node-prop-source.js +290 -0
  695. package/dist/src/lezer/sdl-string-input.d.ts +33 -0
  696. package/dist/src/lezer/sdl-string-input.d.ts.map +1 -0
  697. package/dist/src/lezer/sdl-string-input.js +39 -0
  698. package/dist/src/location.d.ts +14 -0
  699. package/dist/src/location.d.ts.map +1 -0
  700. package/dist/src/location.js +1 -0
  701. package/dist/src/parse-helper.d.ts +28 -0
  702. package/dist/src/parse-helper.d.ts.map +1 -0
  703. package/dist/src/parse-helper.js +67 -0
  704. package/dist/src/prettier/prettier-plugin-sdl.d.ts +3 -0
  705. package/dist/src/prettier/prettier-plugin-sdl.d.ts.map +1 -0
  706. package/dist/src/prettier/prettier-plugin-sdl.js +70 -0
  707. package/dist/src/prettier/print-abstract-array-dimension.d.ts +5 -0
  708. package/dist/src/prettier/print-abstract-array-dimension.d.ts.map +1 -0
  709. package/dist/src/prettier/print-abstract-array-dimension.js +41 -0
  710. package/dist/src/prettier/print-abstract-class-id.d.ts +5 -0
  711. package/dist/src/prettier/print-abstract-class-id.d.ts.map +1 -0
  712. package/dist/src/prettier/print-abstract-class-id.js +27 -0
  713. package/dist/src/prettier/print-abstract-expression.d.ts +5 -0
  714. package/dist/src/prettier/print-abstract-expression.d.ts.map +1 -0
  715. package/dist/src/prettier/print-abstract-expression.js +74 -0
  716. package/dist/src/prettier/print-abstract-node.d.ts +5 -0
  717. package/dist/src/prettier/print-abstract-node.d.ts.map +1 -0
  718. package/dist/src/prettier/print-abstract-node.js +144 -0
  719. package/dist/src/prettier/print-abstract-statement.d.ts +5 -0
  720. package/dist/src/prettier/print-abstract-statement.d.ts.map +1 -0
  721. package/dist/src/prettier/print-abstract-statement.js +70 -0
  722. package/dist/src/prettier/print-aggregate-output-value.d.ts +5 -0
  723. package/dist/src/prettier/print-aggregate-output-value.d.ts.map +1 -0
  724. package/dist/src/prettier/print-aggregate-output-value.js +11 -0
  725. package/dist/src/prettier/print-aligned-modifier.d.ts +5 -0
  726. package/dist/src/prettier/print-aligned-modifier.d.ts.map +1 -0
  727. package/dist/src/prettier/print-aligned-modifier.js +16 -0
  728. package/dist/src/prettier/print-array-definition.d.ts +5 -0
  729. package/dist/src/prettier/print-array-definition.d.ts.map +1 -0
  730. package/dist/src/prettier/print-array-definition.js +40 -0
  731. package/dist/src/prettier/print-array-element-access.d.ts +5 -0
  732. package/dist/src/prettier/print-array-element-access.d.ts.map +1 -0
  733. package/dist/src/prettier/print-array-element-access.js +7 -0
  734. package/dist/src/prettier/print-bit-modifier.d.ts +5 -0
  735. package/dist/src/prettier/print-bit-modifier.d.ts.map +1 -0
  736. package/dist/src/prettier/print-bit-modifier.js +22 -0
  737. package/dist/src/prettier/print-case-clause.d.ts +5 -0
  738. package/dist/src/prettier/print-case-clause.d.ts.map +1 -0
  739. package/dist/src/prettier/print-case-clause.js +28 -0
  740. package/dist/src/prettier/print-class-declaration.d.ts +5 -0
  741. package/dist/src/prettier/print-class-declaration.d.ts.map +1 -0
  742. package/dist/src/prettier/print-class-declaration.js +39 -0
  743. package/dist/src/prettier/print-class-definition.d.ts +5 -0
  744. package/dist/src/prettier/print-class-definition.d.ts.map +1 -0
  745. package/dist/src/prettier/print-class-definition.js +20 -0
  746. package/dist/src/prettier/print-class-member-access.d.ts +5 -0
  747. package/dist/src/prettier/print-class-member-access.d.ts.map +1 -0
  748. package/dist/src/prettier/print-class-member-access.js +3 -0
  749. package/dist/src/prettier/print-computed-array-definition.d.ts +5 -0
  750. package/dist/src/prettier/print-computed-array-definition.d.ts.map +1 -0
  751. package/dist/src/prettier/print-computed-array-definition.js +15 -0
  752. package/dist/src/prettier/print-computed-elementary-type-definition.d.ts +5 -0
  753. package/dist/src/prettier/print-computed-elementary-type-definition.d.ts.map +1 -0
  754. package/dist/src/prettier/print-computed-elementary-type-definition.js +24 -0
  755. package/dist/src/prettier/print-default-clause.d.ts +5 -0
  756. package/dist/src/prettier/print-default-clause.d.ts.map +1 -0
  757. package/dist/src/prettier/print-default-clause.js +15 -0
  758. package/dist/src/prettier/print-do-statement.d.ts +5 -0
  759. package/dist/src/prettier/print-do-statement.d.ts.map +1 -0
  760. package/dist/src/prettier/print-do-statement.js +19 -0
  761. package/dist/src/prettier/print-elementary-type-definition.d.ts +5 -0
  762. package/dist/src/prettier/print-elementary-type-definition.d.ts.map +1 -0
  763. package/dist/src/prettier/print-elementary-type-definition.js +42 -0
  764. package/dist/src/prettier/print-elementary-type-output-value.d.ts +5 -0
  765. package/dist/src/prettier/print-elementary-type-output-value.d.ts.map +1 -0
  766. package/dist/src/prettier/print-elementary-type-output-value.js +3 -0
  767. package/dist/src/prettier/print-elementary-type.d.ts +5 -0
  768. package/dist/src/prettier/print-elementary-type.d.ts.map +1 -0
  769. package/dist/src/prettier/print-elementary-type.js +12 -0
  770. package/dist/src/prettier/print-expandable-modifier.d.ts +5 -0
  771. package/dist/src/prettier/print-expandable-modifier.d.ts.map +1 -0
  772. package/dist/src/prettier/print-expandable-modifier.js +13 -0
  773. package/dist/src/prettier/print-extends-modifier.d.ts +5 -0
  774. package/dist/src/prettier/print-extends-modifier.d.ts.map +1 -0
  775. package/dist/src/prettier/print-extends-modifier.js +12 -0
  776. package/dist/src/prettier/print-for-statement.d.ts +5 -0
  777. package/dist/src/prettier/print-for-statement.d.ts.map +1 -0
  778. package/dist/src/prettier/print-for-statement.js +33 -0
  779. package/dist/src/prettier/print-identifier.d.ts +5 -0
  780. package/dist/src/prettier/print-identifier.d.ts.map +1 -0
  781. package/dist/src/prettier/print-identifier.js +3 -0
  782. package/dist/src/prettier/print-if-statement.d.ts +5 -0
  783. package/dist/src/prettier/print-if-statement.d.ts.map +1 -0
  784. package/dist/src/prettier/print-if-statement.js +44 -0
  785. package/dist/src/prettier/print-length-attribute.d.ts +5 -0
  786. package/dist/src/prettier/print-length-attribute.d.ts.map +1 -0
  787. package/dist/src/prettier/print-length-attribute.js +7 -0
  788. package/dist/src/prettier/print-map-declaration.d.ts +5 -0
  789. package/dist/src/prettier/print-map-declaration.d.ts.map +1 -0
  790. package/dist/src/prettier/print-map-declaration.js +31 -0
  791. package/dist/src/prettier/print-map-definition.d.ts +5 -0
  792. package/dist/src/prettier/print-map-definition.d.ts.map +1 -0
  793. package/dist/src/prettier/print-map-definition.js +28 -0
  794. package/dist/src/prettier/print-map-entry.d.ts +5 -0
  795. package/dist/src/prettier/print-map-entry.d.ts.map +1 -0
  796. package/dist/src/prettier/print-map-entry.js +9 -0
  797. package/dist/src/prettier/print-number-literal.d.ts +5 -0
  798. package/dist/src/prettier/print-number-literal.d.ts.map +1 -0
  799. package/dist/src/prettier/print-number-literal.js +62 -0
  800. package/dist/src/prettier/print-parameter-list.d.ts +5 -0
  801. package/dist/src/prettier/print-parameter-list.d.ts.map +1 -0
  802. package/dist/src/prettier/print-parameter-list.js +9 -0
  803. package/dist/src/prettier/print-parameter-value-list.d.ts +5 -0
  804. package/dist/src/prettier/print-parameter-value-list.d.ts.map +1 -0
  805. package/dist/src/prettier/print-parameter-value-list.js +9 -0
  806. package/dist/src/prettier/print-parameter.d.ts +5 -0
  807. package/dist/src/prettier/print-parameter.d.ts.map +1 -0
  808. package/dist/src/prettier/print-parameter.js +15 -0
  809. package/dist/src/prettier/print-specification.d.ts +5 -0
  810. package/dist/src/prettier/print-specification.d.ts.map +1 -0
  811. package/dist/src/prettier/print-specification.js +30 -0
  812. package/dist/src/prettier/print-string-definition.d.ts +5 -0
  813. package/dist/src/prettier/print-string-definition.d.ts.map +1 -0
  814. package/dist/src/prettier/print-string-definition.js +57 -0
  815. package/dist/src/prettier/print-string-literal.d.ts +5 -0
  816. package/dist/src/prettier/print-string-literal.d.ts.map +1 -0
  817. package/dist/src/prettier/print-string-literal.js +50 -0
  818. package/dist/src/prettier/print-switch-statement.d.ts +5 -0
  819. package/dist/src/prettier/print-switch-statement.d.ts.map +1 -0
  820. package/dist/src/prettier/print-switch-statement.js +20 -0
  821. package/dist/src/prettier/print-token.d.ts +4 -0
  822. package/dist/src/prettier/print-token.d.ts.map +1 -0
  823. package/dist/src/prettier/print-token.js +4 -0
  824. package/dist/src/prettier/print-unexpected-error.d.ts +5 -0
  825. package/dist/src/prettier/print-unexpected-error.d.ts.map +1 -0
  826. package/dist/src/prettier/print-unexpected-error.js +3 -0
  827. package/dist/src/prettier/print-while-statement.d.ts +5 -0
  828. package/dist/src/prettier/print-while-statement.d.ts.map +1 -0
  829. package/dist/src/prettier/print-while-statement.js +15 -0
  830. package/dist/src/prettier/util/print-utils.d.ts +56 -0
  831. package/dist/src/prettier/util/print-utils.d.ts.map +1 -0
  832. package/dist/src/prettier/util/print-utils.js +456 -0
  833. package/dist/src/prettier/util/types.d.ts +13 -0
  834. package/dist/src/prettier/util/types.d.ts.map +1 -0
  835. package/dist/src/prettier/util/types.js +20 -0
  836. package/dist/src/scanner-error.d.ts +36 -0
  837. package/dist/src/scanner-error.d.ts.map +1 -0
  838. package/dist/src/scanner-error.js +51 -0
  839. package/dist/src/util/location-utils.d.ts +4 -0
  840. package/dist/src/util/location-utils.d.ts.map +1 -0
  841. package/dist/src/util/location-utils.js +11 -0
  842. package/dist/src/util/logger.d.ts +22 -0
  843. package/dist/src/util/logger.d.ts.map +1 -0
  844. package/dist/src/util/logger.js +94 -0
  845. package/package.json +34 -30
  846. package/src/analyser/checks/check-array-definition.ts +5 -15
  847. package/src/analyser/checks/check-array-element-access.ts +1 -5
  848. package/src/analyser/checks/check-class-declaration.ts +26 -83
  849. package/src/analyser/checks/check-computed-array-definition.ts +3 -12
  850. package/src/analyser/checks/check-computed-elementary-type-definition.ts +2 -7
  851. package/src/analyser/checks/check-elementary-type-definition.ts +41 -48
  852. package/src/analyser/checks/check-expression-binary.ts +66 -60
  853. package/src/analyser/checks/check-expression-lengthof.ts +2 -7
  854. package/src/analyser/checks/check-expression-unary.ts +9 -19
  855. package/src/analyser/checks/check-identifier.ts +2 -7
  856. package/src/analyser/checks/check-if-statement.ts +4 -15
  857. package/src/analyser/checks/check-map-declaration.ts +15 -17
  858. package/src/analyser/checks/check-map-definition.ts +9 -22
  859. package/src/analyser/checks/check-number-literal-float.ts +2 -7
  860. package/src/analyser/checks/check-parameter-list.ts +3 -12
  861. package/src/analyser/checks/check-specification.ts +4 -13
  862. package/src/analyser/checks/check-switch-statement.ts +11 -27
  863. package/src/analyser/checks/check.ts +1 -5
  864. package/src/analyser/create-sdl-analyser.ts +2 -6
  865. package/src/analyser/node-handler/abstract-analysis-node-handler.ts +76 -154
  866. package/src/analyser/node-handler/build-symbol-table-node-handler.ts +39 -112
  867. package/src/analyser/node-handler/specific-check-node-handler.ts +14 -24
  868. package/src/analyser/node-handler/validate-scope-node-handler.ts +26 -55
  869. package/src/analyser/node-handler/validate-type-node-handler.ts +45 -108
  870. package/src/analyser/sdl-analyser.ts +5 -16
  871. package/src/analyser/symbol-table.ts +14 -25
  872. package/src/analyser/util/symbol-table-utils.ts +28 -80
  873. package/src/analyser/util/type-utils.ts +38 -78
  874. package/src/ast/build/consume/consume-abstract-node.ts +10 -13
  875. package/src/ast/build/consume/consume-ast-node.ts +16 -44
  876. package/src/ast/build/consume/consume-primitive.ts +4 -6
  877. package/src/ast/build/consume/consume-trivia.ts +5 -15
  878. package/src/ast/build/consume/consume-white-space-and-missing-errors.ts +3 -6
  879. package/src/ast/build/node/build-aggregate-output-value.ts +9 -15
  880. package/src/ast/build/node/build-aligned-modifier.ts +9 -19
  881. package/src/ast/build/node/build-array-definition.ts +10 -38
  882. package/src/ast/build/node/build-array-element-access.ts +7 -15
  883. package/src/ast/build/node/build-base64-string-literal.ts +9 -19
  884. package/src/ast/build/node/build-binary-expression.ts +32 -38
  885. package/src/ast/build/node/build-binary-literal.ts +3 -12
  886. package/src/ast/build/node/build-bit-modifier.ts +6 -25
  887. package/src/ast/build/node/build-case-clause.ts +8 -34
  888. package/src/ast/build/node/build-class-declaration.ts +7 -29
  889. package/src/ast/build/node/build-class-definition.ts +4 -16
  890. package/src/ast/build/node/build-class-id-range.ts +5 -14
  891. package/src/ast/build/node/build-class-id.ts +3 -11
  892. package/src/ast/build/node/build-class-member-access.ts +4 -10
  893. package/src/ast/build/node/build-compound-statement.ts +5 -11
  894. package/src/ast/build/node/build-computed-array-definition.ts +4 -18
  895. package/src/ast/build/node/build-computed-elementary-type-definition.ts +9 -25
  896. package/src/ast/build/node/build-decimal-literal.ts +2 -8
  897. package/src/ast/build/node/build-default-clause.ts +5 -22
  898. package/src/ast/build/node/build-do-statement.ts +4 -16
  899. package/src/ast/build/node/build-elementary-type-definition.ts +16 -32
  900. package/src/ast/build/node/build-elementary-type-output-value.ts +3 -7
  901. package/src/ast/build/node/build-elementary-type.ts +7 -13
  902. package/src/ast/build/node/build-expandable-modifier.ts +2 -7
  903. package/src/ast/build/node/build-explicit-array-dimension.ts +9 -13
  904. package/src/ast/build/node/build-expression-statement.ts +4 -9
  905. package/src/ast/build/node/build-extended-class-id-range.ts +5 -14
  906. package/src/ast/build/node/build-extends-modifier.ts +4 -18
  907. package/src/ast/build/node/build-floating-point-literal.ts +2 -8
  908. package/src/ast/build/node/build-for-statement.ts +9 -33
  909. package/src/ast/build/node/build-hexadecimal-literal.ts +3 -12
  910. package/src/ast/build/node/build-identifier.ts +1 -3
  911. package/src/ast/build/node/build-if-statement.ts +6 -24
  912. package/src/ast/build/node/build-implicit-array-dimension.ts +8 -15
  913. package/src/ast/build/node/build-integer-literal.ts +2 -8
  914. package/src/ast/build/node/build-length-attribute.ts +6 -9
  915. package/src/ast/build/node/build-lengthof-expression.ts +6 -13
  916. package/src/ast/build/node/build-map-declaration.ts +8 -21
  917. package/src/ast/build/node/build-map-definition.ts +6 -24
  918. package/src/ast/build/node/build-map-entry.ts +5 -15
  919. package/src/ast/build/node/build-multiple-character-literal.ts +18 -23
  920. package/src/ast/build/node/build-parameter-list.ts +6 -11
  921. package/src/ast/build/node/build-parameter-value-list.ts +6 -14
  922. package/src/ast/build/node/build-parameter.ts +5 -21
  923. package/src/ast/build/node/build-partial-array-dimension.ts +6 -9
  924. package/src/ast/build/node/build-specification.ts +2 -6
  925. package/src/ast/build/node/build-string-definition.ts +11 -31
  926. package/src/ast/build/node/build-switch-statement.ts +6 -24
  927. package/src/ast/build/node/build-token.ts +3 -5
  928. package/src/ast/build/node/build-unary-expression.ts +13 -19
  929. package/src/ast/build/node/build-unexpected-error.ts +2 -6
  930. package/src/ast/build/node/build-utf-string-literal.ts +43 -66
  931. package/src/ast/build/node/build-while-statement.ts +5 -22
  932. package/src/ast/build/util/array-dimension-kind-by-token-type-id-map.ts +5 -17
  933. package/src/ast/build/util/binary-operator-kind-by-token-type-id-map.ts +2 -5
  934. package/src/ast/build/util/class-id-kind-by-token-type-id-map.ts +2 -7
  935. package/src/ast/build/util/expression-kind-by-token-type-id-map.ts +5 -17
  936. package/src/ast/build/util/fetch-node.ts +73 -108
  937. package/src/ast/build/util/node-kind-by-token-type-id-map.ts +2 -7
  938. package/src/ast/build/util/statement-kind-by-token-type-id-map.ts +9 -35
  939. package/src/ast/build/util/string-literal-kind-by-token-type-id-map.ts +4 -13
  940. package/src/ast/build/util/token-kind-by-token-type-id-map.ts +8 -31
  941. package/src/ast/build-ast.ts +9 -24
  942. package/src/ast/node/abstract-array-dimension.ts +1 -4
  943. package/src/ast/node/abstract-composite-node.ts +2 -4
  944. package/src/ast/node/abstract-elementary-type-definition.ts +2 -7
  945. package/src/ast/node/abstract-leaf-node.ts +1 -3
  946. package/src/ast/node/abstract-node.ts +1 -2
  947. package/src/ast/node/aggregate-output-value.ts +2 -9
  948. package/src/ast/node/aligned-modifier.ts +1 -4
  949. package/src/ast/node/array-definition.ts +4 -18
  950. package/src/ast/node/array-element-access.ts +2 -7
  951. package/src/ast/node/binary-expression.ts +2 -10
  952. package/src/ast/node/case-clause.ts +2 -9
  953. package/src/ast/node/class-declaration.ts +3 -12
  954. package/src/ast/node/class-definition.ts +1 -4
  955. package/src/ast/node/class-member-access.ts +1 -4
  956. package/src/ast/node/compound-statement.ts +1 -4
  957. package/src/ast/node/computed-array-definition.ts +1 -6
  958. package/src/ast/node/computed-elementary-type-definition.ts +1 -2
  959. package/src/ast/node/default-clause.ts +2 -9
  960. package/src/ast/node/do-statement.ts +1 -5
  961. package/src/ast/node/elementary-type-definition.ts +2 -10
  962. package/src/ast/node/elementary-type-output-value.ts +1 -4
  963. package/src/ast/node/elementary-type.ts +1 -4
  964. package/src/ast/node/expandable-modifier.ts +1 -4
  965. package/src/ast/node/explicit-array-dimension.ts +2 -9
  966. package/src/ast/node/expression-statement.ts +2 -7
  967. package/src/ast/node/extended-class-id-range.ts +1 -4
  968. package/src/ast/node/extends-modifier.ts +1 -4
  969. package/src/ast/node/for-statement.ts +1 -3
  970. package/src/ast/node/if-statement.ts +2 -7
  971. package/src/ast/node/implicit-array-dimension.ts +3 -16
  972. package/src/ast/node/length-attribute.ts +2 -7
  973. package/src/ast/node/length-of-expression.ts +1 -4
  974. package/src/ast/node/map-declaration.ts +2 -10
  975. package/src/ast/node/map-definition.ts +1 -4
  976. package/src/ast/node/number-literal.ts +0 -2
  977. package/src/ast/node/parameter-list.ts +2 -9
  978. package/src/ast/node/parameter-value-list.ts +3 -12
  979. package/src/ast/node/parameter.ts +1 -4
  980. package/src/ast/node/partial-array-dimension.ts +2 -9
  981. package/src/ast/node/specification.ts +2 -9
  982. package/src/ast/node/string-definition.ts +1 -4
  983. package/src/ast/node/string-literal.ts +1 -4
  984. package/src/ast/node/switch-statement.ts +2 -8
  985. package/src/ast/node/token.ts +1 -3
  986. package/src/ast/node/unary-expression.ts +2 -9
  987. package/src/ast/node/unexpected-error.ts +1 -3
  988. package/src/ast/node/while-statement.ts +2 -7
  989. package/src/ast/util/types.ts +31 -59
  990. package/src/ast/visitor/traversing-visitor.ts +7 -14
  991. package/src/completion/completion-rules.ts +25 -93
  992. package/src/completion/get-potential-syntactic-tokens.ts +7 -18
  993. package/src/completion/get-potential-token-type-ids.ts +11 -22
  994. package/src/completion/rules/abstract-types.ts +1 -3
  995. package/src/completion/rules/aggregate-output-value-rules.ts +5 -22
  996. package/src/completion/rules/aligned-modifier-rules.ts +1 -3
  997. package/src/completion/rules/array-definition-rules.ts +2 -10
  998. package/src/completion/rules/array-element-access-rules.ts +1 -4
  999. package/src/completion/rules/class-declaration-rules.ts +6 -26
  1000. package/src/completion/rules/class-definition-rules.ts +1 -4
  1001. package/src/completion/rules/compound-statement-rules.ts +2 -8
  1002. package/src/completion/rules/computed-elementary-type-rules.ts +2 -9
  1003. package/src/completion/rules/do-statement-rules.ts +1 -4
  1004. package/src/completion/rules/elementary-type-definition-rules.ts +2 -10
  1005. package/src/completion/rules/elementary-type-rules.ts +1 -6
  1006. package/src/completion/rules/explicit-array-dimension-rules.ts +1 -4
  1007. package/src/completion/rules/expression-statement-rules.ts +1 -4
  1008. package/src/completion/rules/for-statement-rules.ts +5 -17
  1009. package/src/completion/rules/if-statement-rules.ts +2 -9
  1010. package/src/completion/rules/length-attribute-rules.ts +1 -4
  1011. package/src/completion/rules/parameter-value-list-rules.ts +1 -5
  1012. package/src/completion/rules/partial-array-dimension-rules.ts +2 -8
  1013. package/src/completion/rules/string-definition-rules.ts +8 -36
  1014. package/src/completion/rules/switch-statement-rules.ts +3 -14
  1015. package/src/completion/rules/while-statement-rules.ts +2 -9
  1016. package/src/lezer/create-sdl-parser.ts +1 -3
  1017. package/src/lezer/create-syntax-error-from-text-and-cursor.ts +15 -39
  1018. package/src/lezer/create-syntax-error-from-text-and-position.ts +1 -6
  1019. package/src/lezer/parser.ts +8 -7
  1020. package/src/lezer/props/primitive-node-prop-source.ts +2 -2
  1021. package/src/lezer/props/style-tags-node-prop-source.ts +2 -5
  1022. package/src/lezer/props/syntactic-token-node-prop-source.ts +3 -5
  1023. package/src/parse-helper.ts +3 -10
  1024. package/src/prettier/prettier-plugin-sdl.ts +7 -18
  1025. package/src/prettier/print-abstract-array-dimension.ts +7 -30
  1026. package/src/prettier/print-abstract-class-id.ts +3 -11
  1027. package/src/prettier/print-abstract-expression.ts +17 -49
  1028. package/src/prettier/print-abstract-node.ts +16 -45
  1029. package/src/prettier/print-abstract-statement.ts +4 -16
  1030. package/src/prettier/print-aggregate-output-value.ts +3 -13
  1031. package/src/prettier/print-aligned-modifier.ts +3 -12
  1032. package/src/prettier/print-array-definition.ts +9 -45
  1033. package/src/prettier/print-bit-modifier.ts +3 -16
  1034. package/src/prettier/print-case-clause.ts +10 -23
  1035. package/src/prettier/print-class-declaration.ts +13 -35
  1036. package/src/prettier/print-class-definition.ts +3 -13
  1037. package/src/prettier/print-class-member-access.ts +1 -4
  1038. package/src/prettier/print-computed-array-definition.ts +1 -4
  1039. package/src/prettier/print-computed-elementary-type-definition.ts +4 -19
  1040. package/src/prettier/print-default-clause.ts +3 -12
  1041. package/src/prettier/print-do-statement.ts +1 -4
  1042. package/src/prettier/print-elementary-type-definition.ts +10 -46
  1043. package/src/prettier/print-elementary-type-output-value.ts +1 -4
  1044. package/src/prettier/print-elementary-type.ts +1 -3
  1045. package/src/prettier/print-expandable-modifier.ts +12 -23
  1046. package/src/prettier/print-extends-modifier.ts +1 -6
  1047. package/src/prettier/print-for-statement.ts +6 -20
  1048. package/src/prettier/print-if-statement.ts +8 -19
  1049. package/src/prettier/print-map-declaration.ts +5 -20
  1050. package/src/prettier/print-map-definition.ts +6 -29
  1051. package/src/prettier/print-map-entry.ts +1 -4
  1052. package/src/prettier/print-number-literal.ts +2 -7
  1053. package/src/prettier/print-parameter.ts +2 -12
  1054. package/src/prettier/print-specification.ts +4 -4
  1055. package/src/prettier/print-string-definition.ts +9 -43
  1056. package/src/prettier/print-string-literal.ts +1 -1
  1057. package/src/prettier/print-switch-statement.ts +3 -11
  1058. package/src/prettier/util/print-utils.ts +23 -61
  1059. package/src/prettier/util/types.ts +12 -19
  1060. package/src/scanner-error.ts +2 -8
  1061. package/src/util/location-utils.ts +1 -4
  1062. package/src/util/logger.ts +13 -43
  1063. package/bun.lock +0 -65
  1064. package/tests/analyser/create-sdl-analyser.test.ts +0 -54
  1065. package/tests/analyser/get-sdl-analyser-test-scenarios.ts +0 -80
  1066. package/tests/analyser/sdl-analyser-scenarios.test.ts +0 -67
  1067. package/tests/analyser/semantic-error-scenarios.test.ts +0 -40
  1068. package/tests/analyser/symbol-table.test.ts +0 -188
  1069. package/tests/analyser/test-cases/array_definition.txt +0 -50
  1070. package/tests/analyser/test-cases/class_declaration.txt +0 -112
  1071. package/tests/analyser/test-cases/class_definition.txt +0 -60
  1072. package/tests/analyser/test-cases/compound_statement.txt +0 -63
  1073. package/tests/analyser/test-cases/computed_array_definition.txt +0 -12
  1074. package/tests/analyser/test-cases/computed_elementary_type_definition.txt +0 -39
  1075. package/tests/analyser/test-cases/do_statement.txt +0 -16
  1076. package/tests/analyser/test-cases/elementary_type_definition.txt +0 -58
  1077. package/tests/analyser/test-cases/expression.txt +0 -159
  1078. package/tests/analyser/test-cases/for_statement.txt +0 -55
  1079. package/tests/analyser/test-cases/if_statement.txt +0 -57
  1080. package/tests/analyser/test-cases/map_declaration.txt +0 -89
  1081. package/tests/analyser/test-cases/map_definition.txt +0 -35
  1082. package/tests/analyser/test-cases/number_literal.txt +0 -31
  1083. package/tests/analyser/test-cases/parameter_list.txt +0 -16
  1084. package/tests/analyser/test-cases/scopes.txt +0 -239
  1085. package/tests/analyser/test-cases/specification.txt +0 -28
  1086. package/tests/analyser/test-cases/string_definition.txt +0 -40
  1087. package/tests/analyser/test-cases/switch_statement.txt +0 -96
  1088. package/tests/analyser/test-cases/while_statement.txt +0 -16
  1089. package/tests/analyser/util/symbol-table-utils.test.ts +0 -65
  1090. package/tests/ast/__snapshots__/build-ast.test.ts.snap +0 -38897
  1091. package/tests/ast/build-ast.test.ts +0 -463
  1092. package/tests/ast/visitor/traversing-visitor.test.ts +0 -36
  1093. package/tests/completion/get-potential-syntactic-tokens.test.ts +0 -89
  1094. package/tests/completion/get-potential-token-type-ids.test.ts +0 -76
  1095. package/tests/completion/test-potential-syntactic-tokens-scenario.ts +0 -24
  1096. package/tests/completion/test-potential-token-type-ids-scenario.ts +0 -33
  1097. package/tests/fixtures/history-recording-node-handler.ts +0 -232
  1098. package/tests/lezer/create-parse-error-from-text-and-position.test.ts +0 -129
  1099. package/tests/lezer/create-sdl-parser.test.ts +0 -15
  1100. package/tests/lezer/sdl-parser-scenarios.test.ts +0 -24
  1101. package/tests/lezer/sdl-string-input.test.ts +0 -12
  1102. package/tests/lezer/syntax-error-scenarios.test.ts +0 -114
  1103. package/tests/lezer/test-cases/array_definition.txt +0 -109
  1104. package/tests/lezer/test-cases/class_declaration.txt +0 -141
  1105. package/tests/lezer/test-cases/class_definition.txt +0 -89
  1106. package/tests/lezer/test-cases/comment.txt +0 -335
  1107. package/tests/lezer/test-cases/compound_statement.txt +0 -109
  1108. package/tests/lezer/test-cases/computed_array_definition.txt +0 -33
  1109. package/tests/lezer/test-cases/computed_elementary_type_definition.txt +0 -59
  1110. package/tests/lezer/test-cases/do_statement.txt +0 -48
  1111. package/tests/lezer/test-cases/elementary_type_definition.txt +0 -158
  1112. package/tests/lezer/test-cases/expression.txt +0 -1203
  1113. package/tests/lezer/test-cases/for_statement.txt +0 -183
  1114. package/tests/lezer/test-cases/if_statement.txt +0 -183
  1115. package/tests/lezer/test-cases/invalid.txt +0 -97
  1116. package/tests/lezer/test-cases/map_declaration.txt +0 -152
  1117. package/tests/lezer/test-cases/map_definition.txt +0 -59
  1118. package/tests/lezer/test-cases/number_literal.txt +0 -273
  1119. package/tests/lezer/test-cases/specification.txt +0 -38
  1120. package/tests/lezer/test-cases/string_definition.txt +0 -263
  1121. package/tests/lezer/test-cases/string_literal.txt +0 -303
  1122. package/tests/lezer/test-cases/switch_statement.txt +0 -407
  1123. package/tests/lezer/test-cases/while_statement.txt +0 -45
  1124. package/tests/parse-helper.test.ts +0 -361
  1125. package/tests/prettier/__snapshots__/prettier-plugin-sdl.test.ts.snap +0 -127
  1126. package/tests/prettier/prettier-plugin-sdl.test.ts +0 -58
  1127. package/tests/prettier/print-array.test.ts +0 -29
  1128. package/tests/prettier/print-class.test.ts +0 -15
  1129. package/tests/prettier/print-do.test.ts +0 -25
  1130. package/tests/prettier/print-elementary-type.test.ts +0 -62
  1131. package/tests/prettier/print-error.test.ts +0 -40
  1132. package/tests/prettier/print-expression.test.ts +0 -17
  1133. package/tests/prettier/print-for.test.ts +0 -23
  1134. package/tests/prettier/print-if.test.ts +0 -71
  1135. package/tests/prettier/print-number-literal.test.ts +0 -28
  1136. package/tests/prettier/print-specification.test.ts +0 -54
  1137. package/tests/prettier/print-string.test.ts +0 -36
  1138. package/tests/prettier/print-switch.test.ts +0 -69
  1139. package/tests/prettier/print-while.test.ts +0 -23
  1140. package/tests/prettier/test-prettier-scenario.ts +0 -41
  1141. package/tests/prettier/util/print-utils.test.ts +0 -665
  1142. package/tests/prettier/util/types.test.ts +0 -38
  1143. package/tests/sample-specifications/invalid.sdl +0 -24
  1144. package/tests/sample-specifications/prettified-invalid.sdl +0 -28
  1145. package/tests/sample-specifications/prettified-various-elements-narrow.sdl +0 -97
  1146. package/tests/sample-specifications/prettified-various-elements.sdl +0 -90
  1147. package/tests/sample-specifications/sample.sdl +0 -24
  1148. package/tests/sample-specifications/various-elements.sdl +0 -88
  1149. package/tests/util/logger.test.ts +0 -36
  1150. package/tsconfig.json +0 -29
@@ -0,0 +1,177 @@
1
+ import { NodeKind } from "../../ast/node/enum/node-kind.js";
2
+ import { BinaryOperatorKind } from "../../ast/node/enum/binary-operator-kind.js";
3
+ import { ExpressionKind } from "../../ast/node/enum/expression-kind.js";
4
+ import { isIdentifier, isNumberLiteral } from "../../ast/util/types.js";
5
+ import { resolveNumericType } from "../util/type-utils.js";
6
+ import { NumericType } from "../symbol-table.js";
7
+ function checkConstMutationViaAssignment(node, symbolTable) {
8
+ if (node.binaryOperatorKind !== BinaryOperatorKind.ASSIGNMENT) {
9
+ return [];
10
+ }
11
+ if (!isIdentifier(node.leftOperand)) {
12
+ return [];
13
+ }
14
+ const identifier = node.leftOperand;
15
+ const symbol = symbolTable.lookupVariable(identifier.name);
16
+ if (symbol && symbol.attributes.isConst && symbol.attributes.isComputed) {
17
+ return [
18
+ {
19
+ message: "a const computed variable cannot be mutated.",
20
+ location: node.startToken.getLocation(),
21
+ },
22
+ ];
23
+ }
24
+ return [];
25
+ }
26
+ function checkModulusWithNegativeRhs(node) {
27
+ if (node.binaryOperatorKind !== BinaryOperatorKind.MODULUS) {
28
+ return [];
29
+ }
30
+ if (!isNumberLiteral(node.rightOperand)) {
31
+ return [];
32
+ }
33
+ const rightLiteral = node.rightOperand;
34
+ if (rightLiteral.value < 0) {
35
+ return [
36
+ {
37
+ message: "Using the modulus operator with a negative right-hand operand will lead to undefined behavior.",
38
+ location: node.startToken.getLocation(),
39
+ isWarning: true,
40
+ },
41
+ ];
42
+ }
43
+ return [];
44
+ }
45
+ function checkModulusWithFloatOperands(node, symbolTable) {
46
+ if (node.binaryOperatorKind !== BinaryOperatorKind.MODULUS) {
47
+ return [];
48
+ }
49
+ const leftType = resolveNumericType(node.leftOperand, symbolTable);
50
+ const rightType = resolveNumericType(node.rightOperand, symbolTable);
51
+ if (leftType === NumericType.FLOATING_POINT || rightType === NumericType.FLOATING_POINT) {
52
+ return [
53
+ {
54
+ message: "Using the modulus operator cannot be used with float operands.",
55
+ location: node.startToken.getLocation(),
56
+ },
57
+ ];
58
+ }
59
+ return [];
60
+ }
61
+ function checkModulusWithZeroRhs(node) {
62
+ if (node.binaryOperatorKind !== BinaryOperatorKind.MODULUS) {
63
+ return [];
64
+ }
65
+ if (!isNumberLiteral(node.rightOperand)) {
66
+ return [];
67
+ }
68
+ const rightLiteral = node.rightOperand;
69
+ if (rightLiteral.value === 0) {
70
+ return [
71
+ {
72
+ message: "Using the modulus operator with a right-hand operand of zero will lead to undefined behavior.",
73
+ location: node.startToken.getLocation(),
74
+ isWarning: true,
75
+ },
76
+ ];
77
+ }
78
+ return [];
79
+ }
80
+ function checkDivisionByZero(node) {
81
+ if (node.binaryOperatorKind !== BinaryOperatorKind.DIVIDE) {
82
+ return [];
83
+ }
84
+ if (!isNumberLiteral(node.rightOperand)) {
85
+ return [];
86
+ }
87
+ const rightLiteral = node.rightOperand;
88
+ if (rightLiteral.value === 0) {
89
+ return [
90
+ {
91
+ message: "The value of division where the value of the second operand is zero will lead to undefined behavior.",
92
+ location: node.startToken.getLocation(),
93
+ isWarning: true,
94
+ },
95
+ ];
96
+ }
97
+ return [];
98
+ }
99
+ function checkIntegerDivisionWithNegatives(node, symbolTable) {
100
+ if (node.binaryOperatorKind !== BinaryOperatorKind.DIVIDE) {
101
+ return [];
102
+ }
103
+ const leftType = resolveNumericType(node.leftOperand, symbolTable);
104
+ const rightType = resolveNumericType(node.rightOperand, symbolTable);
105
+ if (leftType !== NumericType.INTEGER || rightType !== NumericType.INTEGER) {
106
+ return [];
107
+ }
108
+ const leftIsNegative = isNumberLiteral(node.leftOperand) && node.leftOperand.value < 0;
109
+ const rightIsNegative = isNumberLiteral(node.rightOperand) && node.rightOperand.value < 0;
110
+ if (leftIsNegative || rightIsNegative) {
111
+ return [
112
+ {
113
+ message: "The direction of truncation for integer division with negative operands is not defined by the SDL which will lead to undefined behavior.",
114
+ location: node.startToken.getLocation(),
115
+ isWarning: true,
116
+ },
117
+ ];
118
+ }
119
+ return [];
120
+ }
121
+ function checkRightShiftOnSignedInt(node, symbolTable) {
122
+ if (node.binaryOperatorKind !== BinaryOperatorKind.SHIFT_RIGHT) {
123
+ return [];
124
+ }
125
+ const leftType = resolveNumericType(node.leftOperand, symbolTable);
126
+ if (leftType === NumericType.INTEGER) {
127
+ return [
128
+ {
129
+ message: "The behaviour of the right shift operator applied to a signed int value is not defined by the SDL which will lead to undefined behavior.",
130
+ location: node.startToken.getLocation(),
131
+ isWarning: true,
132
+ },
133
+ ];
134
+ }
135
+ return [];
136
+ }
137
+ function checkLeftHandAssignmentConst(node, symbolTable) {
138
+ if (node.binaryOperatorKind !== BinaryOperatorKind.ASSIGNMENT) {
139
+ return [];
140
+ }
141
+ if (!isIdentifier(node.leftOperand)) {
142
+ return [];
143
+ }
144
+ const identifier = node.leftOperand;
145
+ const symbol = symbolTable.lookupVariable(identifier.name);
146
+ if (symbol && symbol.attributes.isConst) {
147
+ return [
148
+ {
149
+ message: "The left-hand operand of an assignment operator cannot be a const variable.",
150
+ location: node.startToken.getLocation(),
151
+ },
152
+ ];
153
+ }
154
+ return [];
155
+ }
156
+ export const checkExpressionBinary = {
157
+ nodeKind: NodeKind.EXPRESSION,
158
+ subKind: ExpressionKind.BINARY,
159
+ checkFunc: function (node, symbolTable, _strict) {
160
+ const results = [];
161
+ // Only process BinaryExpression nodes
162
+ if (node.expressionKind !== ExpressionKind.BINARY) {
163
+ return results;
164
+ }
165
+ const binaryExpression = node;
166
+ return [
167
+ ...checkConstMutationViaAssignment(binaryExpression, symbolTable),
168
+ ...checkModulusWithNegativeRhs(binaryExpression),
169
+ ...checkModulusWithFloatOperands(binaryExpression, symbolTable),
170
+ ...checkModulusWithZeroRhs(binaryExpression),
171
+ ...checkDivisionByZero(binaryExpression),
172
+ ...checkIntegerDivisionWithNegatives(binaryExpression, symbolTable),
173
+ ...checkRightShiftOnSignedInt(binaryExpression, symbolTable),
174
+ ...checkLeftHandAssignmentConst(binaryExpression, symbolTable),
175
+ ];
176
+ },
177
+ };
@@ -0,0 +1,3 @@
1
+ import type { Check } from "./check.ts";
2
+ export declare const checkExpressionLengthof: Check;
3
+ //# sourceMappingURL=check-expression-lengthof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-expression-lengthof.d.ts","sourceRoot":"","sources":["../../../../src/analyser/checks/check-expression-lengthof.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,uBAAuB,EAAE,KAsBrC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ExpressionKind } from "../../ast/node/enum/expression-kind.js";
2
+ import { NodeKind } from "../../ast/node/enum/node-kind.js";
3
+ import { isIdentifier } from "../../ast/util/types.js";
4
+ export const checkExpressionLengthof = {
5
+ nodeKind: NodeKind.EXPRESSION,
6
+ subKind: ExpressionKind.LENGTHOF,
7
+ checkFunc: function (node, symbolTable, _strict) {
8
+ const results = [];
9
+ // Check if operand is an identifier
10
+ if (isIdentifier(node.operand)) {
11
+ // Look up the variable in the symbol table
12
+ const variable = symbolTable.lookupVariable(node.operand.name);
13
+ // If variable exists and is computed, report error
14
+ if (variable && variable.attributes.isComputed) {
15
+ results.push({
16
+ message: "The lengthof operator cannot be used with a computed variable.",
17
+ location: node.operand.startToken.getLocation(),
18
+ });
19
+ }
20
+ }
21
+ return results;
22
+ },
23
+ };
@@ -0,0 +1,3 @@
1
+ import type { Check } from "./check.ts";
2
+ export declare const checkExpressionUnary: Check;
3
+ //# sourceMappingURL=check-expression-unary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-expression-unary.d.ts","sourceRoot":"","sources":["../../../../src/analyser/checks/check-expression-unary.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAC;AAmIrD,eAAO,MAAM,oBAAoB,EAAE,KAgBlC,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { NodeKind } from "../../ast/node/enum/node-kind.js";
2
+ import { StatementKind } from "../../ast/node/enum/statement-kind.js";
3
+ import { TokenKind } from "../../ast/node/enum/token-kind.js";
4
+ import { ExpressionKind } from "../../ast/node/enum/expression-kind.js";
5
+ import { isIdentifier, isUnaryExpression } from "../../ast/util/types.js";
6
+ function checkConstMutationViaPostfix(expression, symbolTable) {
7
+ const results = [];
8
+ if (expression.postfixOperator !== undefined &&
9
+ (expression.postfixOperator.tokenKind === TokenKind.POSTFIX_INCREMENT ||
10
+ expression.postfixOperator.tokenKind === TokenKind.POSTFIX_DECREMENT)) {
11
+ let targetIdentifier;
12
+ if (isIdentifier(expression.operand)) {
13
+ targetIdentifier = expression.operand;
14
+ }
15
+ else if (expression.operand.nodeKind === NodeKind.EXPRESSION &&
16
+ isIdentifier(expression.operand.operand)) {
17
+ targetIdentifier = expression.operand.operand;
18
+ }
19
+ if (targetIdentifier) {
20
+ const variable = symbolTable.lookupVariable(targetIdentifier.name);
21
+ if (variable && variable.attributes.isConst && variable.attributes.isComputed) {
22
+ results.push({
23
+ message: "a const computed variable cannot be mutated.",
24
+ location: expression.startToken.getLocation(),
25
+ });
26
+ }
27
+ }
28
+ }
29
+ return results;
30
+ }
31
+ function checkArrayDimensionCountMismatch(expression, symbolTable) {
32
+ const results = [];
33
+ if (expression.arrayElementAccess) {
34
+ // Find the base identifier by traversing nested UnaryExpressions
35
+ let baseIdentifier;
36
+ let currentExpr = expression;
37
+ let accessDimensions = 0;
38
+ // Count array access dimensions by traversing the nested structure
39
+ while (isUnaryExpression(currentExpr)) {
40
+ if (currentExpr.arrayElementAccess) {
41
+ accessDimensions++;
42
+ }
43
+ currentExpr = currentExpr.operand;
44
+ }
45
+ // Check if we found an identifier at the base
46
+ if (isIdentifier(currentExpr)) {
47
+ baseIdentifier = currentExpr;
48
+ }
49
+ if (baseIdentifier) {
50
+ const variable = symbolTable.lookupVariable(baseIdentifier.name);
51
+ if (variable && variable.attributes.isArray) {
52
+ // Get the array definition from the symbol's AST node
53
+ const arrayDefinition = variable.node;
54
+ // Count dimensions in the array definition
55
+ let definedDimensions = 0;
56
+ if (arrayDefinition.implicitArrayDimension) {
57
+ definedDimensions++;
58
+ }
59
+ definedDimensions += arrayDefinition.dimensions.length;
60
+ if (definedDimensions !== accessDimensions) {
61
+ results.push({
62
+ message: "The number of dimensions used when accessing an array element must match the number of dimensions in the array definition.",
63
+ location: expression.startToken.getLocation(),
64
+ });
65
+ }
66
+ }
67
+ }
68
+ }
69
+ return results;
70
+ }
71
+ function checkUninitializedComputedVariableAccess(expression, _symbolTable) {
72
+ const results = [];
73
+ if (isIdentifier(expression.operand)) {
74
+ const variable = _symbolTable.lookupVariable(expression.operand.name);
75
+ if (variable && variable.attributes.isComputed) {
76
+ // Check if the variable definition has no initial value
77
+ // For computed variables, this would be AbstractElementaryTypeDefinition
78
+ if (variable.node.nodeKind === NodeKind.STATEMENT &&
79
+ variable.node.statementKind ===
80
+ StatementKind.COMPUTED_ELEMENTARY_TYPE_DEFINITION) {
81
+ const definition = variable.node;
82
+ if (!definition.value) {
83
+ results.push({
84
+ message: "Accessing a computed variable value before it is initialised will result in undefined behaviour.",
85
+ location: expression.operand.getLocation(),
86
+ isWarning: true,
87
+ });
88
+ }
89
+ }
90
+ }
91
+ }
92
+ return results;
93
+ }
94
+ export const checkExpressionUnary = {
95
+ nodeKind: NodeKind.EXPRESSION,
96
+ subKind: ExpressionKind.UNARY,
97
+ checkFunc: function (expression, symbolTable, _strict) {
98
+ const results = [];
99
+ results.push(...checkConstMutationViaPostfix(expression, symbolTable));
100
+ results.push(...checkArrayDimensionCountMismatch(expression, symbolTable));
101
+ results.push(...checkUninitializedComputedVariableAccess(expression, symbolTable));
102
+ return results;
103
+ },
104
+ };
@@ -0,0 +1,3 @@
1
+ import type { Check } from "./check.ts";
2
+ export declare const checkIdentifier: Check;
3
+ //# sourceMappingURL=check-identifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-identifier.d.ts","sourceRoot":"","sources":["../../../../src/analyser/checks/check-identifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAC;AA8CrD,eAAO,MAAM,eAAe,EAAE,KAiB7B,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { NodeKind } from "../../ast/node/enum/node-kind.js";
2
+ // Build set of SDL keywords and literal prefixes
3
+ const getReservedIdentifiers = () => {
4
+ // Add SDL keywords from token mapping
5
+ const reserved = new Set([
6
+ "abstract",
7
+ "aligned",
8
+ "base64string",
9
+ "bit",
10
+ "break",
11
+ "case",
12
+ "class",
13
+ "computed",
14
+ "const",
15
+ "default",
16
+ "do",
17
+ "else",
18
+ "expandable",
19
+ "extends",
20
+ "float",
21
+ "for",
22
+ "if",
23
+ "int",
24
+ "legacy",
25
+ "lengthof",
26
+ "map",
27
+ "reserved",
28
+ "switch",
29
+ "unsigned",
30
+ "utf8string",
31
+ "utf16string",
32
+ "utfstring",
33
+ "utf8list",
34
+ "while",
35
+ ]);
36
+ // Add literal prefixes
37
+ reserved.add("0b");
38
+ reserved.add("0x");
39
+ return reserved;
40
+ };
41
+ const reservedIdentifiers = getReservedIdentifiers();
42
+ export const checkIdentifier = {
43
+ nodeKind: NodeKind.IDENTIFIER,
44
+ checkFunc: function (node, _symbolTable, _strict) {
45
+ const results = [];
46
+ const identifierName = node.name.toLowerCase();
47
+ if (reservedIdentifiers.has(identifierName)) {
48
+ results.push({
49
+ message: "It is illegal to define an identifier which conflicts (ignoring case) with SDL syntax items such as keywords, binary, hexadecimal and string literal prefixes.",
50
+ location: node.getLocation(),
51
+ });
52
+ }
53
+ return results;
54
+ },
55
+ };
@@ -0,0 +1,5 @@
1
+ import type { AbstractStatement } from "../../ast/node/abstract-statement.ts";
2
+ import type { Check } from "./check.ts";
3
+ export declare function collectMemberVariableNames(statement: AbstractStatement): Set<string>;
4
+ export declare const checkIfStatement: Check;
5
+ //# sourceMappingURL=check-if-statement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-if-statement.d.ts","sourceRoot":"","sources":["../../../../src/analyser/checks/check-if-statement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAC;AAIrD,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,iBAAiB,GAAG,GAAG,CAAC,MAAM,CAAC,CAyEpF;AAyBD,eAAO,MAAM,gBAAgB,EAAE,KA6C9B,CAAC"}
@@ -0,0 +1,122 @@
1
+ import { NodeKind } from "../../ast/node/enum/node-kind.js";
2
+ import { StatementKind } from "../../ast/node/enum/statement-kind.js";
3
+ import { isCaseClause, isDefaultClause, isStatement } from "../../ast/util/types.js";
4
+ export function collectMemberVariableNames(statement) {
5
+ const names = new Set();
6
+ function traverse(stmt) {
7
+ // Check if this statement declares a member variable
8
+ if (stmt.nodeKind === NodeKind.STATEMENT) {
9
+ switch (stmt.statementKind) {
10
+ case StatementKind.ELEMENTARY_TYPE_DEFINITION:
11
+ case StatementKind.COMPUTED_ELEMENTARY_TYPE_DEFINITION:
12
+ case StatementKind.ARRAY_DEFINITION:
13
+ case StatementKind.COMPUTED_ARRAY_DEFINITION:
14
+ case StatementKind.STRING_DEFINITION:
15
+ case StatementKind.CLASS_DEFINITION:
16
+ case StatementKind.MAP_DEFINITION: {
17
+ // These statements have an identifier property that represents the variable name
18
+ const stmtWithIdentifier = stmt;
19
+ if (stmtWithIdentifier.identifier?.name) {
20
+ names.add(stmtWithIdentifier.identifier.name);
21
+ }
22
+ break;
23
+ }
24
+ case StatementKind.COMPOUND: {
25
+ // Recursively check compound statements
26
+ const compoundStmt = stmt;
27
+ if (compoundStmt.statements) {
28
+ for (const nestedStmt of compoundStmt.statements) {
29
+ traverse(nestedStmt);
30
+ }
31
+ }
32
+ break;
33
+ }
34
+ case StatementKind.IF: {
35
+ // Recursively check if statements
36
+ const ifStmt = stmt;
37
+ if (!isStatement(ifStmt.ifStatement)) {
38
+ break;
39
+ }
40
+ traverse(ifStmt.ifStatement);
41
+ if (isStatement(ifStmt.elseStatement)) {
42
+ traverse(ifStmt.elseStatement);
43
+ }
44
+ break;
45
+ }
46
+ case StatementKind.SWITCH: {
47
+ // Recursively check switch statements
48
+ const switchStmt = stmt;
49
+ if (switchStmt.caseClauses) {
50
+ for (const caseClause of switchStmt.caseClauses) {
51
+ if (isCaseClause(caseClause) && caseClause.statements) {
52
+ for (const nestedStmt of caseClause.statements) {
53
+ traverse(nestedStmt);
54
+ }
55
+ }
56
+ }
57
+ }
58
+ if (isDefaultClause(switchStmt.defaultClause) && switchStmt.defaultClause.statements) {
59
+ for (const nestedStmt of switchStmt.defaultClause.statements) {
60
+ traverse(nestedStmt);
61
+ }
62
+ }
63
+ break;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ traverse(statement);
69
+ return names;
70
+ }
71
+ function collectAllBranchMemberNames(statement) {
72
+ const allNames = new Set();
73
+ function addBranchNames(stmt) {
74
+ const names = collectMemberVariableNames(stmt);
75
+ for (const name of names) {
76
+ allNames.add(name);
77
+ }
78
+ // Recursively check nested if statements (else if chains)
79
+ if (stmt.statementKind === StatementKind.IF) {
80
+ const ifStmt = stmt;
81
+ if (isStatement(ifStmt.elseStatement)) {
82
+ addBranchNames(ifStmt.elseStatement);
83
+ }
84
+ }
85
+ }
86
+ addBranchNames(statement);
87
+ return allNames;
88
+ }
89
+ export const checkIfStatement = {
90
+ nodeKind: NodeKind.STATEMENT,
91
+ subKind: StatementKind.IF,
92
+ checkFunc: function (ifStatement, symbolTable, _strict) {
93
+ const results = [];
94
+ const classScope = symbolTable.getEnclosingClassScope();
95
+ if (!classScope) {
96
+ return results;
97
+ }
98
+ if (!isStatement(ifStatement.ifStatement)) {
99
+ return results;
100
+ }
101
+ const ifMemberNames = collectMemberVariableNames(ifStatement.ifStatement);
102
+ // Handle else if chains by collecting all member names from the else branch
103
+ let elseMemberNames = new Set();
104
+ if (isStatement(ifStatement.elseStatement)) {
105
+ elseMemberNames = collectAllBranchMemberNames(ifStatement.elseStatement);
106
+ }
107
+ const overlappingNames = [];
108
+ for (const name of ifMemberNames) {
109
+ if (elseMemberNames.has(name)) {
110
+ overlappingNames.push(name);
111
+ }
112
+ }
113
+ if (overlappingNames.length > 0) {
114
+ results.push({
115
+ message: "This if-then-else clauses may result in duplicate class member variables being declared simultaneously.",
116
+ location: ifStatement.startToken.getLocation(),
117
+ isWarning: true,
118
+ });
119
+ }
120
+ return results;
121
+ },
122
+ };
@@ -0,0 +1,3 @@
1
+ import type { Check } from "./check.ts";
2
+ export declare const checkMapDeclaration: Check;
3
+ //# sourceMappingURL=check-map-declaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-map-declaration.d.ts","sourceRoot":"","sources":["../../../../src/analyser/checks/check-map-declaration.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAC;AA4JrD,eAAO,MAAM,mBAAmB,EAAE,KAcjC,CAAC"}
@@ -0,0 +1,130 @@
1
+ import { NodeKind } from "../../ast/node/enum/node-kind.js";
2
+ import { StatementKind } from "../../ast/node/enum/statement-kind.js";
3
+ import { isIdentifier, isNumberLiteral } from "../../ast/util/types.js";
4
+ import { ScopeKind } from "../symbol-table.js";
5
+ function countOutputValues(outputValue) {
6
+ return outputValue.outputValues.length;
7
+ }
8
+ function checkOutputValuesTypeMatch(declaration, symbolTable) {
9
+ const results = [];
10
+ if (declaration.outputElementaryType !== undefined) {
11
+ for (const entry of declaration.mapEntries) {
12
+ if (entry.nodeKind !== NodeKind.MAP_ENTRY) {
13
+ continue;
14
+ }
15
+ const mapEntry = entry;
16
+ if (mapEntry.outputValue &&
17
+ mapEntry.outputValue.nodeKind === NodeKind.AGGREGATE_OUTPUT_VALUE) {
18
+ const outputValue = mapEntry.outputValue;
19
+ if (countOutputValues(outputValue) !== 1) {
20
+ results.push({
21
+ message: "The type and number of constituent values within the aggregate output values of the map declaration must match the corresponding constituent types within the map's output_type.",
22
+ location: outputValue.startToken.getLocation(),
23
+ });
24
+ }
25
+ }
26
+ }
27
+ }
28
+ else if (declaration.outputClassIdentifier !== undefined &&
29
+ isIdentifier(declaration.outputClassIdentifier)) {
30
+ const className = declaration.outputClassIdentifier.name;
31
+ const classScope = symbolTable
32
+ .getGlobalScope()
33
+ .children.find((scope) => scope.name === className && scope.kind === ScopeKind.CLASS);
34
+ if (classScope?.classMemberSymbols) {
35
+ const expectedMemberCount = classScope.classMemberSymbols.size;
36
+ for (const entry of declaration.mapEntries) {
37
+ if (entry.nodeKind !== NodeKind.MAP_ENTRY) {
38
+ continue;
39
+ }
40
+ const mapEntry = entry;
41
+ if (mapEntry.outputValue &&
42
+ mapEntry.outputValue.nodeKind === NodeKind.AGGREGATE_OUTPUT_VALUE) {
43
+ const outputValue = mapEntry.outputValue;
44
+ if (countOutputValues(outputValue) !== expectedMemberCount) {
45
+ results.push({
46
+ message: "The type and number of constituent values within the aggregate output values of the map declaration must match the corresponding constituent types within the map's output_type.",
47
+ location: outputValue.startToken.getLocation(),
48
+ });
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ return results;
55
+ }
56
+ function hasParsableMembers(className, symbolTable, visited) {
57
+ if (visited.has(className)) {
58
+ return false;
59
+ }
60
+ visited.add(className);
61
+ const classScope = symbolTable
62
+ .getGlobalScope()
63
+ .children.find((scope) => scope.name === className && scope.kind === ScopeKind.CLASS);
64
+ if (!classScope?.classMemberSymbols) {
65
+ return false;
66
+ }
67
+ for (const memberEntries of classScope.classMemberSymbols.values()) {
68
+ for (const entry of memberEntries) {
69
+ if (entry.symbol.attributes.isComputed !== true) {
70
+ return true;
71
+ }
72
+ if (entry.symbol.attributes.classType &&
73
+ hasParsableMembers(entry.symbol.attributes.classType, symbolTable, visited)) {
74
+ return true;
75
+ }
76
+ }
77
+ }
78
+ return false;
79
+ }
80
+ function checkParsableClassOutput(declaration, symbolTable) {
81
+ if (declaration.outputClassIdentifier === undefined ||
82
+ !isIdentifier(declaration.outputClassIdentifier)) {
83
+ return [];
84
+ }
85
+ const className = declaration.outputClassIdentifier.name;
86
+ if (hasParsableMembers(className, symbolTable, new Set())) {
87
+ return [
88
+ {
89
+ message: "Declaring a map with an output_value consisting of a class with parsable members will result in undefined behaviour.",
90
+ location: declaration.outputClassIdentifier.startToken.getLocation(),
91
+ isWarning: true,
92
+ },
93
+ ];
94
+ }
95
+ return [];
96
+ }
97
+ function checkUniqueInputValues(declaration) {
98
+ const results = [];
99
+ const seenValues = new Map();
100
+ for (const entry of declaration.mapEntries) {
101
+ if (entry.nodeKind !== NodeKind.MAP_ENTRY) {
102
+ continue;
103
+ }
104
+ const mapEntry = entry;
105
+ if (isNumberLiteral(mapEntry.inputValue)) {
106
+ const value = mapEntry.inputValue.value;
107
+ if (seenValues.has(value)) {
108
+ results.push({
109
+ message: "Input values in a map declaration must be unique.",
110
+ location: mapEntry.inputValue.startToken.getLocation(),
111
+ });
112
+ }
113
+ else {
114
+ seenValues.set(value, true);
115
+ }
116
+ }
117
+ }
118
+ return results;
119
+ }
120
+ export const checkMapDeclaration = {
121
+ nodeKind: NodeKind.STATEMENT,
122
+ subKind: StatementKind.MAP_DECLARATION,
123
+ checkFunc: function (declaration, symbolTable, _strict) {
124
+ return [
125
+ ...checkOutputValuesTypeMatch(declaration, symbolTable),
126
+ ...checkParsableClassOutput(declaration, symbolTable),
127
+ ...checkUniqueInputValues(declaration),
128
+ ];
129
+ },
130
+ };
@@ -0,0 +1,3 @@
1
+ import type { Check } from "./check.ts";
2
+ export declare const checkMapDefinition: Check;
3
+ //# sourceMappingURL=check-map-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-map-definition.d.ts","sourceRoot":"","sources":["../../../../src/analyser/checks/check-map-definition.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAC;AAoFrD,eAAO,MAAM,kBAAkB,EAAE,KAchC,CAAC"}