Lines Matching +full:parserprogram +full:-
7 * http://www.apache.org/licenses/LICENSE-2.0
32 if (node->IsClassDeclaration()) { in GetHierarchyDeclarationFileName()
33 if (node->AsClassDeclaration()->Definition()->Ident()->Range().start.Program() == nullptr) { in GetHierarchyDeclarationFileName()
36 …return std::string(node->AsClassDeclaration()->Definition()->Ident()->Range().start.Program()->Abs… in GetHierarchyDeclarationFileName()
38 if (node->IsTSInterfaceDeclaration()) { in GetHierarchyDeclarationFileName()
39 if (node->AsTSInterfaceDeclaration()->Id()->Range().start.Program() == nullptr) { in GetHierarchyDeclarationFileName()
42 …return std::string(node->AsTSInterfaceDeclaration()->Id()->Range().start.Program()->AbsoluteName()… in GetHierarchyDeclarationFileName()
52 if (node->IsClassDeclaration()) { in GetHierarchyDeclarationName()
53 return std::string(node->AsClassDeclaration()->Definition()->Ident()->Name()); in GetHierarchyDeclarationName()
55 if (node->IsTSInterfaceDeclaration()) { in GetHierarchyDeclarationName()
56 return std::string(node->AsTSInterfaceDeclaration()->Id()->Name()); in GetHierarchyDeclarationName()
66 if (node->IsClassDeclaration()) { in GetHierarchyType()
69 if (node->IsTSInterfaceDeclaration()) { in GetHierarchyType()
80 if (node->IsClassDeclaration()) { in GetPosition()
81 return node->AsClassDeclaration()->Definition()->Ident()->Start().index; in GetPosition()
83 if (node->IsTSInterfaceDeclaration()) { in GetPosition()
84 return node->AsTSInterfaceDeclaration()->Id()->Start().index; in GetPosition()
91 if (node == nullptr || !node->IsClassDeclaration()) { in GetEffectiveBaseTypeNode()
94 auto super = node->AsClassDeclaration()->Definition()->Super(); in GetEffectiveBaseTypeNode()
95 if (super == nullptr || !super->IsETSTypeReference()) { in GetEffectiveBaseTypeNode()
98 auto id = super->AsETSTypeReference()->Part()->Name(); in GetEffectiveBaseTypeNode()
99 if (id == nullptr || !id->IsIdentifier()) { in GetEffectiveBaseTypeNode()
102 auto result = compiler::DeclarationFromIdentifier(id->AsIdentifier()); in GetEffectiveBaseTypeNode()
103 if (result == nullptr || !result->IsClassDefinition()) { in GetEffectiveBaseTypeNode()
106 return result->Parent(); in GetEffectiveBaseTypeNode()
112 if (node == nullptr || !node->IsTSInterfaceDeclaration()) { in GetInterfaceExtendsHeritageElement()
115 auto extends = node->AsTSInterfaceDeclaration()->Extends(); in GetInterfaceExtendsHeritageElement()
117 auto id = e->Expr()->AsETSTypeReference()->Part()->Name(); in GetInterfaceExtendsHeritageElement()
118 result.push_back(compiler::DeclarationFromIdentifier(id->AsIdentifier())); in GetInterfaceExtendsHeritageElement()
141 if (node == nullptr || !node->IsClassDeclaration()) { in GetEffectiveImplementsTypeNodes()
144 auto implements = node->AsClassDeclaration()->Definition()->Implements(); in GetEffectiveImplementsTypeNodes()
147 … imp->AsTSClassImplements()->Expr()->AsETSTypeReference()->Part()->Name()->AsIdentifier())); in GetEffectiveImplementsTypeNodes()
177 if (tmp->IsClassDeclaration() || tmp->IsTSInterfaceDeclaration()) { in GetCurrentClassOrInterfaceDeclaration()
180 tmp = tmp->Parent(); in GetCurrentClassOrInterfaceDeclaration()
220 if (ctx->parserProgram == nullptr || ctx->parserProgram->Ast() == nullptr) { in GetImplementationReferenceEntries()
223 auto astNode = reinterpret_cast<ir::AstNode *>(ctx->parserProgram->Ast()); in GetImplementationReferenceEntries()
224 astNode->IterateRecursively([&subLists, node, &result](ir::AstNode *child) { in GetImplementationReferenceEntries()
225 … if (child == nullptr || (!child->IsClassDeclaration() && !child->IsTSInterfaceDeclaration())) { in GetImplementationReferenceEntries()
252 if (node == nullptr || (!node->IsTSInterfaceDeclaration() && !node->IsClassDeclaration())) { in GetSubTypeHierarchies()
286 if (ctx->parserProgram == nullptr || ctx->parserProgram->Ast() == nullptr) { in GetTypeHierarchiesImpl()
292 …if (declaration == nullptr || (!declaration->IsTSInterfaceDeclaration() && !declaration->IsClassDe… in GetTypeHierarchiesImpl()
312 * @param node - current class node declaration
317 if (!node->IsClassDeclaration()) { in GetClassDirectSuperClass()
320 auto classNode = node->AsClassDeclaration()->Definition(); in GetClassDirectSuperClass()
321 auto super = classNode->Super(); in GetClassDirectSuperClass()
322 if (super == nullptr || !super->IsETSTypeReference()) { in GetClassDirectSuperClass()
325 auto part = super->AsETSTypeReference()->Part(); in GetClassDirectSuperClass()
326 if (part == nullptr || !part->IsETSTypeReferencePart()) { in GetClassDirectSuperClass()
329 auto partNode = part->AsETSTypeReferencePart()->Name(); in GetClassDirectSuperClass()
330 if (partNode == nullptr || !partNode->IsIdentifier()) { in GetClassDirectSuperClass()
333 auto superClass = compiler::DeclarationFromIdentifier(partNode->AsIdentifier()); in GetClassDirectSuperClass()
334 if (superClass->IsClassDefinition()) { in GetClassDirectSuperClass()
335 return superClass->Parent(); in GetClassDirectSuperClass()
342 * @param context - Compiler context (unused)
343 * @param node - Current class declaration node
365 * @param program - Pointer to the program AST
366 * @param node - Current class declaration node
376 if (!node->IsClassDeclaration()) { in GetClassDirectSubClasses()
379 auto rootNode = program->Ast(); in GetClassDirectSubClasses()
383 auto statements = rootNode->Statements(); in GetClassDirectSubClasses()
385 if (!statement->IsClassDeclaration()) { in GetClassDirectSubClasses()
398 * @param context - Compiler context containing program AST
399 * @param node - Current class declaration node
405 auto program = pctx->parserProgram; in GetClassSubClasses()
436 * @param node - Current class declaration node
445 if (!node->IsClassDeclaration()) { in GetClassDirectImplementedInterfaces()
448 auto classDefinition = node->AsClassDeclaration()->Definition(); in GetClassDirectImplementedInterfaces()
449 auto implements = classDefinition->Implements(); in GetClassDirectImplementedInterfaces()
455 auto interfaceDecl = compiler::DeclarationFromIdentifier(partNode->AsIdentifier()); in GetClassDirectImplementedInterfaces()
456 if (interfaceDecl->IsTSInterfaceDeclaration()) { in GetClassDirectImplementedInterfaces()
465 * @param node - Current declaration node
474 if (!node->IsTSInterfaceDeclaration()) { in GetInterfaceDirectExtendedInterfaces()
477 auto childInterface = node->AsTSInterfaceDeclaration(); in GetInterfaceDirectExtendedInterfaces()
478 auto extends = childInterface->Extends(); in GetInterfaceDirectExtendedInterfaces()
480 auto partNode = GetIdentifierFromTSInterfaceHeritage(extend->AsTSInterfaceHeritage()); in GetInterfaceDirectExtendedInterfaces()
481 if (partNode == nullptr || !partNode->IsIdentifier()) { in GetInterfaceDirectExtendedInterfaces()
484 auto interfaceDecl = compiler::DeclarationFromIdentifier(partNode->AsIdentifier()); in GetInterfaceDirectExtendedInterfaces()
485 if (interfaceDecl->IsTSInterfaceDeclaration()) { in GetInterfaceDirectExtendedInterfaces()
494 * @param context - Compiler context (unused)
495 * @param node - Current class declaration node
546 * @param context - Compiler context (unused)
547 * @param node - Current interface node
561 auto extends = currentNode->AsTSInterfaceDeclaration()->Extends(); in GetInterfaceSuperInterfaces()
567 auto interfaceDecl = compiler::DeclarationFromIdentifier(partNode->AsIdentifier()); in GetInterfaceSuperInterfaces()
568 if (interfaceDecl->IsTSInterfaceDeclaration()) { in GetInterfaceSuperInterfaces()
569 ir::AstNode *superInterface = interfaceDecl->AsTSInterfaceDeclaration(); in GetInterfaceSuperInterfaces()
581 * @param node - Class definition node
590 auto classDefinition = node->AsClassDefinition(); in GetImplements()
591 auto implements = classDefinition->Implements(); in GetImplements()
594 if (partNode == nullptr || !partNode->IsIdentifier()) { in GetImplements()
597 auto interfaceDecl = compiler::DeclarationFromIdentifier(partNode->AsIdentifier()); in GetImplements()
598 if (interfaceDecl->IsTSInterfaceDeclaration()) { in GetImplements()
599 result.push_back(interfaceDecl->AsTSInterfaceDeclaration()); in GetImplements()
611 auto rootNode = ctx->parserProgram->Ast(); in GetInterfaceOrClasses()
615 for (auto statement : rootNode->Statements()) { in GetInterfaceOrClasses()
618 if (!statement->IsTSInterfaceDeclaration()) { in GetInterfaceOrClasses()
621 auto child = statement->AsTSInterfaceDeclaration(); in GetInterfaceOrClasses()
630 if (!statement->IsClassDeclaration()) { in GetInterfaceOrClasses()
633 auto classDef = statement->AsClassDeclaration()->Definition(); in GetInterfaceOrClasses()
653 * @brief (通用函数,用于查找接口的子接口或实现类及其子类) Generic function to find sub-interfaces or implementing
655 * @param context - Compiler context containing program AST
656 * @param node - Current interface node
657 * @param isInterfaceMode - Flag to determine lookup mode (true for interfaces, false for classes)
664 if (ctx->parserProgram->Ast() == nullptr) { in GetRelatedNodes()
670 if (!isInterfaceMode && elem->IsClassDefinition()) { in GetRelatedNodes()
671 elem = elem->Parent(); in GetRelatedNodes()
687 * @param context - Compiler context containing program AST
688 * @param node - Current interface node
699 * @param context - Compiler context containing program AST
700 * @param node - Current interface node
709 * @brief Extracts public, non-static, non-constructor members from a class or interface node.
718 if (node->IsTSInterfaceDeclaration()) { in GetMembers()
719 auto interfaceBody = node->AsTSInterfaceDeclaration()->Body()->Body(); in GetMembers()
722 if (node->IsClassDefinition()) { in GetMembers()
723 node = node->Parent(); in GetMembers()
725 auto classBody = node->AsClassDeclaration()->Definition()->Body(); in GetMembers()
729 if (field->IsClassProperty()) { in GetMembers()
731 } else if (field->IsMethodDefinition()) { in GetMembers()
732 auto *method = field->AsMethodDefinition(); in GetMembers()
733 if (!method->IsPrivate() && !method->IsStatic() && !method->IsConstructor()) { in GetMembers()
743 * @param a - First method node
744 * @param b - Second method node
766 …auto kind = targetMember->IsMethodDefinition() ? ClassRelationKind::METHOD : ClassRelationKind::PR… in CompareMembersCommon()
771 matchedContainer.emplace_back(fileName, currentMember->Start().index, kind); in CompareMembersCommon()
776 unmatchedContainer.emplace_back(fileName, targetMember->Start().index, kind); in CompareMembersCommon()
811 ClassHierarchyItemInfo info(name, params.kind, item->Start().index); in ProcessItems()
826 auto program = pctx->parserProgram; in GetClassHierarchiesImpl()
836 if (classNode->IsClassDeclaration()) { in GetClassHierarchiesImpl()
846 } else if (classNode->IsTSInterfaceDeclaration()) { in GetClassHierarchiesImpl()