arkanalyzer 1.0.5
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/LICENSE +201 -0
- package/README.en.md +88 -0
- package/README.md +98 -0
- package/docs/HowToCreatePR.md +55 -0
- package/docs/HowToHandleIssues.md +155 -0
- package/docs/quickstart.pdf +0 -0
- package/lib/Config.d.ts +26 -0
- package/lib/Config.d.ts.map +1 -0
- package/lib/Config.js +128 -0
- package/lib/Scene.d.ts +125 -0
- package/lib/Scene.d.ts.map +1 -0
- package/lib/Scene.js +762 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +28 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.js +137 -0
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts +11 -0
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts.map +1 -0
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.js +71 -0
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +16 -0
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -0
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +147 -0
- package/lib/callgraph/common/Statistics.d.ts +58 -0
- package/lib/callgraph/common/Statistics.d.ts.map +1 -0
- package/lib/callgraph/common/Statistics.js +203 -0
- package/lib/callgraph/model/BaseGraph.d.ts +62 -0
- package/lib/callgraph/model/BaseGraph.d.ts.map +1 -0
- package/lib/callgraph/model/BaseGraph.js +158 -0
- package/lib/callgraph/model/CallGraph.d.ts +94 -0
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -0
- package/lib/callgraph/model/CallGraph.js +339 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +16 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.js +106 -0
- package/lib/callgraph/pointerAnalysis/Context.d.ts +38 -0
- package/lib/callgraph/pointerAnalysis/Context.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/Context.js +156 -0
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts +23 -0
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.js +104 -0
- package/lib/callgraph/pointerAnalysis/Pag.d.ts +209 -0
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/Pag.js +774 -0
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts +88 -0
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +821 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts +64 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +502 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts +9 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.js +57 -0
- package/lib/callgraph/pointerAnalysis/PtsDS.d.ts +58 -0
- package/lib/callgraph/pointerAnalysis/PtsDS.d.ts.map +1 -0
- package/lib/callgraph/pointerAnalysis/PtsDS.js +234 -0
- package/lib/core/base/Constant.d.ts +17 -0
- package/lib/core/base/Constant.d.ts.map +1 -0
- package/lib/core/base/Constant.js +53 -0
- package/lib/core/base/Decorator.d.ts +15 -0
- package/lib/core/base/Decorator.d.ts.map +1 -0
- package/lib/core/base/Decorator.js +43 -0
- package/lib/core/base/DefUseChain.d.ts +9 -0
- package/lib/core/base/DefUseChain.d.ts.map +1 -0
- package/lib/core/base/DefUseChain.js +25 -0
- package/lib/core/base/Expr.d.ts +219 -0
- package/lib/core/base/Expr.d.ts.map +1 -0
- package/lib/core/base/Expr.js +896 -0
- package/lib/core/base/Local.d.ts +40 -0
- package/lib/core/base/Local.d.ts.map +1 -0
- package/lib/core/base/Local.js +101 -0
- package/lib/core/base/Position.d.ts +39 -0
- package/lib/core/base/Position.d.ts.map +1 -0
- package/lib/core/base/Position.js +86 -0
- package/lib/core/base/Ref.d.ts +75 -0
- package/lib/core/base/Ref.d.ts.map +1 -0
- package/lib/core/base/Ref.js +286 -0
- package/lib/core/base/Stmt.d.ts +109 -0
- package/lib/core/base/Stmt.d.ts.map +1 -0
- package/lib/core/base/Stmt.js +374 -0
- package/lib/core/base/Type.d.ts +220 -0
- package/lib/core/base/Type.d.ts.map +1 -0
- package/lib/core/base/Type.js +477 -0
- package/lib/core/base/Value.d.ts +11 -0
- package/lib/core/base/Value.d.ts.map +1 -0
- package/lib/core/base/Value.js +16 -0
- package/lib/core/common/ArkIRTransformer.d.ts +101 -0
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -0
- package/lib/core/common/ArkIRTransformer.js +1674 -0
- package/lib/core/common/BodyBuilder.d.ts +10 -0
- package/lib/core/common/BodyBuilder.d.ts.map +1 -0
- package/lib/core/common/BodyBuilder.js +34 -0
- package/lib/core/common/Builtin.d.ts +35 -0
- package/lib/core/common/Builtin.d.ts.map +1 -0
- package/lib/core/common/Builtin.js +78 -0
- package/lib/core/common/CfgBuilder.d.ts +136 -0
- package/lib/core/common/CfgBuilder.d.ts.map +1 -0
- package/lib/core/common/CfgBuilder.js +1241 -0
- package/lib/core/common/Const.d.ts +15 -0
- package/lib/core/common/Const.d.ts.map +1 -0
- package/lib/core/common/Const.js +34 -0
- package/lib/core/common/DummyMainCreater.d.ts +48 -0
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -0
- package/lib/core/common/DummyMainCreater.js +433 -0
- package/lib/core/common/EtsConst.d.ts +65 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -0
- package/lib/core/common/EtsConst.js +918 -0
- package/lib/core/common/ExprUseReplacer.d.ts +18 -0
- package/lib/core/common/ExprUseReplacer.d.ts.map +1 -0
- package/lib/core/common/ExprUseReplacer.js +88 -0
- package/lib/core/common/IRUtils.d.ts +7 -0
- package/lib/core/common/IRUtils.d.ts.map +1 -0
- package/lib/core/common/IRUtils.js +39 -0
- package/lib/core/common/ModelUtils.d.ts +61 -0
- package/lib/core/common/ModelUtils.d.ts.map +1 -0
- package/lib/core/common/ModelUtils.js +628 -0
- package/lib/core/common/RefUseReplacer.d.ts +14 -0
- package/lib/core/common/RefUseReplacer.d.ts.map +1 -0
- package/lib/core/common/RefUseReplacer.js +50 -0
- package/lib/core/common/StmtUseReplacer.d.ts +16 -0
- package/lib/core/common/StmtUseReplacer.d.ts.map +1 -0
- package/lib/core/common/StmtUseReplacer.js +88 -0
- package/lib/core/common/TSConst.d.ts +11 -0
- package/lib/core/common/TSConst.d.ts.map +1 -0
- package/lib/core/common/TSConst.js +28 -0
- package/lib/core/common/TypeInference.d.ts +44 -0
- package/lib/core/common/TypeInference.d.ts.map +1 -0
- package/lib/core/common/TypeInference.js +519 -0
- package/lib/core/common/ValueUtil.d.ts +17 -0
- package/lib/core/common/ValueUtil.d.ts.map +1 -0
- package/lib/core/common/ValueUtil.js +71 -0
- package/lib/core/common/VisibleValue.d.ts +37 -0
- package/lib/core/common/VisibleValue.d.ts.map +1 -0
- package/lib/core/common/VisibleValue.js +212 -0
- package/lib/core/dataflow/DataflowProblem.d.ts +21 -0
- package/lib/core/dataflow/DataflowProblem.d.ts.map +1 -0
- package/lib/core/dataflow/DataflowProblem.js +33 -0
- package/lib/core/dataflow/DataflowResult.d.ts +8 -0
- package/lib/core/dataflow/DataflowResult.d.ts.map +1 -0
- package/lib/core/dataflow/DataflowResult.js +26 -0
- package/lib/core/dataflow/DataflowSolver.d.ts +40 -0
- package/lib/core/dataflow/DataflowSolver.d.ts.map +1 -0
- package/lib/core/dataflow/DataflowSolver.js +318 -0
- package/lib/core/dataflow/Edge.d.ts +16 -0
- package/lib/core/dataflow/Edge.d.ts.map +1 -0
- package/lib/core/dataflow/Edge.js +40 -0
- package/lib/core/dataflow/Fact.d.ts +7 -0
- package/lib/core/dataflow/Fact.d.ts.map +1 -0
- package/lib/core/dataflow/Fact.js +24 -0
- package/lib/core/dataflow/TiantAnalysis.d.ts +37 -0
- package/lib/core/dataflow/TiantAnalysis.d.ts.map +1 -0
- package/lib/core/dataflow/TiantAnalysis.js +326 -0
- package/lib/core/dataflow/UndefinedVariable.d.ts +32 -0
- package/lib/core/dataflow/UndefinedVariable.d.ts.map +1 -0
- package/lib/core/dataflow/UndefinedVariable.js +235 -0
- package/lib/core/dataflow/Util.d.ts +8 -0
- package/lib/core/dataflow/Util.d.ts.map +1 -0
- package/lib/core/dataflow/Util.js +137 -0
- package/lib/core/graph/BasicBlock.d.ts +26 -0
- package/lib/core/graph/BasicBlock.d.ts.map +1 -0
- package/lib/core/graph/BasicBlock.js +92 -0
- package/lib/core/graph/Cfg.d.ts +29 -0
- package/lib/core/graph/Cfg.d.ts.map +1 -0
- package/lib/core/graph/Cfg.js +154 -0
- package/lib/core/graph/DominanceFinder.d.ts +16 -0
- package/lib/core/graph/DominanceFinder.d.ts.map +1 -0
- package/lib/core/graph/DominanceFinder.js +121 -0
- package/lib/core/graph/DominanceTree.d.ts +13 -0
- package/lib/core/graph/DominanceTree.d.ts.map +1 -0
- package/lib/core/graph/DominanceTree.js +70 -0
- package/lib/core/graph/ViewTree.d.ts +115 -0
- package/lib/core/graph/ViewTree.d.ts.map +1 -0
- package/lib/core/graph/ViewTree.js +16 -0
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts +204 -0
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -0
- package/lib/core/graph/builder/ViewTreeBuilder.js +1046 -0
- package/lib/core/model/ArkBody.d.ts +22 -0
- package/lib/core/model/ArkBody.d.ts.map +1 -0
- package/lib/core/model/ArkBody.js +63 -0
- package/lib/core/model/ArkClass.d.ts +110 -0
- package/lib/core/model/ArkClass.d.ts.map +1 -0
- package/lib/core/model/ArkClass.js +315 -0
- package/lib/core/model/ArkExport.d.ts +70 -0
- package/lib/core/model/ArkExport.d.ts.map +1 -0
- package/lib/core/model/ArkExport.js +143 -0
- package/lib/core/model/ArkField.d.ts +60 -0
- package/lib/core/model/ArkField.d.ts.map +1 -0
- package/lib/core/model/ArkField.js +157 -0
- package/lib/core/model/ArkFile.d.ts +62 -0
- package/lib/core/model/ArkFile.d.ts.map +1 -0
- package/lib/core/model/ArkFile.js +160 -0
- package/lib/core/model/ArkImport.d.ts +43 -0
- package/lib/core/model/ArkImport.d.ts.map +1 -0
- package/lib/core/model/ArkImport.js +109 -0
- package/lib/core/model/ArkMethod.d.ts +76 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -0
- package/lib/core/model/ArkMethod.js +235 -0
- package/lib/core/model/ArkNamespace.d.ts +65 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -0
- package/lib/core/model/ArkNamespace.js +182 -0
- package/lib/core/model/ArkSignature.d.ts +98 -0
- package/lib/core/model/ArkSignature.d.ts.map +1 -0
- package/lib/core/model/ArkSignature.js +281 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts +13 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkClassBuilder.js +422 -0
- package/lib/core/model/builder/ArkExportBuilder.d.ts +25 -0
- package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkExportBuilder.js +207 -0
- package/lib/core/model/builder/ArkFieldBuilder.d.ts +9 -0
- package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkFieldBuilder.js +189 -0
- package/lib/core/model/builder/ArkFileBuilder.d.ts +10 -0
- package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkFileBuilder.js +164 -0
- package/lib/core/model/builder/ArkImportBuilder.d.ts +4 -0
- package/lib/core/model/builder/ArkImportBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkImportBuilder.js +125 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +60 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkMethodBuilder.js +419 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +5 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.js +171 -0
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkSignatureBuilder.js +40 -0
- package/lib/core/model/builder/builderUtils.d.ts +18 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -0
- package/lib/core/model/builder/builderUtils.js +449 -0
- package/lib/index.d.ts +77 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +190 -0
- package/lib/save/ArkStream.d.ts +24 -0
- package/lib/save/ArkStream.d.ts.map +1 -0
- package/lib/save/ArkStream.js +83 -0
- package/lib/save/DotPrinter.d.ts +48 -0
- package/lib/save/DotPrinter.d.ts.map +1 -0
- package/lib/save/DotPrinter.js +229 -0
- package/lib/save/GraphPrinter.d.ts +17 -0
- package/lib/save/GraphPrinter.d.ts.map +1 -0
- package/lib/save/GraphPrinter.js +135 -0
- package/lib/save/JsonPrinter.d.ts +28 -0
- package/lib/save/JsonPrinter.d.ts.map +1 -0
- package/lib/save/JsonPrinter.js +511 -0
- package/lib/save/Printer.d.ts +17 -0
- package/lib/save/Printer.d.ts.map +1 -0
- package/lib/save/Printer.js +27 -0
- package/lib/save/PrinterBuilder.d.ts +38 -0
- package/lib/save/PrinterBuilder.d.ts.map +1 -0
- package/lib/save/PrinterBuilder.js +102 -0
- package/lib/save/serializeArkIR.d.ts +3 -0
- package/lib/save/serializeArkIR.d.ts.map +1 -0
- package/lib/save/serializeArkIR.js +166 -0
- package/lib/save/source/SourceBase.d.ts +32 -0
- package/lib/save/source/SourceBase.d.ts.map +1 -0
- package/lib/save/source/SourceBase.js +93 -0
- package/lib/save/source/SourceBody.d.ts +60 -0
- package/lib/save/source/SourceBody.d.ts.map +1 -0
- package/lib/save/source/SourceBody.js +292 -0
- package/lib/save/source/SourceClass.d.ts +27 -0
- package/lib/save/source/SourceClass.d.ts.map +1 -0
- package/lib/save/source/SourceClass.js +202 -0
- package/lib/save/source/SourceField.d.ts +15 -0
- package/lib/save/source/SourceField.d.ts.map +1 -0
- package/lib/save/source/SourceField.js +68 -0
- package/lib/save/source/SourceFilePrinter.d.ts +14 -0
- package/lib/save/source/SourceFilePrinter.d.ts.map +1 -0
- package/lib/save/source/SourceFilePrinter.js +73 -0
- package/lib/save/source/SourceMethod.d.ts +24 -0
- package/lib/save/source/SourceMethod.d.ts.map +1 -0
- package/lib/save/source/SourceMethod.js +170 -0
- package/lib/save/source/SourceModule.d.ts +18 -0
- package/lib/save/source/SourceModule.d.ts.map +1 -0
- package/lib/save/source/SourceModule.js +120 -0
- package/lib/save/source/SourceNamespace.d.ts +13 -0
- package/lib/save/source/SourceNamespace.d.ts.map +1 -0
- package/lib/save/source/SourceNamespace.js +80 -0
- package/lib/save/source/SourceStmt.d.ts +172 -0
- package/lib/save/source/SourceStmt.d.ts.map +1 -0
- package/lib/save/source/SourceStmt.js +757 -0
- package/lib/save/source/SourceTransformer.d.ts +37 -0
- package/lib/save/source/SourceTransformer.d.ts.map +1 -0
- package/lib/save/source/SourceTransformer.js +338 -0
- package/lib/save/source/SourceUtils.d.ts +25 -0
- package/lib/save/source/SourceUtils.d.ts.map +1 -0
- package/lib/save/source/SourceUtils.js +201 -0
- package/lib/transformer/FunctionTransformer.d.ts +3 -0
- package/lib/transformer/FunctionTransformer.d.ts.map +1 -0
- package/lib/transformer/FunctionTransformer.js +17 -0
- package/lib/transformer/SceneTransformer.d.ts +3 -0
- package/lib/transformer/SceneTransformer.d.ts.map +1 -0
- package/lib/transformer/SceneTransformer.js +17 -0
- package/lib/transformer/StaticSingleAssignmentFormer.d.ts +13 -0
- package/lib/transformer/StaticSingleAssignmentFormer.d.ts.map +1 -0
- package/lib/transformer/StaticSingleAssignmentFormer.js +259 -0
- package/lib/transformer/Transformer.d.ts +7 -0
- package/lib/transformer/Transformer.d.ts.map +1 -0
- package/lib/transformer/Transformer.js +22 -0
- package/lib/utils/CfgStructualAnalysis.d.ts +93 -0
- package/lib/utils/CfgStructualAnalysis.d.ts.map +1 -0
- package/lib/utils/CfgStructualAnalysis.js +955 -0
- package/lib/utils/FileUtils.d.ts +18 -0
- package/lib/utils/FileUtils.d.ts.map +1 -0
- package/lib/utils/FileUtils.js +131 -0
- package/lib/utils/callGraphUtils.d.ts +31 -0
- package/lib/utils/callGraphUtils.d.ts.map +1 -0
- package/lib/utils/callGraphUtils.js +208 -0
- package/lib/utils/entryMethodUtils.d.ts +16 -0
- package/lib/utils/entryMethodUtils.d.ts.map +1 -0
- package/lib/utils/entryMethodUtils.js +139 -0
- package/lib/utils/getAllFiles.d.ts +10 -0
- package/lib/utils/getAllFiles.d.ts.map +1 -0
- package/lib/utils/getAllFiles.js +91 -0
- package/lib/utils/json5parser.d.ts +7 -0
- package/lib/utils/json5parser.d.ts.map +1 -0
- package/lib/utils/json5parser.js +146 -0
- package/lib/utils/logger.d.ts +19 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +90 -0
- package/lib/utils/pathTransfer.d.ts +2 -0
- package/lib/utils/pathTransfer.d.ts.map +1 -0
- package/lib/utils/pathTransfer.js +25 -0
- package/package.json +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Type.d.ts","sourceRoot":"","sources":["../../../src/core/base/Type.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,SAAS,EAAE,UAAU,EA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,CAAkD;WAE9D,WAAW,CAAC,SAAS,EAAE,kBAAkB,GAAG,uBAAuB;IAM1E,qBAAqB,IAAI,kBAAkB;IAI3C,qBAAqB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;gBAIrD,UAAU,EAAE,MAAM;IAIvB,aAAa,IAAI,MAAM;CAGjC;AAED,qBAAa,uBAAwB,SAAQ,cAAc;gBAC3C,UAAU,EAAE,MAAM;CAGjC"}
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 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.AnnotationTypeQueryType = exports.AnnotationNamespaceType = exports.AnnotationType = exports.AliasTypeDeclaration = exports.GenericType = exports.AliasType = exports.TupleType = exports.ArrayType = exports.ClassType = exports.FunctionType = exports.NeverType = exports.VoidType = exports.UnionType = exports.LiteralType = exports.UndefinedType = exports.NullType = exports.StringType = exports.NumberType = exports.BooleanType = exports.PrimitiveType = exports.UnclearReferenceType = exports.UnknownType = exports.AnyType = exports.Type = void 0;
|
|
18
|
+
const ArkSignature_1 = require("../model/ArkSignature");
|
|
19
|
+
const ArkExport_1 = require("../model/ArkExport");
|
|
20
|
+
/**
|
|
21
|
+
* @category core/base/type
|
|
22
|
+
*/
|
|
23
|
+
class Type {
|
|
24
|
+
}
|
|
25
|
+
exports.Type = Type;
|
|
26
|
+
/**
|
|
27
|
+
* any type
|
|
28
|
+
* @category core/base/type
|
|
29
|
+
*/
|
|
30
|
+
class AnyType extends Type {
|
|
31
|
+
static getInstance() {
|
|
32
|
+
return this.INSTANCE;
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
toString() {
|
|
38
|
+
return 'any';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.AnyType = AnyType;
|
|
42
|
+
AnyType.INSTANCE = new AnyType();
|
|
43
|
+
/**
|
|
44
|
+
* unknown type
|
|
45
|
+
* @category core/base/type
|
|
46
|
+
*/
|
|
47
|
+
class UnknownType extends Type {
|
|
48
|
+
static getInstance() {
|
|
49
|
+
return this.INSTANCE;
|
|
50
|
+
}
|
|
51
|
+
constructor() {
|
|
52
|
+
super();
|
|
53
|
+
}
|
|
54
|
+
toString() {
|
|
55
|
+
return 'unknown';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.UnknownType = UnknownType;
|
|
59
|
+
UnknownType.INSTANCE = new UnknownType();
|
|
60
|
+
// /**
|
|
61
|
+
// * typeParameter type
|
|
62
|
+
// * @category core/base/type
|
|
63
|
+
// */
|
|
64
|
+
// export class TypeParameterType extends Type {
|
|
65
|
+
// private name: string;
|
|
66
|
+
// private type: Type;
|
|
67
|
+
//
|
|
68
|
+
// constructor(name: string, type: Type = UnknownType.getInstance()) {
|
|
69
|
+
// super();
|
|
70
|
+
// this.name = name;
|
|
71
|
+
// this.type = type;
|
|
72
|
+
// }
|
|
73
|
+
//
|
|
74
|
+
// public getName() {
|
|
75
|
+
// return this.name;
|
|
76
|
+
// }
|
|
77
|
+
//
|
|
78
|
+
// public getType() {
|
|
79
|
+
// return this.type;
|
|
80
|
+
// }
|
|
81
|
+
//
|
|
82
|
+
// public toString() {
|
|
83
|
+
// return this.name;
|
|
84
|
+
// }
|
|
85
|
+
// }
|
|
86
|
+
/**
|
|
87
|
+
* unclear type
|
|
88
|
+
* @category core/base/type
|
|
89
|
+
*/
|
|
90
|
+
class UnclearReferenceType extends Type {
|
|
91
|
+
constructor(name, genericTypes = []) {
|
|
92
|
+
super();
|
|
93
|
+
this.name = name;
|
|
94
|
+
this.genericTypes = genericTypes;
|
|
95
|
+
}
|
|
96
|
+
getName() {
|
|
97
|
+
return this.name;
|
|
98
|
+
}
|
|
99
|
+
getGenericTypes() {
|
|
100
|
+
return this.genericTypes;
|
|
101
|
+
}
|
|
102
|
+
toString() {
|
|
103
|
+
let str = this.name;
|
|
104
|
+
if (this.genericTypes.length > 0) {
|
|
105
|
+
str += '<' + this.genericTypes.join(',') + '>';
|
|
106
|
+
}
|
|
107
|
+
return str;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.UnclearReferenceType = UnclearReferenceType;
|
|
111
|
+
/**
|
|
112
|
+
* primitive type
|
|
113
|
+
* @category core/base/type
|
|
114
|
+
*/
|
|
115
|
+
class PrimitiveType extends Type {
|
|
116
|
+
constructor(name) {
|
|
117
|
+
super();
|
|
118
|
+
this.name = name;
|
|
119
|
+
}
|
|
120
|
+
getName() {
|
|
121
|
+
return this.name;
|
|
122
|
+
}
|
|
123
|
+
toString() {
|
|
124
|
+
return this.name;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.PrimitiveType = PrimitiveType;
|
|
128
|
+
class BooleanType extends PrimitiveType {
|
|
129
|
+
constructor() {
|
|
130
|
+
super('boolean');
|
|
131
|
+
}
|
|
132
|
+
static getInstance() {
|
|
133
|
+
return this.INSTANCE;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.BooleanType = BooleanType;
|
|
137
|
+
BooleanType.INSTANCE = new BooleanType();
|
|
138
|
+
class NumberType extends PrimitiveType {
|
|
139
|
+
constructor() {
|
|
140
|
+
super('number');
|
|
141
|
+
}
|
|
142
|
+
static getInstance() {
|
|
143
|
+
return this.INSTANCE;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.NumberType = NumberType;
|
|
147
|
+
NumberType.INSTANCE = new NumberType();
|
|
148
|
+
class StringType extends PrimitiveType {
|
|
149
|
+
constructor() {
|
|
150
|
+
super('string');
|
|
151
|
+
}
|
|
152
|
+
static getInstance() {
|
|
153
|
+
return this.INSTANCE;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.StringType = StringType;
|
|
157
|
+
StringType.INSTANCE = new StringType();
|
|
158
|
+
/**
|
|
159
|
+
* null type
|
|
160
|
+
* @category core/base/type
|
|
161
|
+
*/
|
|
162
|
+
class NullType extends PrimitiveType {
|
|
163
|
+
static getInstance() {
|
|
164
|
+
return this.INSTANCE;
|
|
165
|
+
}
|
|
166
|
+
constructor() {
|
|
167
|
+
super('null');
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.NullType = NullType;
|
|
171
|
+
NullType.INSTANCE = new NullType();
|
|
172
|
+
/**
|
|
173
|
+
* undefined type
|
|
174
|
+
* @category core/base/type
|
|
175
|
+
*/
|
|
176
|
+
class UndefinedType extends PrimitiveType {
|
|
177
|
+
static getInstance() {
|
|
178
|
+
return this.INSTANCE;
|
|
179
|
+
}
|
|
180
|
+
constructor() {
|
|
181
|
+
super('undefined');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.UndefinedType = UndefinedType;
|
|
185
|
+
UndefinedType.INSTANCE = new UndefinedType();
|
|
186
|
+
/**
|
|
187
|
+
* literal type
|
|
188
|
+
* @category core/base/type
|
|
189
|
+
*/
|
|
190
|
+
class LiteralType extends PrimitiveType {
|
|
191
|
+
constructor(literalName) {
|
|
192
|
+
super('literal');
|
|
193
|
+
this.literalName = literalName;
|
|
194
|
+
}
|
|
195
|
+
getLiteralName() {
|
|
196
|
+
return this.literalName;
|
|
197
|
+
}
|
|
198
|
+
toString() {
|
|
199
|
+
return this.literalName.toString();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.LiteralType = LiteralType;
|
|
203
|
+
LiteralType.TRUE = new LiteralType(true);
|
|
204
|
+
LiteralType.FALSE = new LiteralType(false);
|
|
205
|
+
/**
|
|
206
|
+
* union type
|
|
207
|
+
* @category core/base/type
|
|
208
|
+
*/
|
|
209
|
+
class UnionType extends Type {
|
|
210
|
+
constructor(types, currType = UnknownType.getInstance()) {
|
|
211
|
+
super();
|
|
212
|
+
this.types = [...types];
|
|
213
|
+
this.currType = currType;
|
|
214
|
+
}
|
|
215
|
+
getTypes() {
|
|
216
|
+
return this.types;
|
|
217
|
+
}
|
|
218
|
+
getCurrType() {
|
|
219
|
+
return this.currType;
|
|
220
|
+
}
|
|
221
|
+
setCurrType(newType) {
|
|
222
|
+
this.currType = newType;
|
|
223
|
+
}
|
|
224
|
+
toString() {
|
|
225
|
+
let typeStr = this.types.join('|');
|
|
226
|
+
if (!(this.currType instanceof UnknownType) && this.currType != this) {
|
|
227
|
+
typeStr += '-' + this.currType;
|
|
228
|
+
}
|
|
229
|
+
return typeStr;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.UnionType = UnionType;
|
|
233
|
+
/**
|
|
234
|
+
* types for function void return type
|
|
235
|
+
* @category core/base/type
|
|
236
|
+
*/
|
|
237
|
+
class VoidType extends Type {
|
|
238
|
+
static getInstance() {
|
|
239
|
+
return this.INSTANCE;
|
|
240
|
+
}
|
|
241
|
+
constructor() {
|
|
242
|
+
super();
|
|
243
|
+
}
|
|
244
|
+
toString() {
|
|
245
|
+
return 'void';
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
exports.VoidType = VoidType;
|
|
249
|
+
VoidType.INSTANCE = new VoidType();
|
|
250
|
+
class NeverType extends Type {
|
|
251
|
+
static getInstance() {
|
|
252
|
+
return this.INSTANCE;
|
|
253
|
+
}
|
|
254
|
+
constructor() {
|
|
255
|
+
super();
|
|
256
|
+
}
|
|
257
|
+
toString() {
|
|
258
|
+
return 'never';
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
exports.NeverType = NeverType;
|
|
262
|
+
NeverType.INSTANCE = new NeverType();
|
|
263
|
+
/**
|
|
264
|
+
* function type
|
|
265
|
+
* @category core/base/type
|
|
266
|
+
*/
|
|
267
|
+
class FunctionType extends Type {
|
|
268
|
+
constructor(methodSignature, realGenericTypes) {
|
|
269
|
+
super();
|
|
270
|
+
this.methodSignature = methodSignature;
|
|
271
|
+
this.realGenericTypes = realGenericTypes;
|
|
272
|
+
}
|
|
273
|
+
getMethodSignature() {
|
|
274
|
+
return this.methodSignature;
|
|
275
|
+
}
|
|
276
|
+
getRealGenericTypes() {
|
|
277
|
+
return this.realGenericTypes;
|
|
278
|
+
}
|
|
279
|
+
toString() {
|
|
280
|
+
return this.methodSignature.toString();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
exports.FunctionType = FunctionType;
|
|
284
|
+
/**
|
|
285
|
+
* type of an object
|
|
286
|
+
* @category core/base/type
|
|
287
|
+
*/
|
|
288
|
+
class ClassType extends Type {
|
|
289
|
+
constructor(classSignature, realGenericTypes) {
|
|
290
|
+
super();
|
|
291
|
+
this.classSignature = classSignature;
|
|
292
|
+
this.realGenericTypes = realGenericTypes;
|
|
293
|
+
}
|
|
294
|
+
getClassSignature() {
|
|
295
|
+
return this.classSignature;
|
|
296
|
+
}
|
|
297
|
+
setClassSignature(newClassSignature) {
|
|
298
|
+
this.classSignature = newClassSignature;
|
|
299
|
+
}
|
|
300
|
+
getRealGenericTypes() {
|
|
301
|
+
return this.realGenericTypes;
|
|
302
|
+
}
|
|
303
|
+
setRealGenericTypes(types) {
|
|
304
|
+
this.realGenericTypes = types;
|
|
305
|
+
}
|
|
306
|
+
toString() {
|
|
307
|
+
return this.classSignature.toString();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
exports.ClassType = ClassType;
|
|
311
|
+
class ArrayType extends Type {
|
|
312
|
+
constructor(baseType, dimension) {
|
|
313
|
+
super();
|
|
314
|
+
this.baseType = baseType;
|
|
315
|
+
this.dimension = dimension;
|
|
316
|
+
}
|
|
317
|
+
getBaseType() {
|
|
318
|
+
return this.baseType;
|
|
319
|
+
}
|
|
320
|
+
setBaseType(newType) {
|
|
321
|
+
this.baseType = newType;
|
|
322
|
+
}
|
|
323
|
+
getDimension() {
|
|
324
|
+
return this.dimension;
|
|
325
|
+
}
|
|
326
|
+
toString() {
|
|
327
|
+
const strs = [];
|
|
328
|
+
if (this.baseType instanceof UnionType) {
|
|
329
|
+
strs.push('(' + this.baseType.toString() + ')');
|
|
330
|
+
}
|
|
331
|
+
else if (this.baseType) {
|
|
332
|
+
strs.push(this.baseType.toString());
|
|
333
|
+
}
|
|
334
|
+
for (let i = 0; i < this.dimension; i++) {
|
|
335
|
+
strs.push('[]');
|
|
336
|
+
}
|
|
337
|
+
return strs.join('');
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
exports.ArrayType = ArrayType;
|
|
341
|
+
class TupleType extends Type {
|
|
342
|
+
constructor(types) {
|
|
343
|
+
super();
|
|
344
|
+
this.types = types;
|
|
345
|
+
}
|
|
346
|
+
getTypes() {
|
|
347
|
+
return this.types;
|
|
348
|
+
}
|
|
349
|
+
toString() {
|
|
350
|
+
return '[' + this.types.join(', ') + ']';
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
exports.TupleType = TupleType;
|
|
354
|
+
class AliasType extends Type {
|
|
355
|
+
constructor(name, originalType, signature) {
|
|
356
|
+
super();
|
|
357
|
+
this.name = name;
|
|
358
|
+
this.originalType = originalType;
|
|
359
|
+
this.signature = signature;
|
|
360
|
+
}
|
|
361
|
+
getName() {
|
|
362
|
+
return this.name;
|
|
363
|
+
}
|
|
364
|
+
setOriginalType(type) {
|
|
365
|
+
this.originalType = type;
|
|
366
|
+
}
|
|
367
|
+
getOriginalType() {
|
|
368
|
+
return this.originalType;
|
|
369
|
+
}
|
|
370
|
+
toString() {
|
|
371
|
+
return this.name;
|
|
372
|
+
}
|
|
373
|
+
getExportType() {
|
|
374
|
+
return ArkExport_1.ExportType.TYPE;
|
|
375
|
+
}
|
|
376
|
+
getModifiers() {
|
|
377
|
+
return new Set();
|
|
378
|
+
}
|
|
379
|
+
getSignature() {
|
|
380
|
+
return this.signature;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
exports.AliasType = AliasType;
|
|
384
|
+
class GenericType extends Type {
|
|
385
|
+
constructor(name, defaultType, constraint) {
|
|
386
|
+
super();
|
|
387
|
+
this.name = name;
|
|
388
|
+
this.defaultType = defaultType;
|
|
389
|
+
this.constraint = constraint;
|
|
390
|
+
}
|
|
391
|
+
getName() {
|
|
392
|
+
return this.name;
|
|
393
|
+
}
|
|
394
|
+
getDefaultType() {
|
|
395
|
+
return this.defaultType;
|
|
396
|
+
}
|
|
397
|
+
setDefaultType(type) {
|
|
398
|
+
this.defaultType = type;
|
|
399
|
+
}
|
|
400
|
+
getConstraint() {
|
|
401
|
+
return this.constraint;
|
|
402
|
+
}
|
|
403
|
+
setConstraint(type) {
|
|
404
|
+
this.constraint = type;
|
|
405
|
+
}
|
|
406
|
+
setIndex(index) {
|
|
407
|
+
this.index = index;
|
|
408
|
+
}
|
|
409
|
+
getIndex() {
|
|
410
|
+
var _a;
|
|
411
|
+
return (_a = this.index) !== null && _a !== void 0 ? _a : 0;
|
|
412
|
+
}
|
|
413
|
+
toString() {
|
|
414
|
+
let str = this.name;
|
|
415
|
+
if (this.constraint) {
|
|
416
|
+
str += ' extends ' + this.constraint.toString();
|
|
417
|
+
}
|
|
418
|
+
if (this.defaultType) {
|
|
419
|
+
str += ' = ' + this.defaultType.toString();
|
|
420
|
+
}
|
|
421
|
+
return str;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
exports.GenericType = GenericType;
|
|
425
|
+
class AliasTypeDeclaration {
|
|
426
|
+
constructor(sourceCode, position) {
|
|
427
|
+
this.sourceCode = sourceCode;
|
|
428
|
+
this.position = position;
|
|
429
|
+
}
|
|
430
|
+
getSourceCode() {
|
|
431
|
+
return this.sourceCode;
|
|
432
|
+
}
|
|
433
|
+
getPosition() {
|
|
434
|
+
return this.position;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
exports.AliasTypeDeclaration = AliasTypeDeclaration;
|
|
438
|
+
class AnnotationType extends Type {
|
|
439
|
+
constructor(originType) {
|
|
440
|
+
super();
|
|
441
|
+
this.originType = originType;
|
|
442
|
+
}
|
|
443
|
+
getOriginType() {
|
|
444
|
+
return this.originType;
|
|
445
|
+
}
|
|
446
|
+
toString() {
|
|
447
|
+
return this.originType;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
exports.AnnotationType = AnnotationType;
|
|
451
|
+
class AnnotationNamespaceType extends AnnotationType {
|
|
452
|
+
static getInstance(signature) {
|
|
453
|
+
const type = new AnnotationNamespaceType(signature.getNamespaceName());
|
|
454
|
+
type.setNamespaceSignature(signature);
|
|
455
|
+
return type;
|
|
456
|
+
}
|
|
457
|
+
getNamespaceSignature() {
|
|
458
|
+
return this.namespaceSignature;
|
|
459
|
+
}
|
|
460
|
+
setNamespaceSignature(signature) {
|
|
461
|
+
this.namespaceSignature = signature;
|
|
462
|
+
}
|
|
463
|
+
constructor(originType) {
|
|
464
|
+
super(originType);
|
|
465
|
+
this.namespaceSignature = ArkSignature_1.NamespaceSignature.DEFAULT;
|
|
466
|
+
}
|
|
467
|
+
getOriginType() {
|
|
468
|
+
return super.getOriginType();
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
exports.AnnotationNamespaceType = AnnotationNamespaceType;
|
|
472
|
+
class AnnotationTypeQueryType extends AnnotationType {
|
|
473
|
+
constructor(originType) {
|
|
474
|
+
super(originType);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
exports.AnnotationTypeQueryType = AnnotationTypeQueryType;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Type } from './Type';
|
|
2
|
+
/**
|
|
3
|
+
* @category core/base
|
|
4
|
+
*/
|
|
5
|
+
export interface Value {
|
|
6
|
+
/** Return a list of values which are contained in this value */
|
|
7
|
+
getUses(): Value[];
|
|
8
|
+
/** Return the type of this value */
|
|
9
|
+
getType(): Type;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=Value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../src/core/base/Value.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB,gEAAgE;IAChE,OAAO,IAAI,KAAK,EAAE,CAAC;IAEnB,oCAAoC;IACpC,OAAO,IAAG,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024 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 });
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BinaryOperator, UnaryOperator } from '../base/Expr';
|
|
2
|
+
import { Value } from '../base/Value';
|
|
3
|
+
import * as ts from 'ohos-typescript';
|
|
4
|
+
import { Local } from '../base/Local';
|
|
5
|
+
import { Stmt } from '../base/Stmt';
|
|
6
|
+
import { AliasType, AliasTypeDeclaration } from '../base/Type';
|
|
7
|
+
import { ArkMethod } from '../model/ArkMethod';
|
|
8
|
+
import { FullPosition } from '../base/Position';
|
|
9
|
+
export declare const DUMMY_INITIALIZER_STMT = "dummyInitializerStmt";
|
|
10
|
+
type ValueAndStmts = {
|
|
11
|
+
value: Value;
|
|
12
|
+
valueOriginalPositions: FullPosition[];
|
|
13
|
+
stmts: Stmt[];
|
|
14
|
+
};
|
|
15
|
+
export declare class ArkIRTransformer {
|
|
16
|
+
private readonly tempLocalPrefix;
|
|
17
|
+
private tempLocalIndex;
|
|
18
|
+
private locals;
|
|
19
|
+
private sourceFile;
|
|
20
|
+
private declaringMethod;
|
|
21
|
+
private thisLocal;
|
|
22
|
+
private inBuilderMethod;
|
|
23
|
+
private stmtToOriginalStmt;
|
|
24
|
+
private aliasTypeMap;
|
|
25
|
+
private builderMethodContextFlag;
|
|
26
|
+
constructor(sourceFile: ts.SourceFile, declaringMethod: ArkMethod);
|
|
27
|
+
getLocals(): Set<Local>;
|
|
28
|
+
getThisLocal(): Local;
|
|
29
|
+
getStmtToOriginalStmt(): Map<Stmt, Stmt>;
|
|
30
|
+
getAliasTypeMap(): Map<string, [AliasType, AliasTypeDeclaration]>;
|
|
31
|
+
prebuildStmts(): Stmt[];
|
|
32
|
+
tsNodeToStmts(node: ts.Node): Stmt[];
|
|
33
|
+
private returnStatementToStmts;
|
|
34
|
+
private blockToStmts;
|
|
35
|
+
private expressionStatementToStmts;
|
|
36
|
+
private expressionToStmts;
|
|
37
|
+
private typeAliasDeclarationToStmts;
|
|
38
|
+
private switchStatementToStmts;
|
|
39
|
+
private forStatementToStmts;
|
|
40
|
+
private rangeForStatementToStmts;
|
|
41
|
+
private whileStatementToStmts;
|
|
42
|
+
private doStatementToStmts;
|
|
43
|
+
private variableStatementToStmts;
|
|
44
|
+
private variableDeclarationListToStmts;
|
|
45
|
+
private ifStatementToStmts;
|
|
46
|
+
private gotoStatementToStmts;
|
|
47
|
+
private throwStatementToStmts;
|
|
48
|
+
private catchClauseToStmts;
|
|
49
|
+
tsNodeToValueAndStmts(node: ts.Node): ValueAndStmts;
|
|
50
|
+
private thisExpressionToValueAndStmts;
|
|
51
|
+
private conditionalExpressionToValueAndStmts;
|
|
52
|
+
private objectLiteralExpresionToValueAndStmts;
|
|
53
|
+
private createCustomViewStmt;
|
|
54
|
+
private etsComponentExpressionToValueAndStmts;
|
|
55
|
+
private classExpressionToValueAndStmts;
|
|
56
|
+
private templateExpressionToValueAndStmts;
|
|
57
|
+
private identifierToValueAndStmts;
|
|
58
|
+
private propertyAccessExpressionToValue;
|
|
59
|
+
private elementAccessExpressionToValueAndStmts;
|
|
60
|
+
private callExpressionToValueAndStmts;
|
|
61
|
+
private parseArguments;
|
|
62
|
+
private callableNodeToValueAndStmts;
|
|
63
|
+
private newExpressionToValueAndStmts;
|
|
64
|
+
private newArrayExpressionToValueAndStmts;
|
|
65
|
+
private arrayLiteralExpressionToValueAndStmts;
|
|
66
|
+
private prefixUnaryExpressionToValueAndStmts;
|
|
67
|
+
private postfixUnaryExpressionToValueAndStmts;
|
|
68
|
+
private awaitExpressionToValueAndStmts;
|
|
69
|
+
private yieldExpressionToValueAndStmts;
|
|
70
|
+
private deleteExpressionToValueAndStmts;
|
|
71
|
+
private voidExpressionToValueAndStmts;
|
|
72
|
+
private nonNullExpressionToValueAndStmts;
|
|
73
|
+
private parenthesizedExpressionToValueAndStmts;
|
|
74
|
+
private typeOfExpressionToValueAndStmts;
|
|
75
|
+
private asExpressionToValueAndStmts;
|
|
76
|
+
private typeAssertionToValueAndStmts;
|
|
77
|
+
private variableDeclarationListToValueAndStmts;
|
|
78
|
+
private variableDeclarationToValueAndStmts;
|
|
79
|
+
private binaryExpressionToValueAndStmts;
|
|
80
|
+
private assignmentToValueAndStmts;
|
|
81
|
+
private compoundAssignmentToValueAndStmts;
|
|
82
|
+
private compoundAssignmentTokenToBinaryOperator;
|
|
83
|
+
private conditionToValueAndStmts;
|
|
84
|
+
private literalNodeToValueAndStmts;
|
|
85
|
+
private getOrCreatLocal;
|
|
86
|
+
private generateTempLocal;
|
|
87
|
+
generateAssignStmtForValue(value: Value, valueOriginalPositions: FullPosition[]): ValueAndStmts;
|
|
88
|
+
private isRelationalOperator;
|
|
89
|
+
private resolveTypeNode;
|
|
90
|
+
private resolveLiteralTypeNode;
|
|
91
|
+
private resolveTemplateLiteralTypeNode;
|
|
92
|
+
private resolveTypeReferenceNode;
|
|
93
|
+
private resolveTypeLiteralNode;
|
|
94
|
+
private resolveFunctionTypeNode;
|
|
95
|
+
private isLiteralNode;
|
|
96
|
+
mapStmtsToTsStmt(stmts: Stmt[], node: ts.Node): void;
|
|
97
|
+
static tokenToUnaryOperator(token: ts.SyntaxKind): UnaryOperator | null;
|
|
98
|
+
static tokenToBinaryOperator(token: ts.SyntaxKind): BinaryOperator | null;
|
|
99
|
+
}
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=ArkIRTransformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArkIRTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkIRTransformer.ts"],"names":[],"mappings":"AAeA,OAAO,EAkBH,cAAc,EAGd,aAAa,EAChB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAQH,IAAI,EACP,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,SAAS,EACT,oBAAoB,EAkBvB,MAAM,cAAc,CAAC;AAYtB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAc/C,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAOjE,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAE7D,KAAK,aAAa,GAAG;IACjB,KAAK,EAAE,KAAK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