Package org.python.pydev.parser.jython.ast

Examples of org.python.pydev.parser.jython.ast.Comprehension


            ifs.add((exprType) ifsNode);
        }
        exprType iter = (exprType) stack.popNode();
        exprType target = (exprType) stack.popNode();
        ctx.setStore(target);
        col.added.add(new Comprehension(target, iter, ifs.toArray(new exprType[0])));
        return col;
    }
View Full Code Here


                    ifs.add((exprType) ifsNode);
                }
                iter = (exprType) stack.popNode();
                target = (exprType) stack.popNode();
                ctx.setStore(target);
                col.added.add(new Comprehension(target, iter, ifs.toArray(new exprType[0])));
                return col;
            case JJTIMPORTFROM:
                return makeImportFrom25Onwards(arity);

            default:
View Full Code Here

                    ifs.add((exprType) ifsNode);
                }
                iter = (exprType) stack.popNode();
                target = (exprType) stack.popNode();
                ctx.setStore(target);
                col.added.add(new Comprehension(target, iter, ifs.toArray(new exprType[0])));
                return col;
            case JJTIMPORTFROM:
                return makeImportFrom25Onwards(arity);

            default:
View Full Code Here

                    ifs[i] = (exprType) stack.popNode();
                }
                iter = (exprType) stack.popNode();
                target = (exprType) stack.popNode();
                ctx.setStore(target);
                return new Comprehension(target, iter, ifs);
            case JJTIMPORTFROM:
                aliasType[] aliases = makeAliases(arity - 1);
                return new ImportFrom(makeName(NameTok.ImportModule), aliases, 0); //relative import is always level 0 here (only actually added on version 25)

            default:
View Full Code Here

        unhandled_node(node);
        if (node.ctx == ListComp.TupleCtx) {
            startScope(Scope.SCOPE_TYPE_LIST_COMP, node);
        }
        try {
            Comprehension type = null;
            if (node.generators != null && node.generators.length > 0) {
                type = (Comprehension) node.generators[0];
            }
            List<exprType> eltsToVisit = new ArrayList<exprType>();
View Full Code Here

        }
    }

    private void visitListCompGenerators(ListComp node, List<exprType> eltsToVisit) throws Exception {
        for (comprehensionType c : node.generators) {
            Comprehension comp = (Comprehension) c;
            if (node.elt instanceof ListComp) {
                visitListCompGenerators((ListComp) node.elt, eltsToVisit);
                comp.accept(this);
            } else {
                comp.accept(this);
                eltsToVisit.add(node.elt);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.jython.ast.Comprehension

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.