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); }
@Override public boolean visitGeneral(ASTNode node) throws Exception { if (node instanceof org.eclipse.dltk.ast.statements.Block) { node.traverse(new TwigIndexingVisitor(requestor, sourceModule)); } return super.visitGeneral(node); }
public static String toXMLString(ASTNode node) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); ASTPrintVisitor printVisitor = new ASTPrintVisitor(out); node.traverse(printVisitor); printVisitor.close(); return out.toString("UTF-8"); } catch (Exception e) { return e.toString(); } }
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); }
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; }