arkanalyzer 1.0.85 → 1.0.87

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 (400) hide show
  1. package/README.en.md +69 -65
  2. package/README.md +56 -70
  3. package/config/arkanalyzer.json +7 -2
  4. package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
  5. package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
  6. package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
  7. package/docs/cppFrontend/img.png +0 -0
  8. package/docs/cppFrontend/img_1.png +0 -0
  9. package/docs/cppFrontend/img_10.png +0 -0
  10. package/docs/cppFrontend/img_11.png +0 -0
  11. package/docs/cppFrontend/img_12.png +0 -0
  12. package/docs/cppFrontend/img_13.png +0 -0
  13. package/docs/cppFrontend/img_14.png +0 -0
  14. package/docs/cppFrontend/img_15.png +0 -0
  15. package/docs/cppFrontend/img_16.png +0 -0
  16. package/docs/cppFrontend/img_17.png +0 -0
  17. package/docs/cppFrontend/img_18.png +0 -0
  18. package/docs/cppFrontend/img_19.png +0 -0
  19. package/docs/cppFrontend/img_2.png +0 -0
  20. package/docs/cppFrontend/img_20.png +0 -0
  21. package/docs/cppFrontend/img_21.png +0 -0
  22. package/docs/cppFrontend/img_22.png +0 -0
  23. package/docs/cppFrontend/img_23.png +0 -0
  24. package/docs/cppFrontend/img_3.png +0 -0
  25. package/docs/cppFrontend/img_4.png +0 -0
  26. package/docs/cppFrontend/img_5.png +0 -0
  27. package/docs/cppFrontend/img_6.png +0 -0
  28. package/docs/cppFrontend/img_7.png +0 -0
  29. package/docs/cppFrontend/img_8.png +0 -0
  30. package/docs/cppFrontend/img_9.png +0 -0
  31. package/docs/sig_programanalysis.en.md +66 -0
  32. package/docs/sig_programanalysis.md +73 -0
  33. package/lib/Config.d.ts +32 -1
  34. package/lib/Config.d.ts.map +1 -1
  35. package/lib/Config.js +76 -2
  36. package/lib/Scene.d.ts +25 -2
  37. package/lib/Scene.d.ts.map +1 -1
  38. package/lib/Scene.js +148 -40
  39. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
  40. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
  41. package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
  42. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
  43. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
  44. package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
  45. package/lib/callgraph/common/Statistics.d.ts +4 -2
  46. package/lib/callgraph/common/Statistics.d.ts.map +1 -1
  47. package/lib/callgraph/common/Statistics.js +14 -2
  48. package/lib/callgraph/model/CallGraph.d.ts +12 -8
  49. package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
  50. package/lib/callgraph/model/CallGraph.js +53 -29
  51. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
  52. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
  53. package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
  54. package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
  55. package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
  56. package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
  57. package/lib/cli/cli.d.ts +3 -0
  58. package/lib/cli/cli.d.ts.map +1 -0
  59. package/lib/cli/cli.js +82 -0
  60. package/lib/cli/commands/cg.d.ts +32 -0
  61. package/lib/cli/commands/cg.d.ts.map +1 -0
  62. package/lib/cli/commands/cg.js +401 -0
  63. package/lib/cli/commands/index.d.ts +6 -0
  64. package/lib/cli/commands/index.d.ts.map +1 -0
  65. package/lib/cli/commands/index.js +64 -0
  66. package/lib/cli/commands/ir.d.ts +26 -0
  67. package/lib/cli/commands/ir.d.ts.map +1 -0
  68. package/lib/cli/commands/ir.js +94 -0
  69. package/lib/core/base/Constant.d.ts +1 -1
  70. package/lib/core/base/Constant.d.ts.map +1 -1
  71. package/lib/core/base/Constant.js +1 -1
  72. package/lib/core/base/Expr.d.ts +29 -5
  73. package/lib/core/base/Expr.d.ts.map +1 -1
  74. package/lib/core/base/Expr.js +144 -22
  75. package/lib/core/base/Position.d.ts +14 -0
  76. package/lib/core/base/Position.d.ts.map +1 -1
  77. package/lib/core/base/Position.js +27 -0
  78. package/lib/core/base/Ref.d.ts +1 -0
  79. package/lib/core/base/Ref.d.ts.map +1 -1
  80. package/lib/core/base/Ref.js +4 -1
  81. package/lib/core/base/Type.d.ts +64 -24
  82. package/lib/core/base/Type.d.ts.map +1 -1
  83. package/lib/core/base/Type.js +144 -49
  84. package/lib/core/common/ArkError.d.ts +26 -2
  85. package/lib/core/common/ArkError.d.ts.map +1 -1
  86. package/lib/core/common/ArkError.js +56 -2
  87. package/lib/core/common/ArkIRTransformer.d.ts +11 -10
  88. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
  89. package/lib/core/common/ArkIRTransformer.js +1 -1
  90. package/lib/core/common/ArkValueTransformer.d.ts +14 -12
  91. package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
  92. package/lib/core/common/ArkValueTransformer.js +1 -5
  93. package/lib/core/common/Const.d.ts +3 -0
  94. package/lib/core/common/Const.d.ts.map +1 -1
  95. package/lib/core/common/Const.js +4 -1
  96. package/lib/core/common/DummyMainCreater.d.ts +23 -13
  97. package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
  98. package/lib/core/common/DummyMainCreater.js +66 -43
  99. package/lib/core/common/EtsConst.d.ts +11 -0
  100. package/lib/core/common/EtsConst.d.ts.map +1 -1
  101. package/lib/core/common/EtsConst.js +12 -1
  102. package/lib/core/common/IRInference.d.ts.map +1 -1
  103. package/lib/core/common/IRInference.js +5 -1
  104. package/lib/core/common/ModelUtils.d.ts +4 -7
  105. package/lib/core/common/ModelUtils.d.ts.map +1 -1
  106. package/lib/core/common/ModelUtils.js +77 -110
  107. package/lib/core/common/SdkUtils.d.ts +1 -1
  108. package/lib/core/common/SdkUtils.d.ts.map +1 -1
  109. package/lib/core/common/SdkUtils.js +14 -5
  110. package/lib/core/common/TypeInference.d.ts.map +1 -1
  111. package/lib/core/common/TypeInference.js +9 -3
  112. package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
  113. package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
  114. package/lib/core/graph/BaseExplicitGraph.js +15 -8
  115. package/lib/core/graph/BasicBlock.d.ts.map +1 -1
  116. package/lib/core/graph/Scc.d.ts.map +1 -1
  117. package/lib/core/graph/Scc.js +7 -2
  118. package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
  119. package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
  120. package/lib/core/graph/builder/CfgBuilder.js +12 -5
  121. package/lib/core/inference/Inference.d.ts.map +1 -1
  122. package/lib/core/inference/Inference.js +7 -0
  123. package/lib/core/inference/ModelInference.d.ts +1 -1
  124. package/lib/core/inference/ModelInference.d.ts.map +1 -1
  125. package/lib/core/inference/ValueInference.d.ts +3 -2
  126. package/lib/core/inference/ValueInference.d.ts.map +1 -1
  127. package/lib/core/inference/ValueInference.js +64 -12
  128. package/lib/core/inference/abc/AbcInference.d.ts +28 -2
  129. package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
  130. package/lib/core/inference/abc/AbcInference.js +105 -4
  131. package/lib/core/model/ArkBaseModel.d.ts +14 -1
  132. package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
  133. package/lib/core/model/ArkBaseModel.js +61 -2
  134. package/lib/core/model/ArkBody.d.ts.map +1 -1
  135. package/lib/core/model/ArkBody.js +1 -3
  136. package/lib/core/model/ArkClass.d.ts +22 -2
  137. package/lib/core/model/ArkClass.d.ts.map +1 -1
  138. package/lib/core/model/ArkClass.js +59 -28
  139. package/lib/core/model/ArkField.d.ts.map +1 -1
  140. package/lib/core/model/ArkField.js +3 -1
  141. package/lib/core/model/ArkFile.d.ts +4 -1
  142. package/lib/core/model/ArkFile.d.ts.map +1 -1
  143. package/lib/core/model/ArkFile.js +44 -3
  144. package/lib/core/model/ArkImport.d.ts.map +1 -1
  145. package/lib/core/model/ArkImport.js +9 -1
  146. package/lib/core/model/ArkMethod.d.ts +5 -0
  147. package/lib/core/model/ArkMethod.d.ts.map +1 -1
  148. package/lib/core/model/ArkMethod.js +33 -1
  149. package/lib/core/model/ArkNamespace.d.ts +2 -0
  150. package/lib/core/model/ArkNamespace.d.ts.map +1 -1
  151. package/lib/core/model/ArkNamespace.js +11 -0
  152. package/lib/core/model/ArkSignature.d.ts +3 -3
  153. package/lib/core/model/ArkSignature.d.ts.map +1 -1
  154. package/lib/core/model/ArkSignature.js +14 -9
  155. package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
  156. package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
  157. package/lib/core/model/builder/ArkClassBuilder.js +3 -3
  158. package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
  159. package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  160. package/lib/core/model/builder/ArkMethodBuilder.js +19 -6
  161. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
  162. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  163. package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
  164. package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
  165. package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
  166. package/lib/core/model/builder/builderUtils.d.ts +1 -0
  167. package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
  168. package/lib/core/model/builder/builderUtils.js +7 -3
  169. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
  170. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
  171. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
  172. package/lib/frontend/cppFrontend/ast/astUtils.d.ts +51 -0
  173. package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
  174. package/lib/frontend/cppFrontend/ast/astUtils.js +470 -0
  175. package/lib/frontend/cppFrontend/ast/const.d.ts +30 -0
  176. package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
  177. package/lib/frontend/cppFrontend/ast/const.js +134 -0
  178. package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
  179. package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
  180. package/lib/frontend/cppFrontend/base/Constant.js +33 -0
  181. package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
  182. package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
  183. package/lib/frontend/cppFrontend/base/Expr.js +530 -0
  184. package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
  185. package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
  186. package/lib/frontend/cppFrontend/base/Ref.js +53 -0
  187. package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
  188. package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
  189. package/lib/frontend/cppFrontend/base/Trap.js +28 -0
  190. package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
  191. package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
  192. package/lib/frontend/cppFrontend/base/Type.js +600 -0
  193. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
  194. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
  195. package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
  196. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
  197. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
  198. package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
  199. package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
  200. package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
  201. package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
  202. package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
  203. package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
  204. package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
  205. package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
  206. package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
  207. package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
  208. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
  209. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
  210. package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
  211. package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
  212. package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
  213. package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
  214. package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
  215. package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
  216. package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
  217. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
  218. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
  219. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
  220. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
  221. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
  222. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
  223. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
  224. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
  225. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
  226. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
  227. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
  228. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
  229. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
  230. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
  231. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
  232. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
  233. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
  234. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
  235. package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
  236. package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
  237. package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
  238. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
  239. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
  240. package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
  241. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
  242. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
  243. package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
  244. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
  245. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
  246. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
  247. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
  248. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
  249. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
  250. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
  251. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
  252. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +285 -0
  253. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
  254. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
  255. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
  256. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
  257. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
  258. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
  259. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
  260. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
  261. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
  262. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
  263. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
  264. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
  265. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
  266. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
  267. package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
  268. package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
  269. package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
  270. package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
  271. package/lib/index.d.ts +1 -0
  272. package/lib/index.d.ts.map +1 -1
  273. package/lib/index.js +7 -1
  274. package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
  275. package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
  276. package/lib/save/CGJsonPrinter.d.ts +8 -0
  277. package/lib/save/CGJsonPrinter.d.ts.map +1 -0
  278. package/lib/save/CGJsonPrinter.js +41 -0
  279. package/lib/save/GraphPrinter.js +2 -2
  280. package/lib/save/json/JsonDto.d.ts +86 -2
  281. package/lib/save/json/JsonDto.d.ts.map +1 -1
  282. package/lib/save/json/JsonSerialization.d.ts +1 -1
  283. package/lib/save/json/JsonSerialization.d.ts.map +1 -1
  284. package/lib/save/json/JsonSerialization.js +235 -145
  285. package/lib/save/source/SourceTransformer.d.ts.map +1 -1
  286. package/lib/save/source/SourceTransformer.js +0 -3
  287. package/lib/utils/CxxSceneUtils.d.ts +11 -0
  288. package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
  289. package/lib/utils/CxxSceneUtils.js +178 -0
  290. package/lib/utils/FileUtils.d.ts +7 -8
  291. package/lib/utils/FileUtils.d.ts.map +1 -1
  292. package/lib/utils/FileUtils.js +27 -45
  293. package/lib/utils/LRUCacheDecorator.d.ts +20 -0
  294. package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
  295. package/lib/utils/LRUCacheDecorator.js +89 -0
  296. package/lib/utils/ModuleUtils.d.ts +39 -0
  297. package/lib/utils/ModuleUtils.d.ts.map +1 -0
  298. package/lib/utils/ModuleUtils.js +261 -0
  299. package/package.json +15 -12
  300. /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
  301. /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
  302. /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
  303. /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
  304. /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
  305. /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
  306. /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
  307. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
  308. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
  309. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
  310. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
  311. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
  312. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
  313. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
  314. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
  315. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
  316. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
  317. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
  318. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
  319. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
  320. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
  321. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
  322. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
  323. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
  324. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
  325. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
  326. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
  327. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
  328. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
  329. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
  330. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
  331. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
  332. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
  333. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
  334. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
  335. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
  336. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
  337. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
  338. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
  339. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
  340. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
  341. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
  342. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
  343. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
  344. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
  345. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
  346. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
  347. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
  348. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
  349. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
  350. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
  351. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
  352. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
  353. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
  354. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
  355. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
  356. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
  357. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
  358. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
  359. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
  360. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
  361. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
  362. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
  363. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
  364. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
  365. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
  366. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
  367. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
  368. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
  369. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
  370. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
  371. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
  372. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
  373. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
  374. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
  375. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
  376. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
  377. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
  378. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
  379. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
  380. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
  381. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
  382. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
  383. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
  384. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
  385. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
  386. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
  387. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
  388. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
  389. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
  390. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
  391. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
  392. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
  393. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
  394. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
  395. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
  396. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
  397. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
  398. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
  399. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
  400. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.registerCommands = void 0;
