arkanalyzer 1.0.86 → 1.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +69 -65
- package/README.md +56 -70
- package/config/arkanalyzer.json +7 -2
- package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
- package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
- package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
- package/docs/cppFrontend/img.png +0 -0
- package/docs/cppFrontend/img_1.png +0 -0
- package/docs/cppFrontend/img_10.png +0 -0
- package/docs/cppFrontend/img_11.png +0 -0
- package/docs/cppFrontend/img_12.png +0 -0
- package/docs/cppFrontend/img_13.png +0 -0
- package/docs/cppFrontend/img_14.png +0 -0
- package/docs/cppFrontend/img_15.png +0 -0
- package/docs/cppFrontend/img_16.png +0 -0
- package/docs/cppFrontend/img_17.png +0 -0
- package/docs/cppFrontend/img_18.png +0 -0
- package/docs/cppFrontend/img_19.png +0 -0
- package/docs/cppFrontend/img_2.png +0 -0
- package/docs/cppFrontend/img_20.png +0 -0
- package/docs/cppFrontend/img_21.png +0 -0
- package/docs/cppFrontend/img_22.png +0 -0
- package/docs/cppFrontend/img_23.png +0 -0
- package/docs/cppFrontend/img_3.png +0 -0
- package/docs/cppFrontend/img_4.png +0 -0
- package/docs/cppFrontend/img_5.png +0 -0
- package/docs/cppFrontend/img_6.png +0 -0
- package/docs/cppFrontend/img_7.png +0 -0
- package/docs/cppFrontend/img_8.png +0 -0
- package/docs/cppFrontend/img_9.png +0 -0
- package/docs/sig_programanalysis.en.md +66 -0
- package/docs/sig_programanalysis.md +73 -0
- package/lib/Config.d.ts +35 -1
- package/lib/Config.d.ts.map +1 -1
- package/lib/Config.js +91 -2
- package/lib/Scene.d.ts +25 -2
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +151 -44
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
- package/lib/callgraph/common/Statistics.d.ts +4 -2
- package/lib/callgraph/common/Statistics.d.ts.map +1 -1
- package/lib/callgraph/common/Statistics.js +14 -2
- package/lib/callgraph/model/CallGraph.d.ts +12 -8
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +53 -29
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
- package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
- package/lib/cli/cli.d.ts +3 -0
- package/lib/cli/cli.d.ts.map +1 -0
- package/lib/cli/cli.js +82 -0
- package/lib/cli/commands/cg.d.ts +53 -0
- package/lib/cli/commands/cg.d.ts.map +1 -0
- package/lib/cli/commands/cg.js +404 -0
- package/lib/cli/commands/index.d.ts +6 -0
- package/lib/cli/commands/index.d.ts.map +1 -0
- package/lib/cli/commands/index.js +64 -0
- package/lib/cli/commands/ir.d.ts +26 -0
- package/lib/cli/commands/ir.d.ts.map +1 -0
- package/lib/cli/commands/ir.js +94 -0
- package/lib/core/base/Constant.d.ts +1 -1
- package/lib/core/base/Constant.d.ts.map +1 -1
- package/lib/core/base/Constant.js +1 -1
- package/lib/core/base/Expr.d.ts +29 -5
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +145 -23
- package/lib/core/base/Position.d.ts +14 -0
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +27 -0
- package/lib/core/base/Ref.d.ts +1 -0
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +4 -1
- package/lib/core/base/Type.d.ts +64 -24
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +144 -49
- package/lib/core/common/ArkError.d.ts +26 -2
- package/lib/core/common/ArkError.d.ts.map +1 -1
- package/lib/core/common/ArkError.js +56 -2
- package/lib/core/common/ArkIRTransformer.d.ts +11 -10
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +1 -1
- package/lib/core/common/ArkValueTransformer.d.ts +14 -12
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +1 -5
- package/lib/core/common/Const.d.ts +4 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +5 -1
- package/lib/core/common/DummyMainCreater.d.ts +23 -13
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +66 -43
- package/lib/core/common/EtsConst.d.ts +11 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +12 -1
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +6 -2
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +3 -33
- package/lib/core/common/ModelUtils.d.ts +4 -7
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +77 -110
- package/lib/core/common/SdkUtils.d.ts +1 -1
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +14 -5
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +9 -3
- package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseExplicitGraph.js +15 -8
- package/lib/core/graph/BasicBlock.d.ts.map +1 -1
- package/lib/core/graph/Scc.d.ts.map +1 -1
- package/lib/core/graph/Scc.js +7 -2
- package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +12 -5
- package/lib/core/inference/Inference.d.ts.map +1 -1
- package/lib/core/inference/Inference.js +7 -0
- package/lib/core/inference/ModelInference.d.ts +1 -1
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.d.ts +3 -2
- package/lib/core/inference/ValueInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.js +64 -12
- package/lib/core/inference/abc/AbcInference.d.ts +28 -2
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +105 -4
- package/lib/core/model/ArkBaseModel.d.ts +14 -1
- package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
- package/lib/core/model/ArkBaseModel.js +61 -2
- package/lib/core/model/ArkBody.d.ts.map +1 -1
- package/lib/core/model/ArkBody.js +1 -3
- package/lib/core/model/ArkClass.d.ts +25 -2
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +72 -30
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +3 -1
- package/lib/core/model/ArkFile.d.ts +4 -1
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +44 -3
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +9 -1
- package/lib/core/model/ArkMetadata.d.ts +32 -1
- package/lib/core/model/ArkMetadata.d.ts.map +1 -1
- package/lib/core/model/ArkMetadata.js +28 -2
- package/lib/core/model/ArkMethod.d.ts +5 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +33 -1
- package/lib/core/model/ArkNamespace.d.ts +2 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +11 -0
- package/lib/core/model/ArkSignature.d.ts +3 -3
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +14 -9
- package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +3 -3
- package/lib/core/model/builder/ArkMetadataBuilder.d.ts +21 -0
- package/lib/core/model/builder/ArkMetadataBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkMetadataBuilder.js +160 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +50 -29
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
- package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.d.ts +1 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +7 -3
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts +8 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.js +90 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts +8 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.js +183 -0
- package/lib/frontend/cppFrontend/ast/astParser.d.ts +25 -0
- package/lib/frontend/cppFrontend/ast/astParser.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astParser.js +280 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts +18 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astUtils.js +158 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts +17 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/const.js +58 -0
- package/lib/frontend/cppFrontend/ast/index.d.ts +5 -0
- package/lib/frontend/cppFrontend/ast/index.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/index.js +31 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Constant.js +33 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Expr.js +530 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Ref.js +53 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Trap.js +28 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Type.js +600 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +284 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -1
- package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
- package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
- package/lib/save/CGJsonPrinter.d.ts +8 -0
- package/lib/save/CGJsonPrinter.d.ts.map +1 -0
- package/lib/save/CGJsonPrinter.js +41 -0
- package/lib/save/GraphPrinter.js +2 -2
- package/lib/save/json/JsonDto.d.ts +86 -2
- package/lib/save/json/JsonDto.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.d.ts +1 -1
- package/lib/save/json/JsonSerialization.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.js +235 -145
- package/lib/save/source/SourceStmt.d.ts.map +1 -1
- package/lib/save/source/SourceStmt.js +3 -1
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +0 -3
- package/lib/utils/CxxSceneUtils.d.ts +11 -0
- package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
- package/lib/utils/CxxSceneUtils.js +178 -0
- package/lib/utils/FileUtils.d.ts +8 -8
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +35 -45
- package/lib/utils/LRUCacheDecorator.d.ts +20 -0
- package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
- package/lib/utils/LRUCacheDecorator.js +89 -0
- package/lib/utils/ModuleUtils.d.ts +39 -0
- package/lib/utils/ModuleUtils.d.ts.map +1 -0
- package/lib/utils/ModuleUtils.js +261 -0
- package/package.json +13 -7
- /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.serializeStmt = exports.serializeValue = exports.serializeConstant = exports.serializeLocal = exports.serializeBasicBlock = exports.serializeCfg = exports.serializeAliasTypeSignature = exports.serializeMethodSignature = exports.serializeFieldSignature = exports.serializeClassSignature = exports.serializeNamespaceSignature = exports.serializeFileSignature = exports.
|
|
17
|
+
exports.serializeStmt = exports.serializeValue = exports.serializeConstant = exports.serializeType = exports.serializeLocal = exports.serializeBasicBlock = exports.serializeCfg = exports.serializeAliasTypeSignature = exports.serializeMethodSignature = exports.serializeFieldSignature = exports.serializeClassSignature = exports.serializeNamespaceSignature = exports.serializeFileSignature = exports.serializeLineColPosition = exports.serializeDecorator = exports.serializeExportInfo = exports.serializeImportInfo = exports.serializeMethodParameter = exports.serializeMethodBody = exports.serializeMethod = exports.serializeField = exports.serializeClass = exports.serializeNamespace = exports.serializeArkFile = exports.serializeArkScene = void 0;
|
|
18
18
|
const __1 = require("../..");
|
|
19
19
|
const JsonDto_1 = require("./JsonDto");
|
|
20
|
+
const Expr_1 = require("../../frontend/cppFrontend/base/Expr");
|
|
21
|
+
const Type_1 = require("../../frontend/cppFrontend/base/Type");
|
|
20
22
|
function serializeArkScene(scene) {
|
|
21
23
|
return {
|
|
22
24
|
files: scene.getFiles().map(f => serializeArkFile(f)),
|
|
@@ -128,150 +130,6 @@ function serializeLineColPosition(position) {
|
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
exports.serializeLineColPosition = serializeLineColPosition;
|
|
131
|
-
function serializeType(type) {
|
|
132
|
-
var _a, _b, _c;
|
|
133
|
-
if (type === undefined) {
|
|
134
|
-
throw new Error('Type is undefined');
|
|
135
|
-
}
|
|
136
|
-
if (type instanceof __1.AnyType) {
|
|
137
|
-
return (0, JsonDto_1.polymorphic)('AnyType', {});
|
|
138
|
-
}
|
|
139
|
-
else if (type instanceof __1.UnknownType) {
|
|
140
|
-
return (0, JsonDto_1.polymorphic)('UnknownType', {});
|
|
141
|
-
}
|
|
142
|
-
else if (type instanceof __1.VoidType) {
|
|
143
|
-
return (0, JsonDto_1.polymorphic)('VoidType', {});
|
|
144
|
-
}
|
|
145
|
-
else if (type instanceof __1.NeverType) {
|
|
146
|
-
return (0, JsonDto_1.polymorphic)('NeverType', {});
|
|
147
|
-
}
|
|
148
|
-
else if (type instanceof __1.UnionType) {
|
|
149
|
-
return (0, JsonDto_1.polymorphic)('UnionType', {
|
|
150
|
-
types: type.getTypes().map(type => serializeType(type)),
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
else if (type instanceof __1.IntersectionType) {
|
|
154
|
-
return (0, JsonDto_1.polymorphic)('IntersectionType', {
|
|
155
|
-
types: type.getTypes().map(type => serializeType(type)),
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
else if (type instanceof __1.TupleType) {
|
|
159
|
-
return (0, JsonDto_1.polymorphic)('TupleType', {
|
|
160
|
-
types: type.getTypes().map(type => serializeType(type)),
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
else if (type instanceof __1.BooleanType) {
|
|
164
|
-
return (0, JsonDto_1.polymorphic)('BooleanType', {});
|
|
165
|
-
}
|
|
166
|
-
else if (type instanceof __1.NumberType) {
|
|
167
|
-
return (0, JsonDto_1.polymorphic)('NumberType', {});
|
|
168
|
-
}
|
|
169
|
-
else if (type instanceof __1.BigIntType) {
|
|
170
|
-
return (0, JsonDto_1.polymorphic)('BigIntType', {});
|
|
171
|
-
}
|
|
172
|
-
else if (type instanceof __1.StringType) {
|
|
173
|
-
return (0, JsonDto_1.polymorphic)('StringType', {});
|
|
174
|
-
}
|
|
175
|
-
else if (type instanceof __1.NullType) {
|
|
176
|
-
return (0, JsonDto_1.polymorphic)('NullType', {});
|
|
177
|
-
}
|
|
178
|
-
else if (type instanceof __1.UndefinedType) {
|
|
179
|
-
return (0, JsonDto_1.polymorphic)('UndefinedType', {});
|
|
180
|
-
}
|
|
181
|
-
else if (type instanceof __1.LiteralType) {
|
|
182
|
-
return (0, JsonDto_1.polymorphic)('LiteralType', {
|
|
183
|
-
literal: type.getLiteralName(),
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
else if (type instanceof __1.ClassType) {
|
|
187
|
-
return (0, JsonDto_1.polymorphic)('ClassType', {
|
|
188
|
-
signature: serializeClassSignature(type.getClassSignature()),
|
|
189
|
-
typeParameters: (_a = type.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.map(type => serializeType(type)),
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
else if (type instanceof __1.FunctionType) {
|
|
193
|
-
if (type.getMethodSignature().getMethodSubSignature().getReturnType() === type) {
|
|
194
|
-
// Handle recursive function types.
|
|
195
|
-
// This is a workaround for the issue where the function type refers to itself,
|
|
196
|
-
// which can cause infinite recursion during serialization.
|
|
197
|
-
// In this case, we return a simple FunctionType without a signature.
|
|
198
|
-
console.warn('Detected recursive function type, replacing return type with UnknownType');
|
|
199
|
-
const sig = type.getMethodSignature();
|
|
200
|
-
const sub = sig.getMethodSubSignature();
|
|
201
|
-
const sig2 = new __1.MethodSignature(sig.getDeclaringClassSignature(), new __1.MethodSubSignature(sub.getMethodName(), sub.getParameters(), __1.UnknownType.getInstance(), sub.isStatic()));
|
|
202
|
-
return (0, JsonDto_1.polymorphic)('FunctionType', {
|
|
203
|
-
signature: serializeMethodSignature(sig2),
|
|
204
|
-
typeParameters: (_b = type.getRealGenericTypes()) === null || _b === void 0 ? void 0 : _b.map(type => serializeType(type)),
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
return (0, JsonDto_1.polymorphic)('FunctionType', {
|
|
208
|
-
signature: serializeMethodSignature(type.getMethodSignature()),
|
|
209
|
-
typeParameters: (_c = type.getRealGenericTypes()) === null || _c === void 0 ? void 0 : _c.map(type => serializeType(type)),
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
else if (type instanceof __1.ArrayType) {
|
|
213
|
-
return (0, JsonDto_1.polymorphic)('ArrayType', {
|
|
214
|
-
elementType: serializeType(type.getBaseType()),
|
|
215
|
-
dimensions: type.getDimension(),
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
else if (type instanceof __1.UnclearReferenceType) {
|
|
219
|
-
return (0, JsonDto_1.polymorphic)('UnclearReferenceType', {
|
|
220
|
-
name: type.getName(),
|
|
221
|
-
typeParameters: type.getGenericTypes().map(type => serializeType(type)),
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
else if (type instanceof __1.AliasType) {
|
|
225
|
-
return (0, JsonDto_1.polymorphic)('AliasType', {
|
|
226
|
-
name: type.getName(),
|
|
227
|
-
originalType: serializeType(type.getOriginalType()),
|
|
228
|
-
signature: serializeAliasTypeSignature(type.getSignature()),
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
else if (type instanceof __1.GenericType) {
|
|
232
|
-
const constraint = type.getConstraint();
|
|
233
|
-
const defaultType = type.getDefaultType();
|
|
234
|
-
return (0, JsonDto_1.polymorphic)('GenericType', {
|
|
235
|
-
name: type.getName(),
|
|
236
|
-
constraint: constraint && serializeType(constraint),
|
|
237
|
-
defaultType: defaultType && serializeType(defaultType),
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
else if (type instanceof __1.AnnotationNamespaceType) {
|
|
241
|
-
return (0, JsonDto_1.polymorphic)('AnnotationNamespaceType', {
|
|
242
|
-
originType: type.getOriginType(),
|
|
243
|
-
namespaceSignature: serializeNamespaceSignature(type.getNamespaceSignature()),
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
else if (type instanceof __1.AnnotationTypeQueryType) {
|
|
247
|
-
return (0, JsonDto_1.polymorphic)('AnnotationTypeQueryType', {
|
|
248
|
-
originType: type.getOriginType(),
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
else if (type instanceof __1.LexicalEnvType) {
|
|
252
|
-
const m = type.getNestedMethod();
|
|
253
|
-
const s = m.getMethodSubSignature();
|
|
254
|
-
const sig = new __1.MethodSignature(m.getDeclaringClassSignature(), new __1.MethodSubSignature(s.getMethodName(), [], __1.UnknownType.getInstance()));
|
|
255
|
-
return (0, JsonDto_1.polymorphic)('LexicalEnvType', {
|
|
256
|
-
// method: serializeMethodSignature(type.getNestedMethod()),
|
|
257
|
-
method: serializeMethodSignature(sig),
|
|
258
|
-
closures: type.getClosures().map(closure => serializeLocal(closure)),
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
else if (type instanceof __1.EnumValueType) {
|
|
262
|
-
return (0, JsonDto_1.polymorphic)('EnumValueType', {
|
|
263
|
-
signature: serializeClassSignature(type.getFieldSignature().getDeclaringSignature()),
|
|
264
|
-
name: type.getFieldSignature().getFieldName(),
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
// Fallback for unhandled type cases
|
|
268
|
-
console.info(`Unhandled Type: ${type.constructor.name} (${type.toString()})`);
|
|
269
|
-
return {
|
|
270
|
-
kind: type.constructor.name,
|
|
271
|
-
text: type.toString(),
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
exports.serializeType = serializeType;
|
|
275
133
|
function serializeFileSignature(file) {
|
|
276
134
|
return {
|
|
277
135
|
projectName: file.getProjectName(),
|
|
@@ -363,6 +221,180 @@ function serializeLocal(local) {
|
|
|
363
221
|
};
|
|
364
222
|
}
|
|
365
223
|
exports.serializeLocal = serializeLocal;
|
|
224
|
+
function trySerializeCxxSignType(type) {
|
|
225
|
+
if (type instanceof Type_1.CxxIntType) {
|
|
226
|
+
return (0, JsonDto_1.polymorphic)('CxxIntType', { signType: type.getSignType().toString() });
|
|
227
|
+
}
|
|
228
|
+
if (type instanceof Type_1.CxxShortType) {
|
|
229
|
+
return (0, JsonDto_1.polymorphic)('CxxShortType', { signType: type.getSignType().toString() });
|
|
230
|
+
}
|
|
231
|
+
if (type instanceof Type_1.CxxLongType) {
|
|
232
|
+
return (0, JsonDto_1.polymorphic)('CxxLongType', { signType: type.getSignType().toString() });
|
|
233
|
+
}
|
|
234
|
+
if (type instanceof Type_1.CxxLongLongType) {
|
|
235
|
+
return (0, JsonDto_1.polymorphic)('CxxLongLongType', { signType: type.getSignType().toString() });
|
|
236
|
+
}
|
|
237
|
+
if (type instanceof Type_1.CxxSizeTType) {
|
|
238
|
+
return (0, JsonDto_1.polymorphic)('CxxSizeTType', { signType: type.getSignType().toString() });
|
|
239
|
+
}
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
function trySerializeCxxBitWidthType(type) {
|
|
243
|
+
if (type instanceof Type_1.CxxFloatType) {
|
|
244
|
+
return (0, JsonDto_1.polymorphic)('CxxFloatType', { bitWidth: type.getBitWith() });
|
|
245
|
+
}
|
|
246
|
+
if (type instanceof Type_1.CxxDoubleType) {
|
|
247
|
+
return (0, JsonDto_1.polymorphic)('CxxDoubleType', { bitWidth: type.getBitWith() });
|
|
248
|
+
}
|
|
249
|
+
if (type instanceof Type_1.CxxLongDoubleType) {
|
|
250
|
+
return (0, JsonDto_1.polymorphic)('CxxLongDoubleType', { bitWidth: type.getBitWith() });
|
|
251
|
+
}
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
function serializeFunctionTypeDto(type, active) {
|
|
255
|
+
var _a, _b;
|
|
256
|
+
if (type.getMethodSignature().getMethodSubSignature().getReturnType() === type) {
|
|
257
|
+
// Recursive function type: avoid infinite recursion by stubbing return type.
|
|
258
|
+
console.warn('Detected recursive function type, replacing return type with UnknownType');
|
|
259
|
+
const sig = type.getMethodSignature();
|
|
260
|
+
const sub = sig.getMethodSubSignature();
|
|
261
|
+
const sig2 = new __1.MethodSignature(sig.getDeclaringClassSignature(), new __1.MethodSubSignature(sub.getMethodName(), sub.getParameters(), __1.UnknownType.getInstance(), sub.isStatic()));
|
|
262
|
+
return (0, JsonDto_1.polymorphic)('FunctionType', {
|
|
263
|
+
signature: serializeMethodSignature(sig2),
|
|
264
|
+
typeParameters: (_a = type.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.map(t => serializeType(t, active)),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
return (0, JsonDto_1.polymorphic)('FunctionType', {
|
|
268
|
+
signature: serializeMethodSignature(type.getMethodSignature()),
|
|
269
|
+
typeParameters: (_b = type.getRealGenericTypes()) === null || _b === void 0 ? void 0 : _b.map(t => serializeType(t, active)),
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
const TYPE_SERIALIZERS = [
|
|
273
|
+
(type, active) => (type instanceof __1.AnyType ? (0, JsonDto_1.polymorphic)('AnyType', {}) : undefined),
|
|
274
|
+
(type, active) => (type instanceof __1.UnknownType ? (0, JsonDto_1.polymorphic)('UnknownType', {}) : undefined),
|
|
275
|
+
(type, active) => (type instanceof __1.VoidType ? (0, JsonDto_1.polymorphic)('VoidType', {}) : undefined),
|
|
276
|
+
(type, active) => (type instanceof __1.NeverType ? (0, JsonDto_1.polymorphic)('NeverType', {}) : undefined),
|
|
277
|
+
(type, active) => type instanceof __1.UnionType
|
|
278
|
+
? (0, JsonDto_1.polymorphic)('UnionType', { types: type.getTypes().map(t => serializeType(t, active)) })
|
|
279
|
+
: undefined,
|
|
280
|
+
(type, active) => type instanceof __1.IntersectionType
|
|
281
|
+
? (0, JsonDto_1.polymorphic)('IntersectionType', { types: type.getTypes().map(t => serializeType(t, active)) })
|
|
282
|
+
: undefined,
|
|
283
|
+
(type, active) => type instanceof __1.TupleType
|
|
284
|
+
? (0, JsonDto_1.polymorphic)('TupleType', { types: type.getTypes().map(t => serializeType(t, active)) })
|
|
285
|
+
: undefined,
|
|
286
|
+
(type, active) => trySerializeCxxSignType(type),
|
|
287
|
+
(type, active) => trySerializeCxxBitWidthType(type),
|
|
288
|
+
(type, active) => (type instanceof Type_1.CxxCharType ? (0, JsonDto_1.polymorphic)('CxxCharType', { text: type.toString() }) : undefined),
|
|
289
|
+
(type, active) => (type instanceof Type_1.CxxWcharType ? (0, JsonDto_1.polymorphic)('CxxWcharType', { text: type.toString() }) : undefined),
|
|
290
|
+
(type, active) => type instanceof Type_1.PointerType
|
|
291
|
+
? (0, JsonDto_1.polymorphic)('PointerType', { baseType: serializeType(type.getBaseType(), active) })
|
|
292
|
+
: undefined,
|
|
293
|
+
(type, active) => type instanceof Type_1.SmartPointerType
|
|
294
|
+
? (0, JsonDto_1.polymorphic)('SmartPointerType', { baseType: serializeType(type.getBaseType(), active) })
|
|
295
|
+
: undefined,
|
|
296
|
+
(type, active) => type instanceof Type_1.ReferenceType
|
|
297
|
+
? (0, JsonDto_1.polymorphic)('ReferenceType', { baseType: serializeType(type.getBaseType(), active) })
|
|
298
|
+
: undefined,
|
|
299
|
+
(type, active) => (type instanceof Type_1.Thread ? (0, JsonDto_1.polymorphic)('Thread', { text: type.toString() }) : undefined),
|
|
300
|
+
(type, active) => (type instanceof Type_1.TypeInfo ? (0, JsonDto_1.polymorphic)('TypeInfo', { name: type.toString() }) : undefined),
|
|
301
|
+
(type, active) => (type instanceof __1.BooleanType ? (0, JsonDto_1.polymorphic)('BooleanType', {}) : undefined),
|
|
302
|
+
(type, active) => (type instanceof __1.NumberType ? (0, JsonDto_1.polymorphic)('NumberType', {}) : undefined),
|
|
303
|
+
(type, active) => (type instanceof __1.BigIntType ? (0, JsonDto_1.polymorphic)('BigIntType', {}) : undefined),
|
|
304
|
+
(type, active) => (type instanceof __1.StringType ? (0, JsonDto_1.polymorphic)('StringType', {}) : undefined),
|
|
305
|
+
(type, active) => (type instanceof __1.NullType ? (0, JsonDto_1.polymorphic)('NullType', {}) : undefined),
|
|
306
|
+
(type, active) => (type instanceof __1.UndefinedType ? (0, JsonDto_1.polymorphic)('UndefinedType', {}) : undefined),
|
|
307
|
+
(type, active) => type instanceof __1.LiteralType ? (0, JsonDto_1.polymorphic)('LiteralType', { literal: type.getLiteralName() }) : undefined,
|
|
308
|
+
(type, active) => {
|
|
309
|
+
var _a;
|
|
310
|
+
return type instanceof __1.ClassType
|
|
311
|
+
? (0, JsonDto_1.polymorphic)('ClassType', {
|
|
312
|
+
signature: serializeClassSignature(type.getClassSignature()),
|
|
313
|
+
typeParameters: (_a = type.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.map(t => serializeType(t, active)),
|
|
314
|
+
})
|
|
315
|
+
: undefined;
|
|
316
|
+
},
|
|
317
|
+
(type, active) => (type instanceof __1.FunctionType ? serializeFunctionTypeDto(type, active) : undefined),
|
|
318
|
+
(type, active) => type instanceof __1.ArrayType
|
|
319
|
+
? (0, JsonDto_1.polymorphic)('ArrayType', {
|
|
320
|
+
elementType: serializeType(type.getBaseType(), active),
|
|
321
|
+
dimensions: type.getDimension(),
|
|
322
|
+
})
|
|
323
|
+
: undefined,
|
|
324
|
+
(type, active) => type instanceof __1.UnclearReferenceType
|
|
325
|
+
? (0, JsonDto_1.polymorphic)('UnclearReferenceType', {
|
|
326
|
+
name: type.getName(),
|
|
327
|
+
typeParameters: type.getGenericTypes().map(t => serializeType(t, active)),
|
|
328
|
+
})
|
|
329
|
+
: undefined,
|
|
330
|
+
(type, active) => type instanceof __1.AliasType
|
|
331
|
+
? (0, JsonDto_1.polymorphic)('AliasType', {
|
|
332
|
+
name: type.getName(),
|
|
333
|
+
originalType: serializeType(type.getOriginalType(), active),
|
|
334
|
+
signature: serializeAliasTypeSignature(type.getSignature()),
|
|
335
|
+
})
|
|
336
|
+
: undefined,
|
|
337
|
+
(type, active) => {
|
|
338
|
+
if (!(type instanceof __1.GenericType)) {
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
const constraint = type.getConstraint();
|
|
342
|
+
const defaultType = type.getDefaultType();
|
|
343
|
+
return (0, JsonDto_1.polymorphic)('GenericType', {
|
|
344
|
+
name: type.getName(),
|
|
345
|
+
constraint: constraint && serializeType(constraint, active),
|
|
346
|
+
defaultType: defaultType && serializeType(defaultType, active),
|
|
347
|
+
});
|
|
348
|
+
},
|
|
349
|
+
(type, active) => type instanceof __1.AnnotationNamespaceType
|
|
350
|
+
? (0, JsonDto_1.polymorphic)('AnnotationNamespaceType', {
|
|
351
|
+
originType: type.getOriginType(),
|
|
352
|
+
namespaceSignature: serializeNamespaceSignature(type.getNamespaceSignature()),
|
|
353
|
+
})
|
|
354
|
+
: undefined,
|
|
355
|
+
(type, active) => type instanceof __1.AnnotationTypeQueryType
|
|
356
|
+
? (0, JsonDto_1.polymorphic)('AnnotationTypeQueryType', { originType: type.getOriginType() })
|
|
357
|
+
: undefined,
|
|
358
|
+
(type, active) => {
|
|
359
|
+
if (!(type instanceof __1.LexicalEnvType)) {
|
|
360
|
+
return undefined;
|
|
361
|
+
}
|
|
362
|
+
const m = type.getNestedMethod();
|
|
363
|
+
const s = m.getMethodSubSignature();
|
|
364
|
+
const sig = new __1.MethodSignature(m.getDeclaringClassSignature(), new __1.MethodSubSignature(s.getMethodName(), [], __1.UnknownType.getInstance()));
|
|
365
|
+
return (0, JsonDto_1.polymorphic)('LexicalEnvType', {
|
|
366
|
+
method: serializeMethodSignature(sig),
|
|
367
|
+
closures: type.getClosures().map(closure => serializeLocal(closure)),
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
(type, active) => type instanceof __1.EnumValueType
|
|
371
|
+
? (0, JsonDto_1.polymorphic)('EnumValueType', {
|
|
372
|
+
signature: serializeClassSignature(type.getFieldSignature().getDeclaringSignature()),
|
|
373
|
+
name: type.getFieldSignature().getFieldName(),
|
|
374
|
+
})
|
|
375
|
+
: undefined,
|
|
376
|
+
];
|
|
377
|
+
function serializeType(type, activeTypeSerialization = new WeakSet()) {
|
|
378
|
+
if (type === undefined) {
|
|
379
|
+
throw new Error('Type is undefined');
|
|
380
|
+
}
|
|
381
|
+
if (activeTypeSerialization.has(type)) {
|
|
382
|
+
return (0, JsonDto_1.polymorphic)('UnknownType', {});
|
|
383
|
+
}
|
|
384
|
+
activeTypeSerialization.add(type);
|
|
385
|
+
for (const serialize of TYPE_SERIALIZERS) {
|
|
386
|
+
const dto = serialize(type, activeTypeSerialization);
|
|
387
|
+
if (dto !== undefined) {
|
|
388
|
+
return dto;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
console.info(`Unhandled Type: ${type.constructor.name} (${type.toString()})`);
|
|
392
|
+
return {
|
|
393
|
+
kind: type.constructor.name,
|
|
394
|
+
text: type.toString(),
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
exports.serializeType = serializeType;
|
|
366
398
|
function serializeConstant(constant) {
|
|
367
399
|
let value = constant.getValue();
|
|
368
400
|
if (constant.getType() instanceof __1.NumberType) {
|
|
@@ -525,6 +557,64 @@ function serializeValue(value) {
|
|
|
525
557
|
field: serializeFieldSignature(value.getFieldSignature()),
|
|
526
558
|
});
|
|
527
559
|
}
|
|
560
|
+
else if (value instanceof Expr_1.ArkCxxDeleteArrayExpr) {
|
|
561
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxDeleteArrayExpr', {
|
|
562
|
+
field: serializeValue(value.getField()),
|
|
563
|
+
type: serializeType(value.getType()),
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
else if (value instanceof Expr_1.ArkCxxNewArrayExpr) {
|
|
567
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxNewArrayExpr', {
|
|
568
|
+
baseType: serializeType(value.getBaseType()),
|
|
569
|
+
size: serializeValue(value.getSize()),
|
|
570
|
+
elementsNumber: value.getElementsNumber(),
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
else if (value instanceof Expr_1.ArkCxxInitArrayExpr) {
|
|
574
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxInitArrayExpr', {
|
|
575
|
+
op: serializeValue(value.getOp()),
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
else if (value instanceof Expr_1.ArkCxxUnaryExpr) {
|
|
579
|
+
let op = value.getOp();
|
|
580
|
+
if (op instanceof __1.Type) {
|
|
581
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxUnaryExpr', {
|
|
582
|
+
op: serializeType(op),
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxUnaryExpr', {
|
|
586
|
+
op: serializeValue(op),
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
else if (value instanceof Expr_1.ArkCxxCastExpr) {
|
|
590
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxCastExpr', {
|
|
591
|
+
cxxCastType: value.getCxxCastType(),
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
else if (value instanceof Expr_1.ArkTypeIdExpr) {
|
|
595
|
+
return (0, JsonDto_1.polymorphic)('ArkTypeIdExpr', {
|
|
596
|
+
op: serializeValue(value.getOp()),
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
else if (value instanceof Expr_1.ArkNoExpectExpr) {
|
|
600
|
+
return (0, JsonDto_1.polymorphic)('ArkNoExpectExpr', {
|
|
601
|
+
op: serializeValue(value.getOp()),
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
else if (value instanceof Expr_1.ArkCxxFolderExpr) {
|
|
605
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxFolderExpr', {
|
|
606
|
+
arg: serializeValue(value.getArg()),
|
|
607
|
+
op: value.getOp(),
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
else if (value instanceof Expr_1.ArkCxxNormalBinOpExpr) {
|
|
611
|
+
return (0, JsonDto_1.polymorphic)('ArkCxxNormalBinOpExpr', {
|
|
612
|
+
op1: serializeValue(value.getOp1()),
|
|
613
|
+
op2: serializeValue(value.getOp2()),
|
|
614
|
+
type: serializeType(value.getType()),
|
|
615
|
+
operator: value.getOperator(),
|
|
616
|
+
});
|
|
617
|
+
}
|
|
528
618
|
// Fallback for unhandled value types
|
|
529
619
|
console.info(`Unhandled Value: ${value.constructor.name} (${value.toString()})`);
|
|
530
620
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceStmt.d.ts","sourceRoot":"","sources":["../../../src/save/source/SourceStmt.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEH,eAAe,EAIlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ9C,OAAO,EAEH,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,IAAI,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAiC,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQ5E,OAAO,EA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seModel");
|
|
|
54
54
|
const ArkMetadata_1 = require("../../core/model/ArkMetadata");
|
|
55
55
|
const ArkImport_1 = require("../../core/model/ArkImport");
|
|
56
56
|
const ArkMethod_1 = require("../../core/model/ArkMethod");
|
|
57
|
+
const Const_1 = require("../../core/common/Const");
|
|
58
|
+
const TSConst_1 = require("../../core/common/TSConst");
|
|
57
59
|
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'SourceStmt');
|
|
58
60
|
const IGNOR_TYPES = new Set(['any', 'Map', 'Set']);
|
|
59
61
|
class SourceStmt {
|
|
@@ -255,7 +257,7 @@ class SourceAssignStmt extends SourceStmt {
|
|
|
255
257
|
if (stmt instanceof Stmt_1.ArkAssignStmt && stmt.getRightOp() instanceof Expr_1.ArkInstanceInvokeExpr) {
|
|
256
258
|
let instanceInvokeExpr = stmt.getRightOp();
|
|
257
259
|
const methodName = instanceInvokeExpr.getMethodSignature().getMethodSubSignature().getMethodName();
|
|
258
|
-
if ((
|
|
260
|
+
if ((TSConst_1.CONSTRUCTOR_NAME === methodName || Const_1.CONSTRUCT_SIGNATURE_NAME === methodName) &&
|
|
259
261
|
instanceInvokeExpr.getBase().getName() === this.leftOp.getName()) {
|
|
260
262
|
this.handleConstructorInvoke(instanceInvokeExpr, originType);
|
|
261
263
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceTransformer.d.ts","sourceRoot":"","sources":["../../../src/save/source/SourceTransformer.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAMH,qBAAqB,EAKrB,mBAAmB,EAKtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAiB,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,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;IAIvC,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,sBAAsB;IAKvB,0BAA0B,CAAC,UAAU,EAAE,qBAAqB,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM;IA+B7F,OAAO,CAAC,kBAAkB;IAuCnB,wBAAwB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM;IA8BxE,OAAO,CAAC,oBAAoB;IAYrB,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,GAAE,MAAa,GAAG,MAAM;WASvD,aAAa,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAQpD,OAAO,CAAC,YAAY;IA4Db,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IA0BvC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAE,OAAe,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;IAqBxF,OAAO,CAAC,aAAa;IA4Bd,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAW9C,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;IA+DvC,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,gBAAgB;CAkB3B"}
|
|
@@ -184,9 +184,6 @@ class SourceTransformer {
|
|
|
184
184
|
if (value.getType().toString() === 'string') {
|
|
185
185
|
return `'${PrinterUtils_1.PrinterUtils.escape(value.getValue())}'`;
|
|
186
186
|
}
|
|
187
|
-
else if (value.getType().toString() === TSConst_1.BIGINT_KEYWORD) {
|
|
188
|
-
return `${value.getValue()}n`;
|
|
189
|
-
}
|
|
190
187
|
else {
|
|
191
188
|
return value.getValue();
|
|
192
189
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArkFile } from '../core/model/ArkFile';
|
|
2
|
+
export declare class CxxSceneUtils {
|
|
3
|
+
static puncture(cxxModulePath: string, tsFile: ArkFile): void;
|
|
4
|
+
private static processApiDefine;
|
|
5
|
+
private static findPropDesc;
|
|
6
|
+
private static processPropDesc;
|
|
7
|
+
private static getDeclaredAssignStmt;
|
|
8
|
+
private static getUsedStmts;
|
|
9
|
+
private static mergeMethod;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CxxSceneUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CxxSceneUtils.d.ts","sourceRoot":"","sources":["../../src/utils/CxxSceneUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAkBhD,qBAAa,aAAa;WACR,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAqBpE,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAsB/B,OAAO,CAAC,MAAM,CAAC,YAAY;IAU3B,OAAO,CAAC,MAAM,CAAC,eAAe;IAmC9B,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC,OAAO,CAAC,MAAM,CAAC,YAAY;IAO3B,OAAO,CAAC,MAAM,CAAC,WAAW;CAa7B"}
|