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

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


            case JJTEXPR_STMT:
                value = (exprType) stack.popNode();
                if (arity > 1) {
                    exprs = makeExprs(arity - 1);
                    ctx.setStore(exprs);
                    return new Assign(exprs, value);
                } else {
                    return new Expr(value);
                }
            case JJTINDEX_OP:
                sliceType slice = (sliceType) stack.popNode();
View Full Code Here


                            definitions = findDefinition(initialState.getCopyWithActTok(value),
                                    token.getLineDefinition(), token.getColDefinition() + 1, manager.getNature());
                            if (definitions.length == 1) {
                                Definition d = definitions[0];
                                if (d.ast instanceof Assign) {
                                    Assign assign = (Assign) d.ast;
                                    value = NodeUtils.getRepresentationString(assign.value);
                                    definitions = findDefinition(initialState.getCopyWithActTok(value), d.line, d.col,
                                            manager.getNature());
                                } else if (d.ast instanceof ClassDef) {
                                    IToken[] toks = (IToken[]) ((SourceModule) d.module).getClassToks(initialState,
View Full Code Here

            //pyprotocols does adapt(xxx, Interface), so, knowing the type of the interface can get us to nice results...
            //the user can usually have other factory methods that do that too. E.g.: GetSingleton(Class) may return an
            //expected class and so on, so, this should be configured somehow
            if (assignDefinition != null) {

                Assign assign = (Assign) assignDefinition.ast;
                if (assign.value instanceof Call) {
                    Call call = (Call) assign.value;
                    String lastPart = FullRepIterable.getLastPart(assignDefinition.value);
                    Integer parameterIndex = CALLS_FOR_ASSIGN_WITH_RESULTING_CLASS.get(lastPart.toLowerCase());
                    if (parameterIndex != null && call.args.length >= parameterIndex) {
View Full Code Here

                                }
                            }
                        }

                        if (targets.size() > 0) {
                            Assign assign = new Assign(targets.toArray(new exprType[targets.size()]), null);
                            assign.beginColumn = this.firstCharCol;
                            assign.beginLine = this.row;
                            addToPertinentScope(assign);
                        }
                    }
View Full Code Here

                            //all the items added should have the same column.
                            return;
                        }
                    }
                } else if (newStmt instanceof Assign) {
                    Assign assign = (Assign) newStmt;
                    exprType target = assign.targets[0];

                    //an assign could be in a method or in a class depending on where we're right now...
                    int size = peek.size();
                    if (size > 0) {
View Full Code Here

            case JJTEXPR_STMT:
                value = (exprType) stack.popNode();
                if (arity > 1) {
                    exprs = makeExprs(arity - 1);
                    ctx.setStore(exprs);
                    return new Assign(exprs, value);
                } else {
                    return new Expr(value);
                }
            case JJTINDEX_OP:
                sliceType slice = (sliceType) stack.popNode();
View Full Code Here

            case JJTEXPR_STMT:
                value = (exprType) stack.popNode();
                if (arity > 1) {
                    exprs = makeExprs(arity - 1);
                    ctx.setStore(exprs);
                    return new Assign(exprs, value);
                } else {
                    return new Expr(value);
                }
            case JJTINDEX_OP:
                sliceType slice = (sliceType) stack.popNode();
View Full Code Here

            case JJTEXPR_STMT:
                value = (exprType) stack.popNode();
                if (arity > 1) {
                    exprs = makeExprs(arity - 1);
                    ctx.setStore(exprs);
                    return new Assign(exprs, value);
                } else {
                    return new Expr(value);
                }
            case JJTINDEX_OP:
                sliceType slice = (sliceType) stack.popNode();
View Full Code Here

        //when visiting the global namespace, we don't go into any inner scope.
        if ((this.visitWhat & GLOBAL_TOKENS) != 0) {
            if (node.ctx == Name.Store) {
                SourceToken added = addToken(node);
                if (lastAssign.size() > 0) {
                    Assign last = lastAssign.peek();
                    if (added.getRepresentation().equals("__all__") && __all__Assign == null) {
                        __all__ = added;
                        __all__Assign = last;
                        __all__AssignTargets = last.targets;
                    } else {
View Full Code Here

            //probably be an error, but let's go on gracefully, as the user can be in an invalid moment
            //in his code)
            if (j >= valueElts.length) {
                j = valueElts.length - 1;
            }
            Assign assign = new Assign(new exprType[] { targetTuple.elts[i] }, valueElts[j]);
            assign.beginLine = targetTuple.beginLine;
            assign.beginColumn = targetTuple.beginColumn;
            visitAssign(assign);
        }
    }
View Full Code Here

TOP

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

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.