30
+ const fs_1 = __importDefault(require("fs"));
31
+ const path_1 = __importDefault(require("path"));
32
+ function isCommandFile(file) {
33
+ if (file === 'index.ts' || file === 'index.js') {
34
+ return false;
35
+ }
36
+ if (!/\.(ts|js)$/.test(file)) {
37
+ return false;
38
+ }
39
+ if (file.endsWith('.d.ts')) {
40
+ return false;
41
+ }
42
+ return true;
43
+ }
44
+ function registerCommands(program) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const commandsDir = __dirname;
47
+ const files = fs_1.default.readdirSync(commandsDir).sort();
48
+ for (const file of files) {
49
+ if (!isCommandFile(file)) {
50
+ continue;
51
+ }
52
+ const abs = path_1.default.join(commandsDir, file);
53
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
54
+ const commandModule = require(abs);
55
+ if (typeof commandModule.register === 'function') {
56
+ commandModule.register(program);
57
+ }
58
+ else {
59
+ console.warn(`Command file ${file} does not export register`);
60
+ }
61
+ }
62
+ });
63
+ }
64
+ exports.registerCommands = registerCommands;
@@ -0,0 +1,26 @@
1
+ import { Command } from 'commander';
2
+ export interface IrCommandOptions {
3
+ project: string;
4
+ output: string;
5
+ format?: 'json' | 'text' | 'dot';
6
+ inferTypes: boolean;
7
+ ohosSdkHome?: string;
8
+ }
9
+ export declare function dumpProjectToReadableIR(options: IrCommandOptions): {
10
+ output: string;
11
+ fileCount: number;
12
+ formatUsed: string;
13
+ };
14
+ /**
15
+ * Register IR export command.
16
+ *
17
+ * Usage:
18
+ * arkanalyzer ir <input> [options]
19
+ *
20
+ * Examples:
21
+ * arkanalyzer ir ./my_project -f text
22
+ * arkanalyzer ir ./my_project -f json -o ./out/ir
23
+ * arkanalyzer ir ./my_project -f dot --ohos-sdk-home /path/to/sdk
24
+ */
25
+ export declare function register(program: Command): void;
26
+ //# sourceMappingURL=ir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ir.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA2B5H;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+B/C"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.register = exports.dumpProjectToReadableIR = void 0;
18
+ const Scene_1 = require("../../Scene");
19
+ const Config_1 = require("../../Config");
20
+ const PrinterBuilder_1 = require("../../save/PrinterBuilder");
21
+ const ArkError_1 = require("../../core/common/ArkError");
22
+ function dumpProjectToReadableIR(options) {
23
+ var _a;
24
+ const config = (0, Config_1.buildSceneConfigFromProject)(options.project, options.ohosSdkHome);
25
+ const scene = new Scene_1.Scene();
26
+ scene.buildSceneFromProjectDir(config);
27
+ if (options.inferTypes) {
28
+ scene.inferTypes();
29
+ }
30
+ const fileCount = scene.getFiles().length;
31
+ const printer = new PrinterBuilder_1.ScenePrinter(scene, options.output);
32
+ const rawFormat = (_a = options.format) !== null && _a !== void 0 ? _a : 'text';
33
+ let formatUsed = rawFormat;
34
+ switch (rawFormat) {
35
+ case 'json':
36
+ printer.dumpToJson();
37
+ break;
38
+ case 'dot':
39
+ printer.dumpToDot();
40
+ break;
41
+ case 'text':
42
+ default:
43
+ formatUsed = 'text';
44
+ printer.dumpToIR();
45
+ break;
46
+ }
47
+ return { output: options.output, fileCount, formatUsed };
48
+ }
49
+ exports.dumpProjectToReadableIR = dumpProjectToReadableIR;
50
+ /**
51
+ * Register IR export command.
52
+ *
53
+ * Usage:
54
+ * arkanalyzer ir <input> [options]
55
+ *
56
+ * Examples:
57
+ * arkanalyzer ir ./my_project -f text
58
+ * arkanalyzer ir ./my_project -f json -o ./out/ir
59
+ * arkanalyzer ir ./my_project -f dot --ohos-sdk-home /path/to/sdk
60
+ */
61
+ function register(program) {
62
+ program
63
+ .command('ir <input>')
64
+ .description('Export project IR-related artifacts')
65
+ .option('-o, --output <dir>', 'Output directory for generated artifacts', 'out')
66
+ .option('-f, --format <type>', 'Output format: json | text | dot', 'text')
67
+ .option('--ohos-sdk-home <path>', 'OHOS SDK home. Fallback to env OHOS_SDK_HOME')
68
+ .option('--no-infer-types', 'Skip Scene.inferTypes() for speed')
69
+ .action((input, opts) => {
70
+ var _a;
71
+ const requestedFormat = ((_a = opts.format) !== null && _a !== void 0 ? _a : 'json').toLowerCase();
72
+ if (!['json', 'text', 'dot'].includes(requestedFormat)) {
73
+ throw new ArkError_1.ArkAnalyzerError({
74
+ errCode: ArkError_1.ArkErrorCode.CLI_INVALID_OPTION,
75
+ errMsg: `Unsupported ir format: ${opts.format}. Expected one of: json, text, dot`,
76
+ });
77
+ }
78
+ const result = dumpProjectToReadableIR({
79
+ project: input,
80
+ output: opts.output,
81
+ format: requestedFormat,
82
+ inferTypes: opts.inferTypes !== false,
83
+ ohosSdkHome: opts.ohosSdkHome,
84
+ });
85
+ const output = {
86
+ input,
87
+ format: result.formatUsed,
88
+ outputDir: result.output,
89
+ fileCount: result.fileCount,
90
+ };
91
+ process.stdout.write(`${JSON.stringify(output)}\n`);
92
+ });
93
+ }
94
+ exports.register = register;
@@ -28,7 +28,7 @@ export declare class BooleanConstant extends Constant {
28
28
  private static readonly FALSE;
29
29
  private static readonly TRUE;
30
30
  constructor(value: boolean);
31
- static getInstance(value: boolean): NullConstant;
31
+ static getInstance(value: boolean): BooleanConstant;
32
32
  }
