Package org.python.pydev.parser.visitors.scope

Examples of org.python.pydev.parser.visitors.scope.DefinitionsASTIteratorVisitor


    /**
     * @return an iterator that'll get the outline entries for the given ast.
     */
    public static Tuple<DefinitionsASTIteratorVisitor, Iterator<ASTEntry>> getInnerEntriesForAST(SimpleNode node)
            throws Exception {
        DefinitionsASTIteratorVisitor visitor = new DefinitionsASTIteratorVisitor();
        node.accept(visitor);
        Iterator<ASTEntry> entries = visitor.getOutline();
        return new Tuple<DefinitionsASTIteratorVisitor, Iterator<ASTEntry>>(visitor, entries);
    }
View Full Code Here


                        if (model == null) {
                            return;
                        }
                        ClassDef ast = model.ast;
                        if (ast != null && treeMembers != null) {
                            DefinitionsASTIteratorVisitor visitor = DefinitionsASTIteratorVisitor.create(ast);
                            Iterator<ASTEntry> outline = visitor.getOutline();

                            HashMap<SimpleNode, TreeItem> c = new HashMap<SimpleNode, TreeItem>();

                            boolean first = true;
                            while (outline.hasNext()) {
View Full Code Here

        if (ast == null) {
            return;
        }

        DefinitionsASTIteratorVisitor visitor = DefinitionsASTIteratorVisitor.create(ast);
        if (visitor == null) {
            return;
        }

        Map<ASTEntry, TreeNode<OutlineEntry>> entryToTreeNode = new HashMap<ASTEntry, TreeNode<OutlineEntry>>();

        //Step 1: create 'regular' tree structure from the nodes.
        TreeNode<OutlineEntry> root = new TreeNode<OutlineEntry>(null, null, null);

        for (Iterator<ASTEntry> it = visitor.getOutline(); it.hasNext();) {
            ASTEntry next = it.next();
            TreeNode<OutlineEntry> n;
            if (next.parent != null) {
                TreeNode<OutlineEntry> parent = entryToTreeNode.get(next.parent);
                if (parent == null) {
View Full Code Here

    private void addMethods(TreeNode<OutlineEntry> nextEntry, HierarchyNodeModel model) {
        if (model == null || model.parents == null) {
            return;
        }
        for (HierarchyNodeModel parent : model.parents) {
            DefinitionsASTIteratorVisitor visitor = DefinitionsASTIteratorVisitor.createForChildren(parent.ast);
            if (visitor == null) {
                continue;
            }

            Iterator<ASTEntry> outline = visitor.getOutline();
            while (outline.hasNext()) {
                ASTEntry entry = outline.next();
                if (entry.parent == null) {
                    //only direct children...
                    new TreeNode<OutlineEntry>(nextEntry, new OutlineEntry(entry, parent), null);
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.visitors.scope.DefinitionsASTIteratorVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.