arkanalyzer 1.0.86 → 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.
- 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 +32 -1
- package/lib/Config.d.ts.map +1 -1
- package/lib/Config.js +76 -2
- package/lib/Scene.d.ts +25 -2
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +148 -40
- 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 +32 -0
- package/lib/cli/commands/cg.d.ts.map +1 -0
- package/lib/cli/commands/cg.js +401 -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 +144 -22
- 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 +3 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +4 -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 +5 -1
- 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 +22 -2
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +59 -28
- 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/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/ArkMethodBuilder.d.ts +4 -1
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +19 -6
- 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/astUtils.d.ts +51 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astUtils.js +470 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts +30 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/const.js +134 -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 +285 -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 +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -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/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 +7 -8
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +27 -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 +10 -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
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024-2025 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.AutoType = exports.CxxArrayType = exports.CxxNonType = exports.TypeInfo = exports.Thread = exports.ReferenceType = exports.ReferCategory = exports.SmartPointerType = exports.SmartPointerCategory = exports.PointerType = exports.CxxWcharType = exports.CxxCharType = exports.CxxLongDoubleType = exports.CxxDoubleType = exports.CxxFloatType = exports.CxxFloatingPointType = exports.CxxSizeTType = exports.CxxLongLongType = exports.CxxLongType = exports.CxxShortType = exports.CxxIntType = exports.CxxIntegralType = exports.CxxStdTypeName = exports.CxxTypeSigned = exports.CxxTypeBitWidth = void 0;
|
|
18
|
+
const Type_1 = require("../../../core/base/Type");
|
|
19
|
+
/** Enum representing the bitWidth of Cxx types. */
|
|
20
|
+
var CxxTypeBitWidth;
|
|
21
|
+
(function (CxxTypeBitWidth) {
|
|
22
|
+
CxxTypeBitWidth[CxxTypeBitWidth["EIGHT_BITS"] = 8] = "EIGHT_BITS";
|
|
23
|
+
CxxTypeBitWidth[CxxTypeBitWidth["SIXTEEN_BITS"] = 16] = "SIXTEEN_BITS";
|
|
24
|
+
CxxTypeBitWidth[CxxTypeBitWidth["THIRTY_TWO_BITS"] = 32] = "THIRTY_TWO_BITS";
|
|
25
|
+
CxxTypeBitWidth[CxxTypeBitWidth["SIXTY_FOUR_BITS"] = 64] = "SIXTY_FOUR_BITS";
|
|
26
|
+
CxxTypeBitWidth[CxxTypeBitWidth["UNKNOWN"] = -1] = "UNKNOWN";
|
|
27
|
+
})(CxxTypeBitWidth = exports.CxxTypeBitWidth || (exports.CxxTypeBitWidth = {}));
|
|
28
|
+
/** Enum representing the signedness attribute of Cxx types. */
|
|
29
|
+
var CxxTypeSigned;
|
|
30
|
+
(function (CxxTypeSigned) {
|
|
31
|
+
CxxTypeSigned[CxxTypeSigned["UNSIGNED"] = 0] = "UNSIGNED";
|
|
32
|
+
CxxTypeSigned[CxxTypeSigned["SIGNED"] = 1] = "SIGNED";
|
|
33
|
+
CxxTypeSigned[CxxTypeSigned["UNKNOWN"] = -1] = "UNKNOWN";
|
|
34
|
+
})(CxxTypeSigned = exports.CxxTypeSigned || (exports.CxxTypeSigned = {}));
|
|
35
|
+
/** Enumerate the standard library types of Cxx */
|
|
36
|
+
var CxxStdTypeName;
|
|
37
|
+
(function (CxxStdTypeName) {
|
|
38
|
+
CxxStdTypeName[CxxStdTypeName["CHAR"] = 1] = "CHAR";
|
|
39
|
+
CxxStdTypeName[CxxStdTypeName["SIGNED_CHAR"] = 2] = "SIGNED_CHAR";
|
|
40
|
+
CxxStdTypeName[CxxStdTypeName["UNSIGNED_CHAR"] = 3] = "UNSIGNED_CHAR";
|
|
41
|
+
CxxStdTypeName[CxxStdTypeName["WCHAR_T"] = 4] = "WCHAR_T";
|
|
42
|
+
CxxStdTypeName[CxxStdTypeName["CHAR16_T"] = 5] = "CHAR16_T";
|
|
43
|
+
CxxStdTypeName[CxxStdTypeName["CHAR32_T"] = 6] = "CHAR32_T";
|
|
44
|
+
CxxStdTypeName[CxxStdTypeName["SHORT"] = 7] = "SHORT";
|
|
45
|
+
CxxStdTypeName[CxxStdTypeName["UNSIGNED_SHORT"] = 8] = "UNSIGNED_SHORT";
|
|
46
|
+
CxxStdTypeName[CxxStdTypeName["INT"] = 9] = "INT";
|
|
47
|
+
CxxStdTypeName[CxxStdTypeName["UNSIGNED_INT"] = 10] = "UNSIGNED_INT";
|
|
48
|
+
CxxStdTypeName[CxxStdTypeName["LONG"] = 11] = "LONG";
|
|
49
|
+
CxxStdTypeName[CxxStdTypeName["UNSIGNED_LONG"] = 12] = "UNSIGNED_LONG";
|
|
50
|
+
CxxStdTypeName[CxxStdTypeName["LONG_LONG"] = 13] = "LONG_LONG";
|
|
51
|
+
CxxStdTypeName[CxxStdTypeName["UNSIGNED_LONG_LONG"] = 14] = "UNSIGNED_LONG_LONG";
|
|
52
|
+
CxxStdTypeName[CxxStdTypeName["UINT8_T"] = 15] = "UINT8_T";
|
|
53
|
+
CxxStdTypeName[CxxStdTypeName["UINT16_T"] = 16] = "UINT16_T";
|
|
54
|
+
CxxStdTypeName[CxxStdTypeName["UINT32_T"] = 17] = "UINT32_T";
|
|
55
|
+
CxxStdTypeName[CxxStdTypeName["UINT64_T"] = 18] = "UINT64_T";
|
|
56
|
+
CxxStdTypeName[CxxStdTypeName["INT8_T"] = 19] = "INT8_T";
|
|
57
|
+
CxxStdTypeName[CxxStdTypeName["INT16_T"] = 20] = "INT16_T";
|
|
58
|
+
CxxStdTypeName[CxxStdTypeName["INT32_T"] = 21] = "INT32_T";
|
|
59
|
+
CxxStdTypeName[CxxStdTypeName["INT64_T"] = 22] = "INT64_T";
|
|
60
|
+
CxxStdTypeName[CxxStdTypeName["SIZE_T"] = 23] = "SIZE_T";
|
|
61
|
+
CxxStdTypeName[CxxStdTypeName["INTPTR_T"] = 24] = "INTPTR_T";
|
|
62
|
+
CxxStdTypeName[CxxStdTypeName["UINTPTR_T"] = 25] = "UINTPTR_T";
|
|
63
|
+
})(CxxStdTypeName = exports.CxxStdTypeName || (exports.CxxStdTypeName = {}));
|
|
64
|
+
/**
|
|
65
|
+
* integral type in cxx, for example int, short, long and so on.
|
|
66
|
+
* @category core/base/type
|
|
67
|
+
*/
|
|
68
|
+
class CxxIntegralType extends Type_1.NumberType {
|
|
69
|
+
constructor(signType, bitWidth, oriTypeName) {
|
|
70
|
+
super();
|
|
71
|
+
this.signType = signType;
|
|
72
|
+
this.bitWidth = bitWidth;
|
|
73
|
+
this.oriTypeName = oriTypeName;
|
|
74
|
+
}
|
|
75
|
+
static getInstance(signType = CxxTypeSigned.UNKNOWN, size = CxxTypeBitWidth.UNKNOWN, oriTypeName) {
|
|
76
|
+
return new CxxIntegralType(signType, size, oriTypeName);
|
|
77
|
+
}
|
|
78
|
+
getSignType() {
|
|
79
|
+
return this.signType;
|
|
80
|
+
}
|
|
81
|
+
getBitWidth() {
|
|
82
|
+
return this.bitWidth;
|
|
83
|
+
}
|
|
84
|
+
getOriTypeName() {
|
|
85
|
+
return this.oriTypeName;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.CxxIntegralType = CxxIntegralType;
|
|
89
|
+
/**
|
|
90
|
+
* int type in cxx
|
|
91
|
+
* @category core/base/type
|
|
92
|
+
*/
|
|
93
|
+
class CxxIntType extends CxxIntegralType {
|
|
94
|
+
static getInstance(signType, bitWidth, oriTypeName) {
|
|
95
|
+
return new CxxIntType(signType, bitWidth, oriTypeName);
|
|
96
|
+
}
|
|
97
|
+
getTypeString() {
|
|
98
|
+
if (this.oriTypeName) {
|
|
99
|
+
return cxxStdTypeNameToStr(this.oriTypeName);
|
|
100
|
+
}
|
|
101
|
+
const signStr = this.signType === CxxTypeSigned.UNSIGNED ? 'u' : '';
|
|
102
|
+
const bitStr = this.bitWidth === CxxTypeBitWidth.UNKNOWN ? '' : this.bitWidth.toString() + '_t';
|
|
103
|
+
return signStr + 'int' + bitStr;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.CxxIntType = CxxIntType;
|
|
107
|
+
/**
|
|
108
|
+
* short type in cxx
|
|
109
|
+
* @category core/base/type
|
|
110
|
+
*/
|
|
111
|
+
class CxxShortType extends CxxIntegralType {
|
|
112
|
+
static getInstance(signType, bitWidth, oriTypeName) {
|
|
113
|
+
return new CxxShortType(signType, bitWidth, oriTypeName);
|
|
114
|
+
}
|
|
115
|
+
getTypeString() {
|
|
116
|
+
if (this.oriTypeName) {
|
|
117
|
+
return cxxStdTypeNameToStr(this.oriTypeName);
|
|
118
|
+
}
|
|
119
|
+
const signStr = this.signType === CxxTypeSigned.UNSIGNED ? 'unsigned ' : '';
|
|
120
|
+
return signStr + 'short';
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.CxxShortType = CxxShortType;
|
|
124
|
+
/**
|
|
125
|
+
* long type in cxx
|
|
126
|
+
* @category core/base/type
|
|
127
|
+
*/
|
|
128
|
+
class CxxLongType extends CxxIntegralType {
|
|
129
|
+
static getInstance(signType, bitWidth, oriTypeName) {
|
|
130
|
+
return new CxxLongType(signType, bitWidth, oriTypeName);
|
|
131
|
+
}
|
|
132
|
+
getTypeString() {
|
|
133
|
+
if (this.oriTypeName) {
|
|
134
|
+
return cxxStdTypeNameToStr(this.oriTypeName);
|
|
135
|
+
}
|
|
136
|
+
const signStr = this.signType === CxxTypeSigned.UNSIGNED ? 'unsigned ' : '';
|
|
137
|
+
return signStr + 'long';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.CxxLongType = CxxLongType;
|
|
141
|
+
/**
|
|
142
|
+
* long long type in cxx
|
|
143
|
+
* @category core/base/type
|
|
144
|
+
*/
|
|
145
|
+
class CxxLongLongType extends CxxIntegralType {
|
|
146
|
+
static getInstance(signType, bitWidth, oriTypeName) {
|
|
147
|
+
return new CxxLongLongType(signType, bitWidth, oriTypeName);
|
|
148
|
+
}
|
|
149
|
+
getTypeString() {
|
|
150
|
+
if (this.oriTypeName) {
|
|
151
|
+
return cxxStdTypeNameToStr(this.oriTypeName);
|
|
152
|
+
}
|
|
153
|
+
const signStr = this.signType === CxxTypeSigned.UNSIGNED ? 'unsigned ' : '';
|
|
154
|
+
return signStr + 'long long';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.CxxLongLongType = CxxLongLongType;
|
|
158
|
+
/**
|
|
159
|
+
* size_t type in cxx
|
|
160
|
+
* @category core/base/type
|
|
161
|
+
*/
|
|
162
|
+
class CxxSizeTType extends CxxIntegralType {
|
|
163
|
+
static getInstance(signType, bitWidth, oriTypeName) {
|
|
164
|
+
return new CxxSizeTType(signType, bitWidth, oriTypeName);
|
|
165
|
+
}
|
|
166
|
+
getTypeString() {
|
|
167
|
+
return 'size_t';
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.CxxSizeTType = CxxSizeTType;
|
|
171
|
+
/**
|
|
172
|
+
* floating-point types in cxx, for example float, double and so on.
|
|
173
|
+
* @category core/base/type
|
|
174
|
+
*/
|
|
175
|
+
class CxxFloatingPointType extends Type_1.NumberType {
|
|
176
|
+
static getInstance() {
|
|
177
|
+
return new CxxFloatingPointType();
|
|
178
|
+
}
|
|
179
|
+
getBitWith() {
|
|
180
|
+
return CxxTypeBitWidth.UNKNOWN;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.CxxFloatingPointType = CxxFloatingPointType;
|
|
184
|
+
/**
|
|
185
|
+
* float type in cxx
|
|
186
|
+
* @category core/base/type
|
|
187
|
+
*/
|
|
188
|
+
class CxxFloatType extends CxxFloatingPointType {
|
|
189
|
+
static getInstance() {
|
|
190
|
+
return new CxxFloatType();
|
|
191
|
+
}
|
|
192
|
+
getTypeString() {
|
|
193
|
+
return 'float';
|
|
194
|
+
}
|
|
195
|
+
getBitWidth() {
|
|
196
|
+
return CxxTypeBitWidth.THIRTY_TWO_BITS;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.CxxFloatType = CxxFloatType;
|
|
200
|
+
/**
|
|
201
|
+
* double type in cxx
|
|
202
|
+
* @category core/base/type
|
|
203
|
+
*/
|
|
204
|
+
class CxxDoubleType extends CxxFloatingPointType {
|
|
205
|
+
static getInstance() {
|
|
206
|
+
return new CxxDoubleType();
|
|
207
|
+
}
|
|
208
|
+
getTypeString() {
|
|
209
|
+
return 'double';
|
|
210
|
+
}
|
|
211
|
+
getBitWidth() {
|
|
212
|
+
return CxxTypeBitWidth.SIXTY_FOUR_BITS;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.CxxDoubleType = CxxDoubleType;
|
|
216
|
+
/**
|
|
217
|
+
* long double type in cxx
|
|
218
|
+
* @category core/base/type
|
|
219
|
+
*/
|
|
220
|
+
class CxxLongDoubleType extends CxxFloatingPointType {
|
|
221
|
+
static getInstance() {
|
|
222
|
+
return new CxxLongDoubleType();
|
|
223
|
+
}
|
|
224
|
+
getTypeString() {
|
|
225
|
+
return 'long double';
|
|
226
|
+
}
|
|
227
|
+
getBitWidth() {
|
|
228
|
+
return CxxTypeBitWidth.UNKNOWN;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.CxxLongDoubleType = CxxLongDoubleType;
|
|
232
|
+
/**
|
|
233
|
+
* char type in cxx
|
|
234
|
+
* @category core/base/type
|
|
235
|
+
*/
|
|
236
|
+
class CxxCharType extends Type_1.Type {
|
|
237
|
+
constructor(signType, bitWidth, oriTypeName) {
|
|
238
|
+
super();
|
|
239
|
+
this.signType = signType;
|
|
240
|
+
this.bitWidth = bitWidth;
|
|
241
|
+
this.oriTypeName = oriTypeName;
|
|
242
|
+
}
|
|
243
|
+
static getInstance(signType = CxxTypeSigned.UNKNOWN, size = CxxTypeBitWidth.UNKNOWN, oriTypeName) {
|
|
244
|
+
return new CxxCharType(signType, size, oriTypeName);
|
|
245
|
+
}
|
|
246
|
+
getSignType() {
|
|
247
|
+
return this.signType;
|
|
248
|
+
}
|
|
249
|
+
getBitWidth() {
|
|
250
|
+
return this.bitWidth;
|
|
251
|
+
}
|
|
252
|
+
getOriTypeName() {
|
|
253
|
+
return this.oriTypeName;
|
|
254
|
+
}
|
|
255
|
+
getTypeString() {
|
|
256
|
+
if (this.oriTypeName) {
|
|
257
|
+
return cxxStdTypeNameToStr(this.oriTypeName);
|
|
258
|
+
}
|
|
259
|
+
const signStr = this.signType === CxxTypeSigned.UNKNOWN ? '' : this.signType === CxxTypeSigned.SIGNED ? 'signed ' : 'unsigned ';
|
|
260
|
+
const bitStr = this.bitWidth === CxxTypeBitWidth.UNKNOWN ? '' : this.bitWidth.toString() + '_t';
|
|
261
|
+
return signStr + 'char' + bitStr;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.CxxCharType = CxxCharType;
|
|
265
|
+
/**
|
|
266
|
+
* wchar_t type in cxx
|
|
267
|
+
* @category core/base/type
|
|
268
|
+
*/
|
|
269
|
+
class CxxWcharType extends CxxIntegralType {
|
|
270
|
+
static getInstance(signType = CxxTypeSigned.UNKNOWN, size = CxxTypeBitWidth.UNKNOWN, oriTypeName) {
|
|
271
|
+
return new CxxWcharType(signType, size, oriTypeName);
|
|
272
|
+
}
|
|
273
|
+
getTypeString() {
|
|
274
|
+
return 'wchar_t';
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
exports.CxxWcharType = CxxWcharType;
|
|
278
|
+
function cxxStdTypeNameToStr(cxxStdTypeName) {
|
|
279
|
+
switch (cxxStdTypeName) {
|
|
280
|
+
case CxxStdTypeName.CHAR:
|
|
281
|
+
return 'char';
|
|
282
|
+
case CxxStdTypeName.SIGNED_CHAR:
|
|
283
|
+
return 'signed char';
|
|
284
|
+
case CxxStdTypeName.UNSIGNED_CHAR:
|
|
285
|
+
return 'unsigned char';
|
|
286
|
+
case CxxStdTypeName.WCHAR_T:
|
|
287
|
+
return 'wchar_t';
|
|
288
|
+
case CxxStdTypeName.CHAR16_T:
|
|
289
|
+
return 'char16_t';
|
|
290
|
+
case CxxStdTypeName.CHAR32_T:
|
|
291
|
+
return 'char32_t';
|
|
292
|
+
case CxxStdTypeName.SHORT:
|
|
293
|
+
return 'short';
|
|
294
|
+
case CxxStdTypeName.UNSIGNED_SHORT:
|
|
295
|
+
return 'unsigned short';
|
|
296
|
+
case CxxStdTypeName.INT:
|
|
297
|
+
return 'int';
|
|
298
|
+
case CxxStdTypeName.UNSIGNED_INT:
|
|
299
|
+
return 'unsigned int';
|
|
300
|
+
case CxxStdTypeName.LONG:
|
|
301
|
+
return 'long';
|
|
302
|
+
case CxxStdTypeName.UNSIGNED_LONG:
|
|
303
|
+
return 'unsigned long';
|
|
304
|
+
case CxxStdTypeName.LONG_LONG:
|
|
305
|
+
return 'long long';
|
|
306
|
+
case CxxStdTypeName.UNSIGNED_LONG_LONG:
|
|
307
|
+
return 'unsigned long long';
|
|
308
|
+
case CxxStdTypeName.UINT8_T:
|
|
309
|
+
return 'uint8_t';
|
|
310
|
+
case CxxStdTypeName.UINT16_T:
|
|
311
|
+
return 'uint16_t';
|
|
312
|
+
case CxxStdTypeName.UINT32_T:
|
|
313
|
+
return 'uint32_t';
|
|
314
|
+
case CxxStdTypeName.UINT64_T:
|
|
315
|
+
return 'uint64_t';
|
|
316
|
+
case CxxStdTypeName.INT8_T:
|
|
317
|
+
return 'int8_t';
|
|
318
|
+
case CxxStdTypeName.INT16_T:
|
|
319
|
+
return 'int16_t';
|
|
320
|
+
case CxxStdTypeName.INT32_T:
|
|
321
|
+
return 'int32_t';
|
|
322
|
+
case CxxStdTypeName.INT64_T:
|
|
323
|
+
return 'int64_t';
|
|
324
|
+
case CxxStdTypeName.SIZE_T:
|
|
325
|
+
return 'size_t';
|
|
326
|
+
case CxxStdTypeName.INTPTR_T:
|
|
327
|
+
return 'intptr_t';
|
|
328
|
+
case CxxStdTypeName.UINTPTR_T:
|
|
329
|
+
return 'uintptr_t';
|
|
330
|
+
default:
|
|
331
|
+
return '';
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
*PointerType class represents pointer type, inherited from Type base class
|
|
336
|
+
*Pointer types used to represent C language style, such as int *, char * *, etc
|
|
337
|
+
*/
|
|
338
|
+
class PointerType extends Type_1.Type {
|
|
339
|
+
constructor(baseType, level) {
|
|
340
|
+
super();
|
|
341
|
+
this.isConstPointer = false; // Whether the pointer is a const pointer
|
|
342
|
+
this.isPointerToConst = false; // Whether the pointer points to a const type
|
|
343
|
+
this.isVolatilePointer = false; // Whether the pointer is a volatile pointer
|
|
344
|
+
this.isPointerToVolatileType = false; // Whether the pointer points to a volatile type
|
|
345
|
+
this.baseType = baseType;
|
|
346
|
+
this.level = level;
|
|
347
|
+
}
|
|
348
|
+
getBaseType() {
|
|
349
|
+
return this.baseType;
|
|
350
|
+
}
|
|
351
|
+
setBaseType(newBaseType) {
|
|
352
|
+
this.baseType = newBaseType;
|
|
353
|
+
}
|
|
354
|
+
getLevel() {
|
|
355
|
+
return this.level;
|
|
356
|
+
}
|
|
357
|
+
getTypeString() {
|
|
358
|
+
const strs = [];
|
|
359
|
+
if (this.baseType instanceof Type_1.UnionType) {
|
|
360
|
+
strs.push('(' + this.baseType.toString() + ')');
|
|
361
|
+
}
|
|
362
|
+
else if (this.baseType) {
|
|
363
|
+
strs.push(this.baseType.toString());
|
|
364
|
+
}
|
|
365
|
+
for (let i = 0; i < this.level; i++) {
|
|
366
|
+
strs.push('*');
|
|
367
|
+
}
|
|
368
|
+
return strs.join('');
|
|
369
|
+
}
|
|
370
|
+
getIsConstPointer() {
|
|
371
|
+
return this.isConstPointer;
|
|
372
|
+
}
|
|
373
|
+
setIsConstPointer(isConstPointer) {
|
|
374
|
+
this.isConstPointer = isConstPointer;
|
|
375
|
+
}
|
|
376
|
+
getIsPointerToConst() {
|
|
377
|
+
return this.isPointerToConst;
|
|
378
|
+
}
|
|
379
|
+
setIsPointerToConst(isPointerToConst) {
|
|
380
|
+
this.isPointerToConst = isPointerToConst;
|
|
381
|
+
}
|
|
382
|
+
getIsVolatilePointer() {
|
|
383
|
+
return this.isVolatilePointer;
|
|
384
|
+
}
|
|
385
|
+
setIsVolatilePointer(isVolatilePointer) {
|
|
386
|
+
this.isVolatilePointer = isVolatilePointer;
|
|
387
|
+
}
|
|
388
|
+
getIsPointerToVolatileType() {
|
|
389
|
+
return this.isPointerToVolatileType;
|
|
390
|
+
}
|
|
391
|
+
setIsPointerToVolatileType(isPointerToVolatileType) {
|
|
392
|
+
this.isPointerToVolatileType = isPointerToVolatileType;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
exports.PointerType = PointerType;
|
|
396
|
+
var SmartPointerCategory;
|
|
397
|
+
(function (SmartPointerCategory) {
|
|
398
|
+
SmartPointerCategory[SmartPointerCategory["UNKNOWN"] = -1] = "UNKNOWN";
|
|
399
|
+
SmartPointerCategory[SmartPointerCategory["UNIQUE_PTR"] = 0] = "UNIQUE_PTR";
|
|
400
|
+
SmartPointerCategory[SmartPointerCategory["SHARED_PTR"] = 1] = "SHARED_PTR";
|
|
401
|
+
SmartPointerCategory[SmartPointerCategory["WEAK_PTR"] = 2] = "WEAK_PTR";
|
|
402
|
+
})(SmartPointerCategory = exports.SmartPointerCategory || (exports.SmartPointerCategory = {}));
|
|
403
|
+
class SmartPointerType extends PointerType {
|
|
404
|
+
constructor(baseType, level, source) {
|
|
405
|
+
let category = SmartPointerCategory.UNKNOWN;
|
|
406
|
+
super(baseType, level);
|
|
407
|
+
if (source.includes('unique')) {
|
|
408
|
+
category = SmartPointerCategory.UNIQUE_PTR;
|
|
409
|
+
}
|
|
410
|
+
else if (source.includes('shared')) {
|
|
411
|
+
category = SmartPointerCategory.SHARED_PTR;
|
|
412
|
+
}
|
|
413
|
+
else if (source.includes('weak')) {
|
|
414
|
+
category = SmartPointerCategory.WEAK_PTR;
|
|
415
|
+
}
|
|
416
|
+
this.category = category;
|
|
417
|
+
}
|
|
418
|
+
getCategory() {
|
|
419
|
+
return this.category;
|
|
420
|
+
}
|
|
421
|
+
setCategory(category) {
|
|
422
|
+
this.category = category;
|
|
423
|
+
}
|
|
424
|
+
getTypeString() {
|
|
425
|
+
const baseTypeStr = this.getBaseType().toString();
|
|
426
|
+
switch (this.category) {
|
|
427
|
+
case SmartPointerCategory.UNIQUE_PTR:
|
|
428
|
+
return `unique_ptr<${baseTypeStr}>`;
|
|
429
|
+
case SmartPointerCategory.SHARED_PTR:
|
|
430
|
+
return `shared_ptr<${baseTypeStr}>`;
|
|
431
|
+
case SmartPointerCategory.WEAK_PTR:
|
|
432
|
+
return `weak_ptr<${baseTypeStr}>`;
|
|
433
|
+
default:
|
|
434
|
+
return `smart_ptr<${baseTypeStr}>`;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
exports.SmartPointerType = SmartPointerType;
|
|
439
|
+
/**
|
|
440
|
+
*Reference category enumeration, used to distinguish different types of references
|
|
441
|
+
*LVALUE_REF: Left value reference, the reference type of address can be obtained
|
|
442
|
+
*RVALUE_REF: Right value reference, used to bind the reference type of temporary object
|
|
443
|
+
*UNIVERSAL_REF: universal reference, which can bind reference types of left or right values
|
|
444
|
+
*/
|
|
445
|
+
var ReferCategory;
|
|
446
|
+
(function (ReferCategory) {
|
|
447
|
+
ReferCategory[ReferCategory["LVALUE_REF"] = 0] = "LVALUE_REF";
|
|
448
|
+
ReferCategory[ReferCategory["RVALUE_REF"] = 1] = "RVALUE_REF";
|
|
449
|
+
ReferCategory[ReferCategory["UNIVERSAL_REF"] = 2] = "UNIVERSAL_REF";
|
|
450
|
+
})(ReferCategory = exports.ReferCategory || (exports.ReferCategory = {}));
|
|
451
|
+
/**
|
|
452
|
+
*The ReferenceType class represents the reference type, inherited from the Type base class
|
|
453
|
+
*Used to represent the type of left value reference (&) and right value reference (&&) in C++
|
|
454
|
+
*/
|
|
455
|
+
class ReferenceType extends Type_1.Type {
|
|
456
|
+
constructor(bassType, category, sourceValue) {
|
|
457
|
+
super();
|
|
458
|
+
this.baseType = bassType;
|
|
459
|
+
this.category = category;
|
|
460
|
+
this.sourceValue = sourceValue;
|
|
461
|
+
}
|
|
462
|
+
getBaseType() {
|
|
463
|
+
return this.baseType;
|
|
464
|
+
}
|
|
465
|
+
setBaseType(newBaseType) {
|
|
466
|
+
this.baseType = newBaseType;
|
|
467
|
+
}
|
|
468
|
+
getCategory() {
|
|
469
|
+
return this.category;
|
|
470
|
+
}
|
|
471
|
+
setSourceValue(sourceValue) {
|
|
472
|
+
this.sourceValue = sourceValue;
|
|
473
|
+
}
|
|
474
|
+
getSourceValue() {
|
|
475
|
+
return this.sourceValue;
|
|
476
|
+
}
|
|
477
|
+
getTypeString() {
|
|
478
|
+
// Implement abstract method, return type string
|
|
479
|
+
const strs = [];
|
|
480
|
+
if (this.baseType instanceof Type_1.UnionType) {
|
|
481
|
+
strs.push('(' + this.baseType.toString() + ')');
|
|
482
|
+
}
|
|
483
|
+
else if (this.baseType) {
|
|
484
|
+
strs.push(this.baseType.toString());
|
|
485
|
+
}
|
|
486
|
+
if (this.category === ReferCategory.LVALUE_REF) {
|
|
487
|
+
strs.push('&');
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
strs.push('&&');
|
|
491
|
+
}
|
|
492
|
+
return strs.join('');
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
exports.ReferenceType = ReferenceType;
|
|
496
|
+
/**
|
|
497
|
+
*The Thread class inherits from the Type class and represents a thread type
|
|
498
|
+
*This class provides the basic implementation of thread types
|
|
499
|
+
*/
|
|
500
|
+
class Thread extends Type_1.Type {
|
|
501
|
+
constructor() {
|
|
502
|
+
super();
|
|
503
|
+
}
|
|
504
|
+
getTypeString() {
|
|
505
|
+
return 'thread ';
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
exports.Thread = Thread;
|
|
509
|
+
class TypeInfo extends Type_1.Type {
|
|
510
|
+
constructor(name, type) {
|
|
511
|
+
super();
|
|
512
|
+
this.name = name;
|
|
513
|
+
this.type = type;
|
|
514
|
+
}
|
|
515
|
+
getName() {
|
|
516
|
+
return this.name;
|
|
517
|
+
}
|
|
518
|
+
getType() {
|
|
519
|
+
return this.type;
|
|
520
|
+
}
|
|
521
|
+
getTypeString() {
|
|
522
|
+
return this.name;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
exports.TypeInfo = TypeInfo;
|
|
526
|
+
class CxxNonType extends Type_1.GenericType {
|
|
527
|
+
constructor(name, defaultType, isAutoType = false) {
|
|
528
|
+
super(name, defaultType);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
exports.CxxNonType = CxxNonType;
|
|
532
|
+
class CxxArrayType extends Type_1.Type {
|
|
533
|
+
constructor(baseType, dimension, dimensionSizes) {
|
|
534
|
+
super();
|
|
535
|
+
this.baseType = baseType;
|
|
536
|
+
this.dimension = dimension;
|
|
537
|
+
this.dimension = dimension;
|
|
538
|
+
this.dimensionSizes = dimensionSizes || new Array(dimension).fill(0);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Returns the base type of this array, such as `Any`, `Unknown`, `TypeParameter`, etc.
|
|
542
|
+
* @returns The base type of array.
|
|
543
|
+
*/
|
|
544
|
+
getBaseType() {
|
|
545
|
+
return this.baseType;
|
|
546
|
+
}
|
|
547
|
+
setBaseType(newType) {
|
|
548
|
+
this.baseType = newType;
|
|
549
|
+
}
|
|
550
|
+
getDimension() {
|
|
551
|
+
return this.dimension;
|
|
552
|
+
}
|
|
553
|
+
getDimensionSizes() {
|
|
554
|
+
return this.dimensionSizes;
|
|
555
|
+
}
|
|
556
|
+
setDimensionSizes(sizes) {
|
|
557
|
+
if (sizes.length !== this.dimension) {
|
|
558
|
+
throw new Error(`Dimension sizes length ${sizes.length} doesn't match array dimension ${this.dimension}`);
|
|
559
|
+
}
|
|
560
|
+
this.dimensionSizes = sizes;
|
|
561
|
+
}
|
|
562
|
+
getDimensionSize(index) {
|
|
563
|
+
if (index < 0 || index >= this.dimension) {
|
|
564
|
+
throw new Error(`Index ${index} out of bounds for dimension ${this.dimension}`);
|
|
565
|
+
}
|
|
566
|
+
return this.dimensionSizes[index];
|
|
567
|
+
}
|
|
568
|
+
getTypeString() {
|
|
569
|
+
const strs = [];
|
|
570
|
+
if (this.baseType instanceof Type_1.UnionType) {
|
|
571
|
+
strs.push('(' + this.baseType.toString() + ')');
|
|
572
|
+
}
|
|
573
|
+
else if (this.baseType) {
|
|
574
|
+
strs.push(this.baseType.toString());
|
|
575
|
+
}
|
|
576
|
+
for (let i = 0; i < this.dimension; i++) {
|
|
577
|
+
if (i < this.dimensionSizes.length && this.dimensionSizes[i] >= 0) {
|
|
578
|
+
strs.push(`[${this.dimensionSizes[i]}]`); // Display specific size
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
strs.push('[]'); // No size specified
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return strs.join('');
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
exports.CxxArrayType = CxxArrayType;
|
|
588
|
+
class AutoType extends Type_1.Type {
|
|
589
|
+
static getInstance() {
|
|
590
|
+
return this.INSTANCE;
|
|
591
|
+
}
|
|
592
|
+
constructor() {
|
|
593
|
+
super();
|
|
594
|
+
}
|
|
595
|
+
getTypeString() {
|
|
596
|
+
return 'auto';
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
exports.AutoType = AutoType;
|
|
600
|
+
AutoType.INSTANCE = new AutoType();
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { UnaryOperator } from '../../../core/base/Expr';
|
|
2
|
+
import { GlobalRef } from '../../../core/base/Ref';
|
|
3
|
+
import { Value } from '../../../core/base/Value';
|
|
4
|
+
import { Local } from '../../../core/base/Local';
|
|
5
|
+
import { ArkAliasTypeDefineStmt, Stmt } from '../../../core/base/Stmt';
|
|
6
|
+
import { AliasType } from '../../../core/base/Type';
|
|
7
|
+
import { ArkMethod } from '../../../core/model/ArkMethod';
|
|
8
|
+
import { FullPosition } from '../../../core/base/Position';
|
|
9
|
+
import { ArkIRTransformer } from '../../../core/common/ArkIRTransformer';
|
|
10
|
+
import { CxxAstNode, CxxTranslationUnit } from '../ast/ArkCxxAstNode';
|
|
11
|
+
export type ValueAndStmts = {
|
|
12
|
+
value: Value;
|
|
13
|
+
valueOriginalPositions: FullPosition[];
|
|
14
|
+
stmts: Stmt[];
|
|
15
|
+
};
|
|
16
|
+
export declare class ArkCxxIRTransformer extends ArkIRTransformer {
|
|
17
|
+
static readonly DUMMY_IF_OPERATOR_AND_SIGNAL = "If(&&)";
|
|
18
|
+
static readonly DUMMY_IF_OPERATOR_END = "IfEnd";
|
|
19
|
+
static readonly DUMMY_IF_OPERATOR_OR_SIGNAL = "If(||)";
|
|
20
|
+
private readonly cxxSourceFile;
|
|
21
|
+
private ArkCxxValueTransformer;
|
|
22
|
+
private catchedExceptions;
|
|
23
|
+
constructor(sourceFile: CxxTranslationUnit, declaringMethod: ArkMethod);
|
|
24
|
+
getLocals(): Set<Local>;
|
|
25
|
+
getGlobals(): Map<string, GlobalRef> | null;
|
|
26
|
+
getThisLocal(): Local;
|
|
27
|
+
getAliasTypeMap(): Map<string, [AliasType, ArkAliasTypeDefineStmt]>;
|
|
28
|
+
prebuildStmts(): Stmt[];
|
|
29
|
+
private shouldGenerateCxxExtraAssignStmt;
|
|
30
|
+
/** The main function for converting C++ AST nodes to Stmts */
|
|
31
|
+
cxxNodeToStmts(node: CxxAstNode): Stmt[];
|
|
32
|
+
private cxxClassDeclarationToStmts;
|
|
33
|
+
private typeDefDeclToStmts;
|
|
34
|
+
/**
|
|
35
|
+
* Extracts the target declaration node and the type string (right operand).
|
|
36
|
+
*/
|
|
37
|
+
private preprocessTypeAlias;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves the basic right-hand side type, handling anonymous structs/unions/enums.
|
|
40
|
+
*/
|
|
41
|
+
private resolveInitialRightType;
|
|
42
|
+
/**
|
|
43
|
+
* Configures generics for template aliases and handles the 'typename' keyword.
|
|
44
|
+
*/
|
|
45
|
+
private configureTemplateAndTypename;
|
|
46
|
+
/**
|
|
47
|
+
* Extracts real generic types from TemplateTypeParmDecl nodes and sets them on the expression.
|
|
48
|
+
*/
|
|
49
|
+
private populateRealGenericTypes;
|
|
50
|
+
/**
|
|
51
|
+
* Constructs the final ArkAliasTypeDefineStmt and sets source positions.
|
|
52
|
+
*/
|
|
53
|
+
private createAliasStmt;
|
|
54
|
+
private getAnonymousInformation;
|
|
55
|
+
private cxxParameterToStmts;
|
|
56
|
+
private cxxGenerateAliasTypeExpr;
|
|
57
|
+
private forRangeStatementToStmts;
|
|
58
|
+
private handleForRangeIterInit;
|
|
59
|
+
private handleForRangeIterBegin;
|
|
60
|
+
private handleForRangeIterEnd;
|
|
61
|
+
private handleForRangeIterResult;
|
|
62
|
+
private cxxCatchClauseToStmts;
|
|
63
|
+
/** The main function for converting C++ AST nodes to ValueAndStmts */
|
|
64
|
+
cxxNodeToValueAndStmts(node: CxxAstNode): ValueAndStmts;
|
|
65
|
+
private cxxReturnStatementToStmts;
|
|
66
|
+
private cxxExpressionStatementToStmts;
|
|
67
|
+
private cxxAddInvokeStmts;
|
|
68
|
+
/** Convert C++ switch statements to ValueAndStmts */
|
|
69
|
+
cxxSwitchStatementToValueAndStmts(switchStatement: CxxAstNode): ValueAndStmts[];
|
|
70
|
+
/**
|
|
71
|
+
* Convert C++for statement nodes to Ark IR statement arrays
|
|
72
|
+
* Under forStmt, there will be 5 child nodes. Taking for (a ; b; c) as an example,
|
|
73
|
+
* the content of block a is at node 0, if block b contains assignments, it will be at node 1,
|
|
74
|
+
* the Boolean judgment of block b is at node 2, the successor operation of block c's loop body is at node 3,
|
|
75
|
+
* and the loop body is at node 4
|
|
76
|
+
* @param forStatement -The for statement node in C++AST
|
|
77
|
+
* @returns Converted Ark IR statement array
|
|
78
|
+
*/
|
|
79
|
+
private cxxForStatementToStmts;
|
|
80
|
+
private cxxWhileStatementToStmts;
|
|
81
|
+
private cxxDoStatementToStmts;
|
|
82
|
+
private expressionWithCleanup;
|
|
83
|
+
private compoundToStmts;
|
|
84
|
+
private memberCallExprToStmts;
|
|
85
|
+
private memberCallExpressionToStmts;
|
|
86
|
+
private expressionToStmts;
|
|
87
|
+
private cxxDeclStatementToStmts;
|
|
88
|
+
private decompositionDeclToStmts;
|
|
89
|
+
private cxxVariableDeclarationListToStmts;
|
|
90
|
+
cxxIfStatementToStmts(ifStatement: CxxAstNode, depth?: number, context?: {
|
|
91
|
+
conditionExpr: Value | undefined;
|
|
92
|
+
}): Stmt[];
|
|
93
|
+
private cxxThrowStatementToStmts;
|
|
94
|
+
cxxMapStmtsToTsStmt(stmts: Stmt[], node: CxxAstNode): void;
|
|
95
|
+
/**
|
|
96
|
+
* Converts a C++ token to the corresponding unary operator.
|
|
97
|
+
*
|
|
98
|
+
* @param token - The C++ token to be converted.
|
|
99
|
+
* @returns - The corresponding `UnaryOperator` if the token matches, otherwise `null`.
|
|
100
|
+
*/
|
|
101
|
+
static cxxTokenToUnaryOperator(token: string): UnaryOperator | null;
|
|
102
|
+
generateAssignStmtForValue(value: Value, valueOriginalPositions: FullPosition[]): ValueAndStmts;
|
|
103
|
+
private buildTypeForUnopExpr;
|
|
104
|
+
private buildTypeForDerefExpr;
|
|
105
|
+
private buildTypeForBinOpExpr;
|
|
106
|
+
private buildTypeForArrayRefExpr;
|
|
107
|
+
setBuilderMethodContextFlag(builderMethodContextFlag: boolean): void;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=ArkIRTransformer.d.ts.map
|