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,22 @@
|
|
|
1
|
+
import { Local } from '../base/Local';
|
|
2
|
+
import { Cfg } from '../graph/Cfg';
|
|
3
|
+
import { Stmt } from '../base/Stmt';
|
|
4
|
+
import { AliasType, AliasTypeDeclaration } from '../base/Type';
|
|
5
|
+
export declare class ArkBody {
|
|
6
|
+
private locals;
|
|
7
|
+
private originalCfg;
|
|
8
|
+
private cfg;
|
|
9
|
+
private stmtToOriginalStmt;
|
|
10
|
+
private aliasTypeMap;
|
|
11
|
+
constructor(locals: Set<Local>, originalCfg: Cfg, cfg: Cfg, stmtToOriginalStmt: Map<Stmt, Stmt>, aliasTypeMap: Map<string, [AliasType, AliasTypeDeclaration]>);
|
|
12
|
+
getLocals(): Map<string, Local>;
|
|
13
|
+
setLocals(locals: Set<Local>): void;
|
|
14
|
+
getCfg(): Cfg;
|
|
15
|
+
setCfg(cfg: Cfg): void;
|
|
16
|
+
getOriginalCfg(): Cfg;
|
|
17
|
+
setOriginalCfg(originalCfg: Cfg): void;
|
|
18
|
+
getStmtToOriginalStmt(): Map<Stmt, Stmt>;
|
|
19
|
+
getAliasTypeMap(): Map<string, [AliasType, AliasTypeDeclaration]>;
|
|
20
|
+
getAliasTypeByName(name: string): AliasType | null;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ArkBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArkBody.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBody.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE/D,qBAAa,OAAO;IAChB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,kBAAkB,CAAkB;IAC5C,OAAO,CAAC,YAAY,CAA6D;gBAErE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAStJ,SAAS,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;IAI/B,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI;IAOnC,MAAM,IAAI,GAAG;IAIb,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAItB,cAAc,IAAI,GAAG;IAIrB,cAAc,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI;IAItC,qBAAqB,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;IAIxC,eAAe,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAIjE,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAO5D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.ArkBody = void 0;
|
|
18
|
+
class ArkBody {
|
|
19
|
+
constructor(locals, originalCfg, cfg, stmtToOriginalStmt, aliasTypeMap) {
|
|
20
|
+
this.aliasTypeMap = new Map();
|
|
21
|
+
this.originalCfg = originalCfg;
|
|
22
|
+
this.cfg = cfg;
|
|
23
|
+
this.stmtToOriginalStmt = stmtToOriginalStmt;
|
|
24
|
+
this.aliasTypeMap = aliasTypeMap;
|
|
25
|
+
this.locals = new Map();
|
|
26
|
+
locals.forEach(local => this.locals.set(local.getName(), local));
|
|
27
|
+
}
|
|
28
|
+
getLocals() {
|
|
29
|
+
return this.locals;
|
|
30
|
+
}
|
|
31
|
+
setLocals(locals) {
|
|
32
|
+
if (!this.locals) {
|
|
33
|
+
this.locals = new Map();
|
|
34
|
+
}
|
|
35
|
+
locals.forEach(local => this.locals.set(local.getName(), local));
|
|
36
|
+
}
|
|
37
|
+
getCfg() {
|
|
38
|
+
return this.cfg;
|
|
39
|
+
}
|
|
40
|
+
setCfg(cfg) {
|
|
41
|
+
this.cfg = cfg;
|
|
42
|
+
}
|
|
43
|
+
getOriginalCfg() {
|
|
44
|
+
return this.originalCfg;
|
|
45
|
+
}
|
|
46
|
+
setOriginalCfg(originalCfg) {
|
|
47
|
+
this.originalCfg = originalCfg;
|
|
48
|
+
}
|
|
49
|
+
getStmtToOriginalStmt() {
|
|
50
|
+
return this.stmtToOriginalStmt;
|
|
51
|
+
}
|
|
52
|
+
getAliasTypeMap() {
|
|
53
|
+
return this.aliasTypeMap;
|
|
54
|
+
}
|
|
55
|
+
getAliasTypeByName(name) {
|
|
56
|
+
const aliasTypeInfo = this.aliasTypeMap.get(name);
|
|
57
|
+
if (aliasTypeInfo) {
|
|
58
|
+
return aliasTypeInfo[0];
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.ArkBody = ArkBody;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { GenericType } from '../base/Type';
|
|
2
|
+
import { ViewTree } from '../graph/ViewTree';
|
|
3
|
+
import { ArkField } from './ArkField';
|
|
4
|
+
import { ArkFile } from './ArkFile';
|
|
5
|
+
import { ArkMethod } from './ArkMethod';
|
|
6
|
+
import { ArkNamespace } from './ArkNamespace';
|
|
7
|
+
import { ClassSignature, FieldSignature, FileSignature, MethodSignature, NamespaceSignature } from './ArkSignature';
|
|
8
|
+
import { Local } from '../base/Local';
|
|
9
|
+
import { Decorator } from '../base/Decorator';
|
|
10
|
+
import { ArkExport, ExportType } from './ArkExport';
|
|
11
|
+
export declare enum ClassCategory {
|
|
12
|
+
CLASS = 0,
|
|
13
|
+
STRUCT = 1,
|
|
14
|
+
INTERFACE = 2,
|
|
15
|
+
ENUM = 3,
|
|
16
|
+
TYPE_LITERAL = 4,
|
|
17
|
+
OBJECT = 5
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @category core/model
|
|
21
|
+
*/
|
|
22
|
+
export declare class ArkClass implements ArkExport {
|
|
23
|
+
private category;
|
|
24
|
+
private code?;
|
|
25
|
+
private line;
|
|
26
|
+
private column;
|
|
27
|
+
private declaringArkFile;
|
|
28
|
+
private declaringArkNamespace;
|
|
29
|
+
private classSignature;
|
|
30
|
+
private superClassName;
|
|
31
|
+
private superClass?;
|
|
32
|
+
private implementedInterfaceNames;
|
|
33
|
+
private modifiers;
|
|
34
|
+
private genericsTypes?;
|
|
35
|
+
private defaultMethod;
|
|
36
|
+
private methods;
|
|
37
|
+
private fields;
|
|
38
|
+
private extendedClasses;
|
|
39
|
+
private staticMethods;
|
|
40
|
+
private staticFields;
|
|
41
|
+
private instanceInitMethod;
|
|
42
|
+
private staticInitMethod;
|
|
43
|
+
private anonymousMethodNumber;
|
|
44
|
+
private indexSignatureNumber;
|
|
45
|
+
private viewTree?;
|
|
46
|
+
constructor();
|
|
47
|
+
getName(): string;
|
|
48
|
+
getCode(): string | undefined;
|
|
49
|
+
setCode(code: string): void;
|
|
50
|
+
getLine(): number;
|
|
51
|
+
setLine(line: number): void;
|
|
52
|
+
getColumn(): number;
|
|
53
|
+
setColumn(column: number): void;
|
|
54
|
+
getCategory(): ClassCategory;
|
|
55
|
+
setCategory(category: ClassCategory): void;
|
|
56
|
+
getDeclaringArkFile(): ArkFile;
|
|
57
|
+
setDeclaringArkFile(declaringArkFile: ArkFile): void;
|
|
58
|
+
getDeclaringArkNamespace(): ArkNamespace | undefined;
|
|
59
|
+
setDeclaringArkNamespace(declaringArkNamespace: ArkNamespace | undefined): void;
|
|
60
|
+
isExported(): boolean;
|
|
61
|
+
isDefaultArkClass(): boolean;
|
|
62
|
+
isAnonymousClass(): boolean;
|
|
63
|
+
getSignature(): ClassSignature;
|
|
64
|
+
setSignature(classSig: ClassSignature): void;
|
|
65
|
+
getSuperClassName(): string;
|
|
66
|
+
setSuperClassName(superClassName: string): void;
|
|
67
|
+
getSuperClass(): ArkClass | null;
|
|
68
|
+
setSuperClass(superClass: ArkClass): void;
|
|
69
|
+
getExtendedClasses(): Map<string, ArkClass>;
|
|
70
|
+
addExtendedClass(extendedClass: ArkClass): void;
|
|
71
|
+
getImplementedInterfaceNames(): string[];
|
|
72
|
+
addImplementedInterfaceName(interfaceName: string): void;
|
|
73
|
+
hasImplementedInterface(interfaceName: string): boolean;
|
|
74
|
+
getField(fieldSignature: FieldSignature): ArkField | null;
|
|
75
|
+
getFieldWithName(fieldName: string): ArkField | null;
|
|
76
|
+
getStaticFieldWithName(fieldName: string): ArkField | null;
|
|
77
|
+
getFields(): ArkField[];
|
|
78
|
+
addField(field: ArkField): void;
|
|
79
|
+
addFields(fields: ArkField[]): void;
|
|
80
|
+
getModifiers(): Set<string | Decorator>;
|
|
81
|
+
addModifier(name: string | Decorator): void;
|
|
82
|
+
getGenericsTypes(): GenericType[] | undefined;
|
|
83
|
+
addGenericType(gType: GenericType): void;
|
|
84
|
+
containsModifier(name: string): boolean;
|
|
85
|
+
isStatic(): boolean;
|
|
86
|
+
getMethods(generated?: boolean): ArkMethod[];
|
|
87
|
+
getMethod(methodSignature: MethodSignature): ArkMethod | null;
|
|
88
|
+
getMethodWithName(methodName: string): ArkMethod | null;
|
|
89
|
+
getStaticMethodWithName(methodName: string): ArkMethod | null;
|
|
90
|
+
addMethod(method: ArkMethod): void;
|
|
91
|
+
setDefaultArkMethod(defaultMethod: ArkMethod): void;
|
|
92
|
+
getDefaultArkMethod(): ArkMethod | null;
|
|
93
|
+
setViewTree(viewTree: ViewTree): void;
|
|
94
|
+
getViewTree(): ViewTree | undefined;
|
|
95
|
+
hasViewTree(): boolean;
|
|
96
|
+
getStaticFields(classMap: Map<FileSignature | NamespaceSignature, ArkClass[]>): ArkField[];
|
|
97
|
+
getGlobalVariable(globalMap: Map<FileSignature | NamespaceSignature, Local[]>): Local[];
|
|
98
|
+
getDecorators(): Decorator[];
|
|
99
|
+
hasEntryDecorator(): boolean;
|
|
100
|
+
hasComponentDecorator(): boolean;
|
|
101
|
+
private hasDecorator;
|
|
102
|
+
getAnonymousMethodNumber(): number;
|
|
103
|
+
getIndexSignatureNumber(): number;
|
|
104
|
+
getExportType(): ExportType;
|
|
105
|
+
getInstanceInitMethod(): ArkMethod;
|
|
106
|
+
getStaticInitMethod(): ArkMethod;
|
|
107
|
+
setInstanceInitMethod(arkMethod: ArkMethod): void;
|
|
108
|
+
setStaticInitMethod(arkMethod: ArkMethod): void;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=ArkClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArkClass.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkClass.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,315 @@
|
|
|
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.ArkClass = exports.ClassCategory = void 0;
|
|
18
|
+
const Type_1 = require("../base/Type");
|
|
19
|
+
const ArkMethod_1 = require("./ArkMethod");
|
|
20
|
+
const Decorator_1 = require("../base/Decorator");
|
|
21
|
+
const EtsConst_1 = require("../common/EtsConst");
|
|
22
|
+
const ArkExport_1 = require("./ArkExport");
|
|
23
|
+
const TypeInference_1 = require("../common/TypeInference");
|
|
24
|
+
const Const_1 = require("../common/Const");
|
|
25
|
+
var ClassCategory;
|
|
26
|
+
(function (ClassCategory) {
|
|
27
|
+
ClassCategory[ClassCategory["CLASS"] = 0] = "CLASS";
|
|
28
|
+
ClassCategory[ClassCategory["STRUCT"] = 1] = "STRUCT";
|
|
29
|
+
ClassCategory[ClassCategory["INTERFACE"] = 2] = "INTERFACE";
|
|
30
|
+
ClassCategory[ClassCategory["ENUM"] = 3] = "ENUM";
|
|
31
|
+
ClassCategory[ClassCategory["TYPE_LITERAL"] = 4] = "TYPE_LITERAL";
|
|
32
|
+
ClassCategory[ClassCategory["OBJECT"] = 5] = "OBJECT";
|
|
33
|
+
})(ClassCategory = exports.ClassCategory || (exports.ClassCategory = {}));
|
|
34
|
+
/**
|
|
35
|
+
* @category core/model
|
|
36
|
+
*/
|
|
37
|
+
class ArkClass {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.line = -1;
|
|
40
|
+
this.column = -1;
|
|
41
|
+
this.superClassName = '';
|
|
42
|
+
this.implementedInterfaceNames = [];
|
|
43
|
+
this.modifiers = new Set();
|
|
44
|
+
this.defaultMethod = null;
|
|
45
|
+
// name to model
|
|
46
|
+
this.methods = new Map();
|
|
47
|
+
this.fields = new Map();
|
|
48
|
+
this.extendedClasses = new Map();
|
|
49
|
+
this.staticMethods = new Map();
|
|
50
|
+
this.staticFields = new Map();
|
|
51
|
+
this.instanceInitMethod = new ArkMethod_1.ArkMethod();
|
|
52
|
+
this.staticInitMethod = new ArkMethod_1.ArkMethod();
|
|
53
|
+
this.anonymousMethodNumber = 0;
|
|
54
|
+
this.indexSignatureNumber = 0;
|
|
55
|
+
}
|
|
56
|
+
getName() {
|
|
57
|
+
return this.classSignature.getClassName();
|
|
58
|
+
}
|
|
59
|
+
getCode() {
|
|
60
|
+
return this.code;
|
|
61
|
+
}
|
|
62
|
+
setCode(code) {
|
|
63
|
+
this.code = code;
|
|
64
|
+
}
|
|
65
|
+
getLine() {
|
|
66
|
+
return this.line;
|
|
67
|
+
}
|
|
68
|
+
setLine(line) {
|
|
69
|
+
this.line = line;
|
|
70
|
+
}
|
|
71
|
+
getColumn() {
|
|
72
|
+
return this.column;
|
|
73
|
+
}
|
|
74
|
+
setColumn(column) {
|
|
75
|
+
this.column = column;
|
|
76
|
+
}
|
|
77
|
+
getCategory() {
|
|
78
|
+
return this.category;
|
|
79
|
+
}
|
|
80
|
+
setCategory(category) {
|
|
81
|
+
this.category = category;
|
|
82
|
+
}
|
|
83
|
+
getDeclaringArkFile() {
|
|
84
|
+
return this.declaringArkFile;
|
|
85
|
+
}
|
|
86
|
+
setDeclaringArkFile(declaringArkFile) {
|
|
87
|
+
this.declaringArkFile = declaringArkFile;
|
|
88
|
+
}
|
|
89
|
+
getDeclaringArkNamespace() {
|
|
90
|
+
return this.declaringArkNamespace;
|
|
91
|
+
}
|
|
92
|
+
setDeclaringArkNamespace(declaringArkNamespace) {
|
|
93
|
+
this.declaringArkNamespace = declaringArkNamespace;
|
|
94
|
+
}
|
|
95
|
+
isExported() {
|
|
96
|
+
return this.modifiers.has('ExportKeyword');
|
|
97
|
+
}
|
|
98
|
+
isDefaultArkClass() {
|
|
99
|
+
return this.getName() === Const_1.DEFAULT_ARK_CLASS_NAME;
|
|
100
|
+
}
|
|
101
|
+
isAnonymousClass() {
|
|
102
|
+
return this.getName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX);
|
|
103
|
+
}
|
|
104
|
+
getSignature() {
|
|
105
|
+
return this.classSignature;
|
|
106
|
+
}
|
|
107
|
+
setSignature(classSig) {
|
|
108
|
+
this.classSignature = classSig;
|
|
109
|
+
}
|
|
110
|
+
getSuperClassName() {
|
|
111
|
+
return this.superClassName;
|
|
112
|
+
}
|
|
113
|
+
setSuperClassName(superClassName) {
|
|
114
|
+
this.superClassName = superClassName;
|
|
115
|
+
}
|
|
116
|
+
getSuperClass() {
|
|
117
|
+
if (this.superClass === undefined) {
|
|
118
|
+
const type = TypeInference_1.TypeInference.inferUnclearReferenceType(this.superClassName, this);
|
|
119
|
+
if (type instanceof Type_1.ClassType) {
|
|
120
|
+
let superClass = this.declaringArkFile.getScene().getClass(type.getClassSignature());
|
|
121
|
+
if (superClass) {
|
|
122
|
+
superClass.addExtendedClass(this);
|
|
123
|
+
this.superClass = superClass;
|
|
124
|
+
return this.superClass;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
this.superClass = null;
|
|
128
|
+
}
|
|
129
|
+
return this.superClass;
|
|
130
|
+
}
|
|
131
|
+
setSuperClass(superClass) {
|
|
132
|
+
this.superClass = superClass;
|
|
133
|
+
}
|
|
134
|
+
getExtendedClasses() {
|
|
135
|
+
return this.extendedClasses;
|
|
136
|
+
}
|
|
137
|
+
addExtendedClass(extendedClass) {
|
|
138
|
+
this.extendedClasses.set(extendedClass.getName(), extendedClass);
|
|
139
|
+
}
|
|
140
|
+
getImplementedInterfaceNames() {
|
|
141
|
+
return this.implementedInterfaceNames;
|
|
142
|
+
}
|
|
143
|
+
addImplementedInterfaceName(interfaceName) {
|
|
144
|
+
this.implementedInterfaceNames.push(interfaceName);
|
|
145
|
+
}
|
|
146
|
+
hasImplementedInterface(interfaceName) {
|
|
147
|
+
return (this.implementedInterfaceNames.indexOf(interfaceName) > -1);
|
|
148
|
+
}
|
|
149
|
+
getField(fieldSignature) {
|
|
150
|
+
const fieldName = fieldSignature.getFieldName();
|
|
151
|
+
let fieldSearched = this.getFieldWithName(fieldName);
|
|
152
|
+
if (!fieldSearched) {
|
|
153
|
+
fieldSearched = this.getStaticFieldWithName(fieldName);
|
|
154
|
+
}
|
|
155
|
+
return fieldSearched;
|
|
156
|
+
}
|
|
157
|
+
getFieldWithName(fieldName) {
|
|
158
|
+
return this.fields.get(fieldName) || null;
|
|
159
|
+
}
|
|
160
|
+
getStaticFieldWithName(fieldName) {
|
|
161
|
+
return this.staticFields.get(fieldName) || null;
|
|
162
|
+
}
|
|
163
|
+
getFields() {
|
|
164
|
+
const allFields = Array.from(this.fields.values());
|
|
165
|
+
allFields.push(...this.staticFields.values());
|
|
166
|
+
return allFields;
|
|
167
|
+
}
|
|
168
|
+
addField(field) {
|
|
169
|
+
if (field.isStatic()) {
|
|
170
|
+
this.staticFields.set(field.getName(), field);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.fields.set(field.getName(), field);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
addFields(fields) {
|
|
177
|
+
fields.forEach((field) => {
|
|
178
|
+
this.addField(field);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
getModifiers() {
|
|
182
|
+
return this.modifiers;
|
|
183
|
+
}
|
|
184
|
+
addModifier(name) {
|
|
185
|
+
this.modifiers.add(name);
|
|
186
|
+
}
|
|
187
|
+
getGenericsTypes() {
|
|
188
|
+
return this.genericsTypes;
|
|
189
|
+
}
|
|
190
|
+
addGenericType(gType) {
|
|
191
|
+
if (!this.genericsTypes) {
|
|
192
|
+
this.genericsTypes = [];
|
|
193
|
+
}
|
|
194
|
+
this.genericsTypes.push(gType);
|
|
195
|
+
}
|
|
196
|
+
containsModifier(name) {
|
|
197
|
+
return this.modifiers.has(name);
|
|
198
|
+
}
|
|
199
|
+
isStatic() {
|
|
200
|
+
if (this.modifiers.has('StaticKeyword')) {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
getMethods(generated) {
|
|
206
|
+
const allMethods = Array.from(this.methods.values())
|
|
207
|
+
.filter(f => !generated && !f.isGenerated() || generated);
|
|
208
|
+
allMethods.push(...this.staticMethods.values());
|
|
209
|
+
return allMethods;
|
|
210
|
+
}
|
|
211
|
+
getMethod(methodSignature) {
|
|
212
|
+
const methodName = methodSignature.getMethodSubSignature().getMethodName();
|
|
213
|
+
let methodSearched = this.getMethodWithName(methodName);
|
|
214
|
+
if (!methodSearched) {
|
|
215
|
+
methodSearched = this.getStaticMethodWithName(methodName);
|
|
216
|
+
}
|
|
217
|
+
return methodSearched;
|
|
218
|
+
}
|
|
219
|
+
getMethodWithName(methodName) {
|
|
220
|
+
return this.methods.get(methodName) || null;
|
|
221
|
+
}
|
|
222
|
+
getStaticMethodWithName(methodName) {
|
|
223
|
+
return this.staticMethods.get(methodName) || null;
|
|
224
|
+
}
|
|
225
|
+
addMethod(method) {
|
|
226
|
+
if (method.getModifiers().has('StaticKeyword')) {
|
|
227
|
+
this.staticMethods.set(method.getName(), method);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
this.methods.set(method.getName(), method);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
setDefaultArkMethod(defaultMethod) {
|
|
234
|
+
this.defaultMethod = defaultMethod;
|
|
235
|
+
this.addMethod(defaultMethod);
|
|
236
|
+
}
|
|
237
|
+
getDefaultArkMethod() {
|
|
238
|
+
return this.defaultMethod;
|
|
239
|
+
}
|
|
240
|
+
setViewTree(viewTree) {
|
|
241
|
+
this.viewTree = viewTree;
|
|
242
|
+
}
|
|
243
|
+
getViewTree() {
|
|
244
|
+
return this.viewTree;
|
|
245
|
+
}
|
|
246
|
+
hasViewTree() {
|
|
247
|
+
return this.viewTree != undefined;
|
|
248
|
+
}
|
|
249
|
+
getStaticFields(classMap) {
|
|
250
|
+
const fields = [];
|
|
251
|
+
let classes = [];
|
|
252
|
+
if (this.declaringArkNamespace) {
|
|
253
|
+
classes = classMap.get(this.declaringArkNamespace.getNamespaceSignature());
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
classes = classMap.get(this.declaringArkFile.getFileSignature());
|
|
257
|
+
}
|
|
258
|
+
for (const arkClass of classes) {
|
|
259
|
+
for (const field of arkClass.getFields()) {
|
|
260
|
+
if (field.isStatic()) {
|
|
261
|
+
fields.push(field);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return fields;
|
|
266
|
+
}
|
|
267
|
+
getGlobalVariable(globalMap) {
|
|
268
|
+
if (this.declaringArkNamespace) {
|
|
269
|
+
return globalMap.get(this.declaringArkNamespace.getNamespaceSignature());
|
|
270
|
+
}
|
|
271
|
+
return globalMap.get(this.declaringArkFile.getFileSignature());
|
|
272
|
+
}
|
|
273
|
+
getDecorators() {
|
|
274
|
+
return Array.from(this.modifiers).filter((item) => {
|
|
275
|
+
return item instanceof Decorator_1.Decorator;
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
hasEntryDecorator() {
|
|
279
|
+
return this.hasDecorator(EtsConst_1.ENTRY_DECORATOR);
|
|
280
|
+
}
|
|
281
|
+
hasComponentDecorator() {
|
|
282
|
+
return this.hasDecorator(EtsConst_1.COMPONENT_DECORATOR);
|
|
283
|
+
}
|
|
284
|
+
hasDecorator(kind) {
|
|
285
|
+
let decorators = this.getDecorators();
|
|
286
|
+
return decorators.filter((value) => {
|
|
287
|
+
if (kind instanceof Set) {
|
|
288
|
+
return kind.has(value.getKind());
|
|
289
|
+
}
|
|
290
|
+
return value.getKind() == kind;
|
|
291
|
+
}).length != 0;
|
|
292
|
+
}
|
|
293
|
+
getAnonymousMethodNumber() {
|
|
294
|
+
return this.anonymousMethodNumber++;
|
|
295
|
+
}
|
|
296
|
+
getIndexSignatureNumber() {
|
|
297
|
+
return this.indexSignatureNumber++;
|
|
298
|
+
}
|
|
299
|
+
getExportType() {
|
|
300
|
+
return ArkExport_1.ExportType.CLASS;
|
|
301
|
+
}
|
|
302
|
+
getInstanceInitMethod() {
|
|
303
|
+
return this.instanceInitMethod;
|
|
304
|
+
}
|
|
305
|
+
getStaticInitMethod() {
|
|
306
|
+
return this.staticInitMethod;
|
|
307
|
+
}
|
|
308
|
+
setInstanceInitMethod(arkMethod) {
|
|
309
|
+
this.instanceInitMethod = arkMethod;
|
|
310
|
+
}
|
|
311
|
+
setStaticInitMethod(arkMethod) {
|
|
312
|
+
this.staticInitMethod = arkMethod;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
exports.ArkClass = ArkClass;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { LineColPosition } from '../base/Position';
|
|
2
|
+
import { Decorator } from '../base/Decorator';
|
|
3
|
+
import { ArkFile } from './ArkFile';
|
|
4
|
+
import { ArkSignature, ClassSignature, LocalSignature, MethodSignature, NamespaceSignature } from './ArkSignature';
|
|
5
|
+
export type ExportSignature = NamespaceSignature | ClassSignature | MethodSignature | LocalSignature;
|
|
6
|
+
export declare enum ExportType {
|
|
7
|
+
NAME_SPACE = 0,
|
|
8
|
+
CLASS = 1,
|
|
9
|
+
METHOD = 2,
|
|
10
|
+
LOCAL = 3,
|
|
11
|
+
TYPE = 4,
|
|
12
|
+
UNKNOWN = 9
|
|
13
|
+
}
|
|
14
|
+
export interface ArkExport extends ArkSignature {
|
|
15
|
+
getModifiers(): Set<string | Decorator>;
|
|
16
|
+
getName(): string;
|
|
17
|
+
getExportType(): ExportType;
|
|
18
|
+
}
|
|
19
|
+
export interface FromInfo {
|
|
20
|
+
isDefault(): boolean;
|
|
21
|
+
getOriginName(): string;
|
|
22
|
+
getFrom(): string | undefined;
|
|
23
|
+
getDeclaringArkFile(): ArkFile;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @category core/model
|
|
27
|
+
*/
|
|
28
|
+
export declare class ExportInfo implements FromInfo {
|
|
29
|
+
private modifiers;
|
|
30
|
+
private _default?;
|
|
31
|
+
private nameBeforeAs?;
|
|
32
|
+
private exportClauseName;
|
|
33
|
+
private exportClauseType;
|
|
34
|
+
private arkExport?;
|
|
35
|
+
private exportFrom?;
|
|
36
|
+
private originTsPosition?;
|
|
37
|
+
private tsSourceCode?;
|
|
38
|
+
private declaringArkFile;
|
|
39
|
+
private constructor();
|
|
40
|
+
getFrom(): string | undefined;
|
|
41
|
+
getOriginName(): string;
|
|
42
|
+
getExportClauseName(): string;
|
|
43
|
+
setExportClauseType(exportClauseType: ExportType): void;
|
|
44
|
+
getExportClauseType(): ExportType;
|
|
45
|
+
getNameBeforeAs(): string | undefined;
|
|
46
|
+
setArkExport(value: ArkExport | null): void;
|
|
47
|
+
getArkExport(): ArkExport | undefined | null;
|
|
48
|
+
isDefault(): boolean;
|
|
49
|
+
getModifiers(): Set<string | Decorator>;
|
|
50
|
+
getOriginTsPosition(): LineColPosition;
|
|
51
|
+
getTsSourceCode(): string;
|
|
52
|
+
getDeclaringArkFile(): ArkFile;
|
|
53
|
+
static Builder: {
|
|
54
|
+
new (): {
|
|
55
|
+
exportInfo: ExportInfo;
|
|
56
|
+
exportClauseName(exportClauseName: string): any;
|
|
57
|
+
exportClauseType(exportClauseType: ExportType): any;
|
|
58
|
+
nameBeforeAs(nameBeforeAs: string): any;
|
|
59
|
+
addModifier(name: string | Decorator): any;
|
|
60
|
+
modifiers(modifiers: Set<string | Decorator>): any;
|
|
61
|
+
originTsPosition(originTsPosition: LineColPosition): any;
|
|
62
|
+
tsSourceCode(tsSourceCode: string): any;
|
|
63
|
+
declaringArkFile(value: ArkFile): any;
|
|
64
|
+
arkExport(value: ArkExport): any;
|
|
65
|
+
exportFrom(exportFrom: string): any;
|
|
66
|
+
build(): ExportInfo;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=ArkExport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArkExport.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkExport.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAInH,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,CAAC;AAErG,oBAAY,UAAU;IAClB,UAAU,IAAI;IACd,KAAK,IAAI;IACT,MAAM,IAAI;IACV,KAAK,IAAI;IACT,IAAI,IAAI;IACR,OAAO,IAAI;CACd;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAE3C,YAAY,IAAI,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAExC,OAAO,IAAI,MAAM,CAAC;IAElB,aAAa,IAAI,UAAU,CAAC;CAE/B;AAED,MAAM,WAAW,QAAQ;IACrB,SAAS,IAAI,OAAO,CAAC;IAErB,aAAa,IAAI,MAAM,CAAC;IAExB,OAAO,IAAI,MAAM,GAAG,SAAS,CAAC;IAE9B,mBAAmB,IAAI,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,UAAW,YAAW,QAAQ;IAEvC,OAAO,CAAC,SAAS,CAAsC;IACvD,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,gBAAgB,CAAc;IAEtC,OAAO,CAAC,gBAAgB,CAAkC;IAC1D,OAAO,CAAC,SAAS,CAAC,CAAmB;IACrC,OAAO,CAAC,UAAU,CAAC,CAAS;IAE5B,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,gBAAgB,CAAW;IAEnC,OAAO;IAGA,OAAO,IAAI,MAAM,GAAG,SAAS;IAI7B,aAAa,IAAI,MAAM;IAIvB,mBAAmB,IAAI,MAAM;IAI7B,mBAAmB,CAAC,gBAAgB,EAAE,UAAU,GAAG,IAAI;IAIvD,mBAAmB,IAAI,UAAU;IAIjC,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIpC,YAAY,IAAI,SAAS,GAAG,SAAS,GAAG,IAAI;IAI5C,SAAS,IAAI,OAAO;IAUpB,YAAY,IAAI,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC;IAIvC,mBAAmB,IAAI,eAAe;IAItC,eAAe,IAAI,MAAM;IAIzB,mBAAmB,IAAI,OAAO;IAIrC,OAAc,OAAO;;wBACL,UAAU;+CAEoB,MAAM;+CAKN,UAAU;uCAKlB,MAAM;8BAKf,MAAM,GAAG,SAAS;iCAQf,IAAI,MAAM,GAAG,SAAS,CAAC;+CAOT,eAAe;uCAKvB,MAAM;oCAKT,OAAO;6BAKd,SAAS;mCAKH,MAAM;qBAOpB,UAAU;;MAG5B;CAEL"}
|