33
33
  export declare class NumberConstant extends Constant {
34
34
  constructor(value: string);
@@ -1 +1 @@
1
- {"version":3,"file":"Constant.d.ts","sourceRoot":"","sources":["../../../src/core/base/Constant.ts"],"names":[],"mappings":"AAeA,OAAO,EAA6D,IAAI,EAAiB,MAAM,QAAQ,CAAC;AACxG,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;GAEG;AACH,qBAAa,QAAS,YAAW,KAAK;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;gBAEhB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;IAKrC;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,KAAK,EAAE;IAIzB;;;OAGG;IACI,OAAO,IAAI,IAAI;IAItB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAS5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AQ;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAA8B;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAA6B;gBAE7C,KAAK,EAAE,OAAO;WAIZ,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe;CAG7D;AAED,qBAAa,cAAe,SAAQ,QAAQ;gBAC5B,KAAK,EAAE,MAAM;CAG5B;AAED,qBAAa,cAAe,SAAQ,QAAQ;gBAC5B,KAAK,EAAE,MAAM;CAG5B;AAED,qBAAa,cAAe,SAAQ,QAAQ;gBAC5B,KAAK,EAAE,MAAM;CAG5B;AAED,qBAAa,YAAa,SAAQ,QAAQ;IACtC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAsB;;WAMxC,WAAW,IAAI,YAAY;CAG5C;AAED,qBAAa,iBAAkB,SAAQ,QAAQ;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAA2B;;WAM7C,WAAW,IAAI,iBAAiB;CAGjD"}
@@ -77,7 +77,7 @@ class NumberConstant extends Constant {
77
77
  exports.NumberConstant = NumberConstant;
78
78
  class BigIntConstant extends Constant {
79
79
  constructor(value) {
80
- super(value.toString(), Type_1.BigIntType.getInstance());
80
+ super(value.toString() + 'n', Type_1.BigIntType.getInstance());
81
81
  }
82
82
  }
83
83
  exports.BigIntConstant = BigIntConstant;
@@ -74,6 +74,10 @@ export declare abstract class AbstractInvokeExpr extends AbstractExpr {
74
74
  setRealGenericTypes(realTypes: Type[] | undefined): void;
75
75
  getSpreadFlags(): boolean[] | undefined;
76
76
  getUses(): Value[];
77
+ /**
78
+ *Convert parameter list to string representation
79
+ *@ returns the formatted parameter string, including parentheses and parameter list
80
+ */
77
81
  protected argsToString(): string;
78
82
  }
79
83
  export declare class ArkInstanceInvokeExpr extends AbstractInvokeExpr {
@@ -87,7 +91,7 @@ export declare class ArkInstanceInvokeExpr extends AbstractInvokeExpr {
87
91
  setBase(newBase: Local): void;
88
92
  /**
89
93
  * Returns an **array** of values used in this invoke expression,
90
- * including all arguments and values each arguments used.
94
+ * including all arguments and values each argument used.
91
95
  * For {@link ArkInstanceInvokeExpr}, the return also contains the caller base and uses of base.
92
96
  * @returns An **array** of arguments used in the invoke expression.
93
97
  */
@@ -123,6 +127,11 @@ export declare class ArkPtrInvokeExpr extends AbstractInvokeExpr {
123
127
  constructor(methodSignature: MethodSignature, ptr: Local | AbstractFieldRef, args: Value[], realGenericTypes?: Type[], spreadFlags?: boolean[]);
124
128
  setFunPtrLocal(ptr: Local | AbstractFieldRef): void;
125
129
  getFuncPtrLocal(): Local | AbstractFieldRef;
130
+ /**
131
+ *Infer the type of function call expression
132
+ *@ param arkMethod - Ark method object currently analyzed
133
+ *@ returns The abstract calling expression after inference
134
+ */
126
135
  inferType(arkMethod: ArkMethod): AbstractInvokeExpr;
127
136
  toString(): string;
128
137
  getUses(): Value[];
@@ -134,6 +143,11 @@ export declare class ArkNewExpr extends AbstractExpr {
134
143
  getUses(): Value[];
135
144
  getType(): Type;
136
145
  toString(): string;
146
+ /**
147
+ *Inference type method
148
+ *@ param arkMethod - Ark method object, the context used for type inference
149
+ *@ returns the ArkNewExpr instance of the current object
150
+ */
137
151
  inferType(arkMethod: ArkMethod): ArkNewExpr;
138
152
  private constructorSignature;
139
153
  }
@@ -152,11 +166,16 @@ export declare class ArkNewArrayExpr extends AbstractExpr {
152
166
  getUses(): Value[];
153
167
  toString(): string;
154
168
  }
169
+ /**
170
+ * delete expression in TS/ArkTS/C++
171
+ * 1. TS/ArkTS: delete a.b
172
+ * 2. c++: delete a / delete a.b / delete a->b
173
+ */
155
174
  export declare class ArkDeleteExpr extends AbstractExpr {
156
175
  private field;
157
- constructor(field: AbstractFieldRef);
158
- getField(): AbstractFieldRef;
159
- setField(newField: AbstractFieldRef): void;
176
+ constructor(field: AbstractFieldRef | Value);
177
+ getField(): AbstractFieldRef | Value;
178
+ setField(newField: AbstractFieldRef | Value): void;
160
179
  getType(): Type;
161
180
  getUses(): Value[];
162
181
  toString(): string;
@@ -251,12 +270,15 @@ export declare abstract class AbstractBinopExpr extends AbstractExpr {
251
270
  protected inferOpType(op: Value, arkMethod: ArkMethod): void;
252
271
  private parseType;
253
272
  setType(): void;
273
+ setOperator(operator: BinaryOperator): void;
254
274
  inferType(arkMethod: ArkMethod): AbstractBinopExpr;
255
275
  }
256
276
  export declare class ArkConditionExpr extends AbstractBinopExpr {
257
277
  constructor(op1: Value, op2: Value, operator: RelationalBinaryOperator);
258
278
  inferType(arkMethod: ArkMethod): ArkConditionExpr;
259
279
  fillType(): void;
280
+ private isValueAssignWithLogicalNotExpr;
281
+ private isClassTypeUnionNullUndefined;
260
282
  }
261
283
  export declare class ArkNormalBinopExpr extends AbstractBinopExpr {
262
284
  constructor(op1: Value, op2: Value, operator: NormalBinaryOperator);
@@ -311,7 +333,9 @@ export declare class ArkPhiExpr extends AbstractExpr {
311
333
  export declare enum UnaryOperator {
312
334
  Neg = "-",
313
335
  BitwiseNot = "~",
314
- LogicalNot = "!"
336
+ LogicalNot = "!",
337
+ Addr = "&",
338
+ Deref = "*"
315
339
  }
316
340
  export declare class ArkUnopExpr extends AbstractExpr {
317
341
  private op;
@@ -1 +1 @@
1
- {"version":3,"file":"Expr.d.ts","sourceRoot":"","sources":["../../../src/core/base/Expr.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAGH,SAAS,EAGT,SAAS,EAMT,IAAI,EAKP,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAuD,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C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BAAsB,EAAE,kBAAkB,CAAC,EAAE,OAAO;IAQzE,iBAAiB,IAAI,sBAAsB;IAI3C,iBAAiB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAIvD,qBAAqB,IAAI,OAAO;IAIhC,mBAAmB,CAAC,gBAAgB,EAAE,IAAI,EAAE,GAAG,IAAI;IAInD,mBAAmB,IAAI,IAAI,EAAE,GAAG,SAAS;IAIzC,eAAe,IAAI,IAAI,GAAG,SAAS;IAInC,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIjC,OAAO,IAAI,IAAI;IA0Cf,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY;IAIpD;;;OAGG;IACI,OAAO,IAAI,KAAK,EAAE;IAOlB,QAAQ,IAAI,MAAM;WAoCX,wBAAwB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,sBAAsB;CAUxF"}
@@ -27,6 +27,19 @@ const ArkImport_1 = require("../model/ArkImport");
27
27
  const ArkClass_1 = require("../model/ArkClass");
28
28
  const ArkField_1 = require("../model/ArkField");
29
29
  const ModelUtils_1 = require("../common/ModelUtils");
30
+ const Type_2 = require("../../frontend/cppFrontend/base/Type");
31
+ const const_1 = require("../../frontend/cppFrontend/ast/const");
32
+ const Stmt_1 = require("./Stmt");
33
+ const CXX_SOURCE_EXTENSION_SET = (0, const_1.getCxxSourceFileExtensionSet)();
34
+ function isCxxLikeFileName(fileName) {
35
+ const normalized = fileName.toLowerCase();
36
+ for (const extension of CXX_SOURCE_EXTENSION_SET) {
37
+ if (normalized.endsWith(extension)) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
30
43
  /**
31
44
  * @category core/base/expr
32
45
  */
@@ -102,8 +115,7 @@ class AbstractInvokeExpr extends AbstractExpr {
102
115
  }
103
116
  getType() {
104
117
  const type = this.methodSignature.getType();
105
- if (TypeInference_1.TypeInference.checkType(type, t => t instanceof Type_1.GenericType || t instanceof Type_1.AnyType) &&
106
- this.realGenericTypes) {
118
+ if (TypeInference_1.TypeInference.checkType(type, t => t instanceof Type_1.GenericType || t instanceof Type_1.AnyType) && this.realGenericTypes) {
107
119
  return TypeInference_1.TypeInference.replaceTypeWithReal(type, this.realGenericTypes);
108
120
  }
109
121
  return type;
@@ -127,6 +139,10 @@ class AbstractInvokeExpr extends AbstractExpr {
127
139
  }
128
140
  return uses;
129
141
  }
142
+ /**
143
+ *Convert parameter list to string representation
144
+ *@ returns the formatted parameter string, including parentheses and parameter list
145
+ */
130
146
  argsToString() {
131
147
  const strs = [];
132
148
  strs.push('(');
@@ -162,7 +178,7 @@ class ArkInstanceInvokeExpr extends AbstractInvokeExpr {
162
178
  }
163
179
  /**
164
180
  * Returns an **array** of values used in this invoke expression,
165
- * including all arguments and values each arguments used.
181
+ * including all arguments and values each argument used.
166
182
  * For {@link ArkInstanceInvokeExpr}, the return also contains the caller base and uses of base.
167
183
  * @returns An **array** of arguments used in the invoke expression.
168
184
  */
@@ -237,18 +253,51 @@ class ArkPtrInvokeExpr extends AbstractInvokeExpr {
237
253
  getFuncPtrLocal() {
238
254
  return this.funPtr;
239
255
  }
256
+ /**
257
+ *Infer the type of function call expression
258
+ *@ param arkMethod - Ark method object currently analyzed
259
+ *@ returns The abstract calling expression after inference
260
+ */
240
261
  inferType(arkMethod) {
241
262
  this.getArgs().forEach(arg => TypeInference_1.TypeInference.inferValueType(arg, arkMethod));
242
- const ptrType = this.funPtr.getType();
243
- if (ptrType instanceof Type_1.FunctionType) {
244
- this.setMethodSignature(ptrType.getMethodSignature());
263
+ // CXX: If it is a Cxx function pointer, it is necessary to obtain its baseType to get method signature.
264
+ let typeWithoutPtr = this.funPtr.getType();
265
+ if (typeWithoutPtr instanceof Type_2.PointerType) {
266
+ typeWithoutPtr = typeWithoutPtr.getBaseType();
267
+ }
268
+ if (typeWithoutPtr instanceof Type_1.FunctionType) {
269
+ this.setMethodSignature(typeWithoutPtr.getMethodSignature());
245
270
  }
246
271
  IRInference_1.IRInference.inferArgs(this, arkMethod);
247
272
  return IRInference_1.IRInference.inferStaticInvokeExpr(this, arkMethod);
248
273
  }
249
274
  toString() {
275
+ var _a, _b, _c, _d;
250
276
  let strs = [];
251
277
  strs.push('ptrinvoke ');
278
+ let sig = this.getMethodSignature();
279
+ const sigFileName = sig.getDeclaringClassSignature().getDeclaringFileSignature().getFileName();
280
+ if (sigFileName === Const_1.UNKNOWN_FILE_NAME) {
281
+ let ptrType = this.funPtr.getType();
282
+ if (ptrType instanceof Type_2.PointerType) {
283
+ ptrType = ptrType.getBaseType();
284
+ }
285
+ if (ptrType instanceof Type_1.FunctionType) {
286
+ const ptrSig = ptrType.getMethodSignature();
287
+ const ptrFileName = ptrSig.getDeclaringClassSignature().getDeclaringFileSignature().getFileName().toLowerCase();
288
+ const isCxxPtrSig = isCxxLikeFileName(ptrFileName);
289
+ if (isCxxPtrSig) {
290
+ sig = ptrSig;
291
+ }
292
+ }
293
+ }
294
+ const fileName = sig.getDeclaringClassSignature().getDeclaringFileSignature().getFileName().toLowerCase();
295
+ const isCxxFile = isCxxLikeFileName(fileName);
296
+ const ptrDeclFileName = this.funPtr instanceof Local_1.Local ?
297
+ (_d = (_c = (_b = (_a = this.funPtr.getDeclaringStmt()) === null || _a === void 0 ? void 0 : _a.getCfg()) === null || _b === void 0 ? void 0 : _b.getDeclaringMethod()) === null || _c === void 0 ? void 0 : _c.getDeclaringArkFile().getName().toLowerCase()) !== null && _d !== void 0 ? _d : '' :
298
+ '';
299
+ const isCxxPtrDecl = isCxxLikeFileName(ptrDeclFileName);
300
+ const isUnknownCxxLike = sigFileName === Const_1.UNKNOWN_FILE_NAME && isCxxPtrDecl;
252
301
  let ptrName = '';
253
302
  if (this.funPtr instanceof Local_1.Local) {
254
303
  ptrName = this.funPtr.getName();
@@ -259,9 +308,19 @@ class ArkPtrInvokeExpr extends AbstractInvokeExpr {
259
308
  else if (this.funPtr instanceof Ref_1.ArkStaticFieldRef) {
260
309
  ptrName = this.funPtr.getFieldName();
261
310
  }
262
- strs.push(ptrName);
311
+ if (!isCxxFile && !isUnknownCxxLike) {
312
+ strs.push(ptrName);
313
+ }
263
314
  strs.push('<');
264
- strs.push(this.getMethodSignature().toString());
315
+ // C++ function-pointer calls should render the dynamic callee variable/member name (ptrName),
316
+ // because the static method signature name is often generic or unknown at this point.
317
+ // TS/ArkTS keeps the declared signature name directly and does not need this pointer-name rewrite.
318
+ if ((isCxxFile || isUnknownCxxLike) && ptrName) {
319
+ strs.push(sig.toString().replace(/\.([^.()]+)\(/, `.${ptrName}(`));
320
+ }
321
+ else {
322
+ strs.push(sig.toString());
323
+ }
265
324
  strs.push('>');
266
325
  strs.push(super.argsToString());
267
326
  return strs.join('');
@@ -294,6 +353,11 @@ class ArkNewExpr extends AbstractExpr {
294
353
  toString() {
295
354
  return 'new ' + this.classType;
296
355
  }
356
+ /**
357
+ *Inference type method
358
+ *@ param arkMethod - Ark method object, the context used for type inference
359
+ *@ returns the ArkNewExpr instance of the current object
360
+ */
297
361
  inferType(arkMethod) {
298
362
  var _a, _b;
299
363
  const classSignature = this.classType.getClassSignature();
@@ -303,6 +367,7 @@ class ArkNewExpr extends AbstractExpr {
303
367
  if (TypeInference_1.TypeInference.isUnclearType(type)) {
304
368
  type = TypeInference_1.TypeInference.inferUnclearRefName(className, arkMethod.getDeclaringArkClass());
305
369
  }
370
+ // If the type is an alias type, replace with the original type
306
371
  if (type instanceof Type_1.AliasType) {
307
372
  const originalType = TypeInference_1.TypeInference.replaceAliasType(type);
308
373
  if (originalType instanceof Type_1.FunctionType) {
@@ -376,6 +441,11 @@ class ArkNewArrayExpr extends AbstractExpr {
376
441
  }
377
442
  }
378
443
  exports.ArkNewArrayExpr = ArkNewArrayExpr;
444
+ /**
445
+ * delete expression in TS/ArkTS/C++
446
+ * 1. TS/ArkTS: delete a.b
447
+ * 2. c++: delete a / delete a.b / delete a->b
448
+ */
379
449
  class ArkDeleteExpr extends AbstractExpr {
380
450
  constructor(field) {
381
451
  super();
@@ -500,7 +570,7 @@ var RelationalBinaryOperator;
500
570
  RelationalBinaryOperator["StrictInequality"] = "!==";
501
571
  RelationalBinaryOperator["isPropertyOf"] = "in";
502
572
  })(RelationalBinaryOperator = exports.RelationalBinaryOperator || (exports.RelationalBinaryOperator = {}));
503
- // 二元运算表达式
573
+ // Binary operation expression
504
574
  class AbstractBinopExpr extends AbstractExpr {
505
575
  constructor(op1, op2, operator) {
506
576
  super();
@@ -648,6 +718,9 @@ class AbstractBinopExpr extends AbstractExpr {
648
718
  }
649
719
  this.type = type;
650
720
  }
721
+ setOperator(operator) {
722
+ this.operator = operator;
723
+ }
651
724
  inferType(arkMethod) {
652
725
  this.inferOpType(this.op1, arkMethod);
653
726
  this.inferOpType(this.op2, arkMethod);
@@ -663,26 +736,72 @@ class ArkConditionExpr extends AbstractBinopExpr {
663
736
  inferType(arkMethod) {
664
737
  this.inferOpType(this.op1, arkMethod);
665
738
  const op1Type = this.op1.getType();
666
- if (this.operator === RelationalBinaryOperator.InEquality && this.op2 === ValueUtil_1.ValueUtil.getOrCreateNumberConst(0)) {
667
- if (op1Type instanceof Type_1.StringType) {
668
- this.op2 = ValueUtil_1.ValueUtil.createStringConst(ValueUtil_1.EMPTY_STRING);
669
- }
670
- else if (op1Type instanceof Type_1.BooleanType) {
671
- this.op2 = ValueUtil_1.ValueUtil.getBooleanConstant(false);
739
+ this.type = Type_1.BooleanType.getInstance();
740
+ if (this.operator !== RelationalBinaryOperator.InEquality || this.op2 !== ValueUtil_1.ValueUtil.getOrCreateNumberConst(0)) {
741
+ this.inferOpType(this.getOp2(), arkMethod);
742
+ return this;
743
+ }
744
+ if (op1Type instanceof Type_1.StringType) {
745
+ this.op2 = ValueUtil_1.ValueUtil.createStringConst(ValueUtil_1.EMPTY_STRING);
746
+ }
747
+ else if (op1Type instanceof Type_1.BooleanType) {
748
+ this.op2 = ValueUtil_1.ValueUtil.getBooleanConstant(false);
749
+ }
750
+ else if (op1Type instanceof Type_1.ClassType || op1Type instanceof Type_1.UnknownType || op1Type instanceof Type_1.UnclearReferenceType) {
751
+ const newOp1 = this.isValueAssignWithLogicalNotExpr(this.op1);
752
+ if (newOp1) {
753
+ this.op1 = newOp1;
754
+ this.operator = RelationalBinaryOperator.Equality;
672
755
  }
673
- else if (op1Type instanceof Type_1.ClassType) {
756
+ this.op2 = ValueUtil_1.ValueUtil.getUndefinedConst();
757
+ }
758
+ else if (op1Type instanceof Type_1.UnionType) {
759
+ if (this.isClassTypeUnionNullUndefined(op1Type)) {
760
+ const newOp1 = this.isValueAssignWithLogicalNotExpr(this.op1);
761
+ if (newOp1) {
762
+ this.op1 = newOp1;
763
+ this.operator = RelationalBinaryOperator.Equality;
764
+ }
674
765
  this.op2 = ValueUtil_1.ValueUtil.getUndefinedConst();
675
766
  }
676
767
  }
677
- else {
678
- this.inferOpType(this.getOp2(), arkMethod);
679
- }
680
- this.type = Type_1.BooleanType.getInstance();
681
768
  return this;
682
769
  }
683
770
  fillType() {
684
771
  this.type = Type_1.BooleanType.getInstance();
685
772
  }
773
+ isValueAssignWithLogicalNotExpr(op) {
774
+ if (!(op instanceof Local_1.Local)) {
775
+ return null;
776
+ }
777
+ const declaringStmt = op.getDeclaringStmt();
778
+ if (!declaringStmt || !(declaringStmt instanceof Stmt_1.ArkAssignStmt)) {
779
+ return null;
780
+ }
781
+ const rightOp = declaringStmt.getRightOp();
782
+ if (rightOp instanceof ArkUnopExpr && rightOp.getOperator() === UnaryOperator.LogicalNot) {
783
+ return rightOp.getOp();
784
+ }
785
+ return null;
786
+ }
787
+ isClassTypeUnionNullUndefined(unionType) {
788
+ const types = unionType.getTypes();
789
+ let findClassType = false;
790
+ for (const t of types) {
791
+ if (t instanceof Type_1.NullType || t instanceof Type_1.UndefinedType) {
792
+ continue;
793
+ }
794
+ if (t instanceof Type_1.ClassType) {
795
+ if (findClassType) {
796
+ return false;
797
+ }
798
+ findClassType = true;
799
+ continue;
800
+ }
801
+ return false;
802
+ }
803
+ return findClassType;
804
+ }
686
805
  }
687
806
  exports.ArkConditionExpr = ArkConditionExpr;
688
807
  class ArkNormalBinopExpr extends AbstractBinopExpr {
@@ -764,7 +883,7 @@ class ArkInstanceOfExpr extends AbstractExpr {
764
883
  }
765
884
  }
766
885
  exports.ArkInstanceOfExpr = ArkInstanceOfExpr;
767
- // 类型转换
886
+ // Type conversion
768
887
  class ArkCastExpr extends AbstractExpr {
769
888
  constructor(op, type) {
770
889
  super();
@@ -851,6 +970,9 @@ var UnaryOperator;
851
970
  UnaryOperator["Neg"] = "-";
852
971
  UnaryOperator["BitwiseNot"] = "~";
853
972
  UnaryOperator["LogicalNot"] = "!";
973
+ // The following are C++ specific unary operator.
974
+ UnaryOperator["Addr"] = "&";
975
+ UnaryOperator["Deref"] = "*";
854
976
  })(UnaryOperator = exports.UnaryOperator || (exports.UnaryOperator = {}));
855
977
  // unary operation expression
856
978
  class ArkUnopExpr extends AbstractExpr {
@@ -997,7 +1119,7 @@ class AliasTypeExpr extends AbstractExpr {
997
1119
  return `${typeOf}${typeObject.getSignature().toString()}<${this.getRealGenericTypes().join(',')}>`;
998
1120
  }
999
1121
  if (typeObject instanceof Type_1.Type) {
1000
- return `${typeOf}${typeObject.getTypeString()}`;
1122
+ return `${typeOf}${typeObject.toString()}`;
1001
1123
  }
1002
1124
  if (typeObject instanceof ArkImport_1.ImportInfo) {
1003
1125
  let res = `${typeOf}import('${typeObject.getFrom()}')`;
@@ -1,4 +1,5 @@
1
1
  import ts from 'ohos-typescript';
2
+ import { CxxAstNode } from '../../frontend/cppFrontend/ast/ArkCxxAstNode';
2
3
  export type LineCol = number;
3
4
  export declare function setLine(lineCol: LineCol, lineNo: number): LineCol;
4
5
  export declare function setCol(lineCol: LineCol, colNo: number): LineCol;
@@ -15,6 +16,12 @@ export declare class LineColPosition {
15
16
  getLineNo(): number;
16
17
  getColNo(): number;
17
18
  static buildFromNode(node: ts.Node, sourceFile: ts.SourceFile): LineColPosition;
19
+ /**
20
+ * Builds a LineColPosition object from a CxxAstNode.
21
+ * @param node - The C++ AST node.
22
+ * @returns A LineColPosition object containing the line and character information. Default LineColPosition is (0, 0).
23
+ */
24
+ static cxxBuildFromNode(node: CxxAstNode): LineColPosition;
18
25
  }
19
26
  export declare class FullPosition {
20
27
  private readonly first;
@@ -26,6 +33,13 @@ export declare class FullPosition {
26
33
  getFirstCol(): number;
27
34
  getLastCol(): number;
28
35
  static buildFromNode(node: ts.Node, sourceFile: ts.SourceFile): FullPosition;
36
+ /**
37
+ *Building a FullPosition object from a C++AST node
38
+ *@ param node C++AST node, possibly undefined
39
+ *@ param_sourceFile source file node (not used)
40
+ *@ returns The FullPosition object containing location information
41
+ */
42
+ static cxxBuildFromNode(node: CxxAstNode | undefined, _sourceFile: CxxAstNode): FullPosition;
29
43
  static merge(leftMostPosition: FullPosition, rightMostPosition: FullPosition): FullPosition;
30
44
  }
31
45
  //# sourceMappingURL=Position.d.ts.map