/arkcompiler/ets_frontend/ets2panda/parser/ |
D | TSparser.h | 22 namespace panda::es2panda::ir { 41 …ir::TypeNode *ParseTypeAnnotationElement(ir::TypeNode *typeAnnotation, TypeAnnotationParsingOption… 42 ir::TypeNode *ParseTypeOperatorOrTypeReference(); 43 ir::TypeNode *ParseIdentifierReference(); 44 ir::TypeNode *ParseBasicType(); 45 ir::TSTypeReference *ParseConstExpression(); 46 …ir::TSIntersectionType *ParseIntersectionType(ir::Expression *type, bool inUnion, bool restrictExt… 47 ir::TSUnionType *ParseUnionType(ir::TypeNode *type, bool restrictExtends); 48 ir::TypeNode *ParseParenthesizedOrFunctionType(ir::TypeNode *typeAnnotation, bool throwError); 49 ir::TSArrayType *ParseArrayType(ir::TypeNode *elementType); [all …]
|
D | ETSparser.h | 24 namespace panda::es2panda::ir { 63 ir::Expression *CreateExpression(std::string_view sourceCode, 67 …ir::Expression *CreateFormattedExpression(std::string_view sourceCode, std::vector<ir::AstNode *> … 71 …ir::Expression *CreateFormattedExpression(std::string_view const sourceCode, std::string_view cons… in CreateFormattedExpression() 74 std::vector<ir::AstNode *> insertingNodes {}; in CreateFormattedExpression() 80 ArenaVector<ir::Statement *> CreateStatements(std::string_view sourceCode, 83 ArenaVector<ir::Statement *> CreateFormattedStatements(std::string_view sourceCode, 84 … std::vector<ir::AstNode *> &insertingNodes, 88 ArenaVector<ir::Statement *> CreateFormattedStatements(std::string_view const sourceCode, in CreateFormattedStatements() 91 std::vector<ir::AstNode *> insertingNodes {}; in CreateFormattedStatements() [all …]
|
D | TypedParser.h | 21 namespace panda::es2panda::ir { 34 void ParseDecorators(ArenaVector<ir::Decorator *> &decorators); 36 …ir::TSModuleDeclaration *ParseAmbientExternalModuleDeclaration(const lexer::SourcePosition &startL… 37 ir::TSModuleBlock *ParseTsModuleBlock(); 38 … ir::TSModuleDeclaration *ParseModuleOrNamespaceDeclaration(const lexer::SourcePosition &startLoc); 39 ArenaVector<ir::AstNode *> ParseTypeLiteralOrInterface(); 40 …void CheckObjectTypeForDuplicatedProperties(ir::Expression *key, ArenaVector<ir::AstNode *> &membe… 42 ir::ArrowFunctionExpression *ParseGenericArrowFunction(); 43 ir::TSTypeAssertion *ParseTypeAssertion(); 44 …ir::TSTypeParameterInstantiation *ParseTypeParameterInstantiation(TypeAnnotationParsingOptions *op… [all …]
|
D | parserImpl.h | 46 namespace panda::es2panda::ir { 108 using FunctionSignature = std::tuple<ir::FunctionSignature, panda::es2panda::ir::ScriptFunctionFlag… 115 ArenaVector<ir::Decorator *> decorators; 116 ir::MethodDefinitionKind methodKind {}; 118 ir::ModifierFlags modifiers {}; 138 …explicit ArrowFunctionDescriptor(ArenaVector<ir::Expression *> &&p, lexer::SourcePosition sl, Pars… in ArrowFunctionDescriptor() 144 ArenaVector<ir::Expression *> params; 211 static ir::VariableDeclaratorFlag GetFlag(VariableParsingFlags flags); 212 …ir::MethodDefinition *CheckClassMethodOverload(ir::Statement *property, ir::MethodDefinition **cto… 213 … lexer::SourcePosition errorInfo, ir::MethodDefinition *lastOverload, [all …]
|
D | ASparser.h | 32 ir::TypeNode *ParseParenthesizedOrFunctionType(bool throwError); 33 ir::TypeNode *ParseFunctionType(lexer::SourcePosition startLoc); 34 void ParseOptionalFunctionParameter(ir::AnnotatedExpression *returnNode, bool inRest = false); 37 … ir::Statement *ParseStatement(StatementParsingFlags flags = StatementParsingFlags::NONE) override; 39 ir::Expression *ParsePatternElement(ExpressionParseFlags flags = ExpressionParseFlags::NO_OPTS, 42 ir::Expression *ParsePropertyDefinition( 45 ir::TypeNode *ParseTypeAnnotation(TypeAnnotationParsingOptions *options) override; 46 ir::ArrowFunctionExpression *ParsePotentialArrowExpression(ir::Expression **returnExpression, 48 …bool ParsePotentialGenericFunctionCall(ir::Expression *primaryExpr, ir::Expression **returnExpress… 50 …bool ParsePotentialNonNullExpression(ir::Expression **returnExpression, lexer::SourcePosition star… [all …]
|
D | parserImpl.cpp | 94 auto *blockStmt = AllocNode<ir::BlockStatement>(Allocator(), std::move(statements)); in ParseProgram() 116 ir::ModifierFlags ParserImpl::GetAccessability(ir::ModifierFlags modifiers) in GetAccessability() 118 if ((modifiers & ir::ModifierFlags::PUBLIC) != 0) { in GetAccessability() 119 return ir::ModifierFlags::PUBLIC; in GetAccessability() 122 if ((modifiers & ir::ModifierFlags::PRIVATE) != 0) { in GetAccessability() 123 return ir::ModifierFlags::PRIVATE; in GetAccessability() 126 if ((modifiers & ir::ModifierFlags::PROTECTED) != 0) { in GetAccessability() 127 return ir::ModifierFlags::PROTECTED; in GetAccessability() 130 if ((modifiers & ir::ModifierFlags::INTERNAL) != 0) { in GetAccessability() 131 return ir::ModifierFlags::INTERNAL; in GetAccessability() [all …]
|
D | TypedParser.cpp | 61 ir::Expression *TypedParser::ParsePotentialAsExpression([[maybe_unused]] ir::Expression *primaryExp… in ParsePotentialAsExpression() 67 ir::Expression *TypedParser::ParseExpression(ExpressionParseFlags flags) in ParseExpression() 71 ir::YieldExpression *yieldExpr = ParseYieldExpression(); in ParseExpression() 80 ir::Expression *expr = ParseGenericArrowFunction(); in ParseExpression() 90 ir::Expression *unaryExpressionNode = ParseUnaryOrPrefixUpdateExpression(flags); in ParseExpression() 96 ir::Expression *assignmentExpression = ParseAssignmentExpression(unaryExpressionNode, flags); in ParseExpression() 124 ir::Statement *TypedParser::ParsePotentialExpressionStatement(StatementParsingFlags flags) in ParsePotentialExpressionStatement() 140 …return ParseClassStatement(flags, ir::ClassDefinitionModifiers::NONE, ir::ModifierFlags::ABSTRACT); in ParsePotentialExpressionStatement() 154 ir::TSTypeAssertion *TypedParser::ParseTypeAssertion() in ParseTypeAssertion() 161 ir::TypeNode *typeAnnotation = ParseTypeAnnotation(&options); in ParseTypeAssertion() [all …]
|
/arkcompiler/ets_frontend/es2panda/parser/ |
D | parserImpl.h | 46 namespace panda::es2panda::ir { 130 ir::MethodDefinitionKind methodKind {}; 132 ir::ModifierFlags modifiers {}; 147 …explicit ArrowFunctionDescriptor(ArenaVector<ir::Expression *> &&p, binder::FunctionParamScope *ps, in ArrowFunctionDescriptor() 153 ArenaVector<ir::Expression *> params; 209 [[noreturn]] void ThrowParameterModifierError(ir::ModifierFlags status) const; in DEFINE_BITOPS() 240 void AddCommonjsParams(ArenaVector<ir::Expression *> ¶ms); in DEFINE_BITOPS() 241 void AddReflectApplyArgs(ArenaVector<ir::Expression *> &args, ir::FunctionExpression *wrapper); in DEFINE_BITOPS() 243 bool CheckTopStatementsForRequiredDeclare(const ArenaVector<ir::Statement *> &statements); in DEFINE_BITOPS() 250 static bool IsPropertyKeysAreSame(const ir::Expression *exp1, const ir::Expression *exp2); in DEFINE_BITOPS() [all …]
|
D | commonjs.cpp | 39 void ParserImpl::AddCommonjsParams(ArenaVector<ir::Expression *> ¶ms) in AddCommonjsParams() 42 ir::Expression *param = AllocNode<ir::Identifier>(paramName); in AddCommonjsParams() 49 void ParserImpl::AddReflectApplyArgs(ArenaVector<ir::Expression *> &args, ir::FunctionExpression *w… in AddReflectApplyArgs() 55 …ir::Expression *thisValue = AllocNode<ir::Identifier>(binder::Binder::CJS_MANDATORY_PARAM_EXPORTS); in AddReflectApplyArgs() 59 ArenaVector<ir::Expression *> elements(Allocator()->Adapter()); in AddReflectApplyArgs() 61 ir::Expression *arg = AllocNode<ir::Identifier>(argName); in AddReflectApplyArgs() 65 ir::ArrayExpression *wrapperArgsArray = in AddReflectApplyArgs() 66 … AllocNode<ir::ArrayExpression>(ir::AstNodeType::ARRAY_EXPRESSION, std::move(elements), false); in AddReflectApplyArgs() 73 ir::FunctionExpression *wrapper = nullptr; in ParseCommonjs() 79 ArenaVector<ir::Expression *> params(Allocator()->Adapter()); in ParseCommonjs() [all …]
|
/arkcompiler/ets_frontend/ets2panda/compiler/core/ |
D | pandagen.h | 37 namespace panda::es2panda::ir { 71 void StoreAccumulator(const ir::AstNode *node, VReg vreg); 72 void LoadAccumulator(const ir::AstNode *node, VReg reg); 74 [[nodiscard]] IRNode *AllocMov(const ir::AstNode *node, VReg vd, VReg vs) override; 75 [[nodiscard]] IRNode *AllocMov(const ir::AstNode *node, OutVReg vd, VReg vs) override; 76 void MoveVreg(const ir::AstNode *node, VReg vd, VReg vs); 78 void LoadAccumulatorDouble(const ir::AstNode *node, double num); 79 void LoadAccumulatorInt(const ir::AstNode *node, size_t num); 81 void LoadConst(const ir::AstNode *node, Constant id); 82 void StoreConst(const ir::AstNode *node, VReg reg, Constant id); [all …]
|
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/scopesInit/ |
D | scopesInitPhase.h | 39 class ScopesInitPhase : public Phase, public ir::visitor::IterateAstVisitor { 84 void CallFuncParams(const ArenaVector<ir::Expression *> ¶ms); 85 void IterateNoTParams(ir::ClassDefinition *classDef); 90 void VisitFunctionExpression(ir::FunctionExpression *funcExpr) override; 91 void VisitScriptFunction(ir::ScriptFunction *scriptFunction) override; 92 void VisitBlockStatement(ir::BlockStatement *blockStmt) override; 93 void VisitImportDeclaration(ir::ImportDeclaration *importDeclaration) override; 94 void VisitClassStaticBlock(ir::ClassStaticBlock *staticBlock) override; 95 void VisitClassDefinition(ir::ClassDefinition *classDef) override; 96 void VisitMethodDefinition(ir::MethodDefinition *methodDefinition) override; [all …]
|
/arkcompiler/ets_frontend/es2panda/parser/transformer/ |
D | transformer.h | 43 using ComputedPropertyMap = std::unordered_map<ir::Statement *, util::StringView>; 48 const ir::ClassDefinition *node; 55 ir::Expression *key; 57 ir::MethodDefinitionKind kind; 58 ir::ModifierFlags modifiers; 65 util::StringView aliasName, ir::ClassDefinition *node) in DuringClass() 112 void PushVariablesToNearestStatements(ir::BlockStatement *ast); 114 ir::AstNode *VisitTSNodes(ir::AstNode *parent); 115 ir::UpdateNodes VisitTSNode(ir::AstNode *childNode); 116 …ir::UpdateNodes VisitTsModuleDeclaration(ir::TSModuleDeclaration *childNode, bool isExport = false… [all …]
|
D | transformer.cpp | 93 ir::AstNode *Transformer::VisitTSNodes(ir::AstNode *parent) in VisitTSNodes() 130 void Transformer::PushVariablesToNearestStatements(ir::BlockStatement *ast) in PushVariablesToNearestStatements() 196 ir::UpdateNodes Transformer::VisitTSNode(ir::AstNode *childNode) in VisitTSNode() 200 case ir::AstNodeType::IDENTIFIER: { in VisitTSNode() 230 case ir::AstNodeType::TS_MODULE_DECLARATION: { in VisitTSNode() 239 case ir::AstNodeType::TS_ENUM_DECLARATION: { in VisitTSNode() 248 case ir::AstNodeType::EXPORT_NAMED_DECLARATION: { in VisitTSNode() 281 return VisitExportClassDeclaration<ir::ExportNamedDeclaration>(node); in VisitTSNode() 286 case ir::AstNodeType::EXPORT_DEFAULT_DECLARATION: { in VisitTSNode() 291 return VisitExportClassDeclaration<ir::ExportDefaultDeclaration>(node); in VisitTSNode() [all …]
|
/arkcompiler/ets_frontend/es2panda/compiler/core/ |
D | pandagen.h | 38 namespace panda::es2panda::ir { 74 const ir::Statement *firstStmt {}; 130 const ir::AstNode *RootNode() const in RootNode() 286 void InitializeLexEnv(const ir::AstNode *node); 287 void CopyFunctionArguments(const ir::AstNode *node); 288 void GetFunctionObject(const ir::AstNode *node); 289 void GetNewTarget(const ir::AstNode *node); 290 void GetThis(const ir::AstNode *node); 291 void SetThis(const ir::AstNode *node); 292 void LoadVar(const ir::Identifier *node, const binder::ScopeFindResult &result); [all …]
|
/arkcompiler/ets_frontend/es2panda/ |
D | CMakeLists.txt | 101 ir/astDump.cpp 102 ir/base/catchClause.cpp 103 ir/base/classDefinition.cpp 104 ir/base/classProperty.cpp 105 ir/base/decorator.cpp 106 ir/base/metaProperty.cpp 107 ir/base/methodDefinition.cpp 108 ir/base/property.cpp 109 ir/base/scriptFunction.cpp 110 ir/base/spreadElement.cpp [all …]
|
D | BUILD.gn | 54 "ir/astDump.cpp", 55 "ir/base/catchClause.cpp", 56 "ir/base/classDefinition.cpp", 57 "ir/base/classProperty.cpp", 58 "ir/base/classStaticBlock.cpp", 59 "ir/base/decorator.cpp", 60 "ir/base/metaProperty.cpp", 61 "ir/base/methodDefinition.cpp", 62 "ir/base/property.cpp", 63 "ir/base/scriptFunction.cpp", [all …]
|
/arkcompiler/ets_frontend/es2panda/typescript/extractor/ |
D | typeExtractor.h | 27 using Getter = std::function<int64_t(const ir::AstNode *, bool isNewInstance)>; 28 using Handler = std::function<void(const ir::AstNode *)>; 32 …explicit TypeExtractor(const ir::BlockStatement *rootNode, bool typeDtsExtractor, bool typeDtsBuil… 44 const ir::Identifier *GetIdentifierFromExpression(const ir::Expression *expression); 45 …const ir::AstNode *GetDeclNodeFromIdentifier(const ir::Identifier *identifier, const ir::Identifie… 46 …int64_t GetTypeIndexFromAnnotation(const ir::Expression *typeAnnotation, bool isNewInstance = true… 47 int64_t GetTypeIndexFromIdentifier(const ir::Identifier *identifier); 48 int64_t GetTypeIndexFromInitializer(const ir::Expression *initializer); 49 int64_t GetTypeIndexFromClassInst(int64_t typeIndex, const ir::AstNode *node, 64 bool AddSearchingTypeRefNodes(const ir::Expression * node) in AddSearchingTypeRefNodes() [all …]
|
/arkcompiler/ets_frontend/ets2panda/varbinder/ |
D | ETSBinder.h | 26 using ComputedLambdaObjects = ArenaMap<const ir::AstNode *, std::pair<ir::ClassDefinition *, checke… 29 const ir::ETSImportDeclaration *import; 30 const ir::AstNode *specifier; 108 void HandleCustomNodes(ir::AstNode *childNode) override; 111 void BuildClassDefinition(ir::ClassDefinition *classDef) override; 112 void BuildClassProperty(const ir::ClassProperty *prop) override; 113 void LookupIdentReference(ir::Identifier *ident) override; 114 bool BuildInternalName(ir::ScriptFunction *scriptFunc) override; 115 void AddCompilableFunction(ir::ScriptFunction *func) override; 117 void LookupTypeReference(ir::Identifier *ident, bool allowDynamicNamespaces); [all …]
|
/arkcompiler/ets_frontend/ets2panda/checker/ |
D | ETSchecker.h | 64 using DynamicCallIntrinsicsMap = ArenaUnorderedMap<Language, ArenaUnorderedMap<util::StringView, ir… 131 Type *CheckTypeCached(ir::Expression *expr) override; 143 ETSObjectType *BuildClassProperties(ir::ClassDefinition *classDef); 144 …ETSObjectType *BuildAnonymousClassProperties(ir::ClassDefinition *classDef, ETSObjectType *superTy… 145 ETSObjectType *BuildInterfaceProperties(ir::TSInterfaceDeclaration *interfaceDecl); 154 void ValidateArrayIndex(ir::Expression *expr, bool relaxed = false); 155 void ValidateTupleIndex(const ETSTupleType *tuple, const ir::MemberExpression *expr); 156 …ETSObjectType *CheckThisOrSuperAccess(ir::Expression *node, ETSObjectType *classType, std::string_… 158 ETSTypeParameter *SetUpParameterType(ir::TSTypeParameter *param); 163 void CheckClassDefinition(ir::ClassDefinition *classDef); [all …]
|
/arkcompiler/ets_frontend/ets2panda/checker/ets/ |
D | aliveAnalyzer.h | 24 namespace panda::es2panda::ir { 37 AliveAnalyzer(const ir::AstNode *node, ETSChecker *checker) : BaseAnalyzer(), checker_(checker) in AliveAnalyzer() 58 void AnalyzeNodes(const ir::AstNode *node); 59 void AnalyzeNode(const ir::AstNode *node); 60 void AnalyzeDef(const ir::AstNode *node); 61 void AnalyzeStat(const ir::AstNode *node); 62 void AnalyzeStats(const ArenaVector<ir::Statement *> &stats); 63 void AnalyzeStructDecl(const ir::ETSStructDeclaration *structDecl); 64 void AnalyzeClassDecl(const ir::ClassDeclaration *classDecl); 65 void AnalyzeClassDef(const ir::ClassDefinition *classDef); [all …]
|
D | dynamic.cpp | 49 ir::ETSParameterExpression *ETSChecker::AddParam(varbinder::FunctionParamScope *paramScope, util::S… in AddParam() 53 auto *paramIdent = AllocNode<ir::Identifier>(name, Allocator()); in AddParam() 54 auto *param = AllocNode<ir::ETSParameterExpression>(paramIdent, nullptr); in AddParam() 62 static bool IsByValueCall(varbinder::ETSBinder *varbinder, ir::Expression *callee) in IsByValueCall() 85 ir::ScriptFunction *ETSChecker::CreateDynamicCallIntrinsic(ir::Expression *callee, const ArenaVecto… in CreateDynamicCallIntrinsic() 88 auto *name = AllocNode<ir::Identifier>("invoke", Allocator()); in CreateDynamicCallIntrinsic() 92 ArenaVector<ir::Expression *> params(Allocator()->Adapter()); in CreateDynamicCallIntrinsic() 103 ir::ETSParameterExpression *param2; in CreateDynamicCallIntrinsic() 117 ir::ETSParameterExpression *param = AddParam(paramScope, paramName.View(), paramType); in CreateDynamicCallIntrinsic() 122 …auto *func = AllocNode<ir::ScriptFunction>(ir::FunctionSignature(nullptr, std::move(params), nullp… in CreateDynamicCallIntrinsic() [all …]
|
/arkcompiler/ets_frontend/ets2panda/ |
D | BUILD.gn | 175 "ir/as/namedType.cpp", 176 "ir/as/prefixAssertionExpression.cpp", 177 "ir/astDump.cpp", 178 "ir/astNode.cpp", 179 "ir/base/catchClause.cpp", 180 "ir/base/classDefinition.cpp", 181 "ir/base/classElement.cpp", 182 "ir/base/classProperty.cpp", 183 "ir/base/classStaticBlock.cpp", 184 "ir/base/decorator.cpp", [all …]
|
D | CMakeLists.txt | 163 ir/astDump.cpp 164 ir/srcDump.cpp 165 ir/astNode.cpp 166 ir/irnode.cpp 167 ir/typeNode.cpp 168 ir/opaqueTypeNode.cpp 169 ir/base/catchClause.cpp 170 ir/base/classElement.cpp 171 ir/base/classDefinition.cpp 172 ir/base/classProperty.cpp [all …]
|
/arkcompiler/ets_frontend/ets2panda/public/ |
D | es2panda_lib.cpp | 132 static ir::ModifierFlags E2pToIrAccessFlags(es2panda_ModifierFlags e2pFlags) in E2pToIrAccessFlags() 134 ir::ModifierFlags irFlags {ir::ModifierFlags::NONE}; in E2pToIrAccessFlags() 135 …irFlags |= (e2pFlags & ES2PANDA_MODIFIER_PUBLIC) != 0 ? ir::ModifierFlags::PUBLIC : ir::ModifierFl… in E2pToIrAccessFlags() 136 …irFlags |= (e2pFlags & ES2PANDA_MODIFIER_PROTECTED) != 0 ? ir::ModifierFlags::PROTECTED : ir::Modi… in E2pToIrAccessFlags() 137 …irFlags |= (e2pFlags & ES2PANDA_MODIFIER_PRIVATE) != 0 ? ir::ModifierFlags::PRIVATE : ir::Modifier… in E2pToIrAccessFlags() 138 …irFlags |= (e2pFlags & ES2PANDA_MODIFIER_INTERNAL) != 0 ? ir::ModifierFlags::INTERNAL : ir::Modifi… in E2pToIrAccessFlags() 143 static ir::ModifierFlags E2pToIrMethodFlags(es2panda_ModifierFlags e2pFlags) in E2pToIrMethodFlags() 145 ir::ModifierFlags irFlags {ir::ModifierFlags::NONE}; in E2pToIrMethodFlags() 146 …irFlags |= (e2pFlags & ES2PANDA_MODIFIER_STATIC) != 0 ? ir::ModifierFlags::STATIC : ir::ModifierFl… in E2pToIrMethodFlags() 147 …irFlags |= (e2pFlags & ES2PANDA_MODIFIER_ABSTRACT) != 0 ? ir::ModifierFlags::ABSTRACT : ir::Modifi… in E2pToIrMethodFlags() [all …]
|
/arkcompiler/ets_frontend/ets2panda/test/unit/ |
D | node_creator.h | 34 ir::VariableDeclaration *CreateVarDecl(bool declare, util::StringView name = "x") 36 …auto varDecl = alloc_->New<ir::VariableDeclarator>(ir::VariableDeclaratorFlag::LET, CreateId(name)… 37 ArenaVector<ir::VariableDeclarator *> tmp {alloc_->Adapter()}; 39 …return alloc_->New<ir::VariableDeclaration>(ir::VariableDeclaration::VariableDeclarationKind::LET,… 43 ir::Identifier *CreateId(util::StringView x) in CreateId() 45 return alloc_->New<ir::Identifier>(x, alloc_); in CreateId() 49 ir::UpdateExpression *CreateIncrement(util::StringView name = "x", bool isPrefix = false) 51 …return alloc_->New<ir::UpdateExpression>(CreateId(name), lexer::TokenType::PUNCTUATOR_PLUS_PLUS, i… 55 ir::BinaryExpression *CreateLessCmpExpr(util::StringView name = "x") 58 return alloc_->New<ir::BinaryExpression>(CreateId(name), [all …]
|