Ejemplo n.º 1
0
  public boolean endvisit(TypeDeclaration type) throws Exception {
    if (type instanceof NamespaceDeclaration) {
      NamespaceDeclaration namespaceDecl = (NamespaceDeclaration) type;
      while (deferredNamespacedDeclarations != null && !deferredNamespacedDeclarations.isEmpty()) {
        final ASTNode[] declarations =
            deferredNamespacedDeclarations.toArray(
                new ASTNode[deferredNamespacedDeclarations.size()]);
        deferredNamespacedDeclarations.clear();

        for (ASTNode deferred : declarations) {
          deferred.traverse(this);
        }
      }

      fCurrentNamespace = null; // there are no nested namespaces
      fCurrentQualifier = null;
      fLastUseParts.clear();
      if (namespaceDecl.isGlobal()) {
        return visitGeneral(type);
      }
    } else {
      fCurrentParent = null;
    }
    declarations.pop();

    // resolve more type member declarations
    resolveMagicMembers(type);

    for (PhpIndexingVisitorExtension visitor : extensions) {
      visitor.endvisit(type);
    }

    endvisitGeneral(type);
    return true;
  }
  public boolean endvisit(TypeDeclaration type) throws Exception {
    if (type instanceof NamespaceDeclaration) {
      NamespaceDeclaration namespaceDecl = (NamespaceDeclaration) type;
      while (deferredNamespacedDeclarations != null && !deferredNamespacedDeclarations.isEmpty()) {
        final ASTNode[] declarations =
            deferredNamespacedDeclarations.toArray(
                new ASTNode[deferredNamespacedDeclarations.size()]);
        deferredNamespacedDeclarations.clear();

        for (ASTNode deferred : declarations) {
          deferred.traverse(this);
        }
      }
      fLastNamespace = null; // there are no nested namespaces
      if (namespaceDecl.isGlobal()) {
        return true;
      }
    }

    declarations.pop();

    // resolve more type member declarations
    resolveMagicMembers(type);

    for (PHPSourceElementRequestorExtension visitor : extensions) {
      visitor.endvisit(type);
    }

    return super.endvisit(type);
  }
  public boolean endvisit(ModuleDeclaration declaration) throws Exception {
    for (PHPSourceElementRequestorExtension visitor : extensions) {
      visitor.endvisit(declaration);
    }

    while (deferredDeclarations != null && !deferredDeclarations.isEmpty()) {
      final ASTNode[] declarations =
          deferredDeclarations.toArray(new ASTNode[deferredDeclarations.size()]);
      deferredDeclarations.clear();

      for (ASTNode deferred : declarations) {
        deferred.traverse(this);
      }
    }
    fLastUseParts.clear();
    return super.endvisit(declaration);
  }
Ejemplo n.º 4
0
  public boolean endvisit(ModuleDeclaration declaration) throws Exception {
    while (deferredDeclarations != null && !deferredDeclarations.isEmpty()) {
      final ASTNode[] declarations =
          deferredDeclarations.toArray(new ASTNode[deferredDeclarations.size()]);
      deferredDeclarations.clear();

      for (ASTNode deferred : declarations) {
        deferred.traverse(this);
      }
    }

    for (PhpIndexingVisitorExtension visitor : extensions) {
      visitor.endvisit(declaration);
    }

    fLastUseParts.clear();
    endvisitGeneral(declaration);
    return true;
  }