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

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


                int len = body.length;

                String funcName = ((NameTok) functionDefinitionReferenced.name).id;
                for (int i = 0; i < len; i++) {
                    if (body[i] instanceof Assign) {
                        Assign assign = (Assign) body[i];
                        if (assign.targets == null) {
                            continue;
                        }

                        //we're looking for xxx = staticmethod(xxx)
View Full Code Here


    @Override
    protected SimpleNode getEditNode() {
        exprType variable = new Name(variableName, expr_contextType.Store, false);
        exprType[] target = { variable };

        return new Assign(target, expression);
    }
View Full Code Here

            return status;
        }

        List<Name> relatedVariables = findAllRelatedVariables(variables, selectedVariable);

        Assign assignment = findAssignment(relatedVariables);

        if (assignment == null) {
            String id = selectedVariable.id;
            status.addFatalError(Messages.format(Messages.inlinelocalNoAssignment, id));
            return status;
View Full Code Here

    private boolean isValid(List<Name> variables) {
        int assignCounter = 0;
        for (Name variable : variables) {
            if (variable.parent instanceof Assign) {
                Assign assign = (Assign) variable.parent;
                /* The given name has to be one of the targets of this assignment */
                for (exprType x : assign.targets) {
                    if (x == variable) {
                        assignCounter++;
                        break;
View Full Code Here

        for (Name variable : relatedVariables) {

            SimpleNode parent = variable.parent;

            if (parent instanceof Assign) {
                Assign assign = (Assign) parent;

                /* The given name has to be one of the targets of this assignment */
                for (exprType x : assign.targets) {
                    if (x == variable) {
                        return assign;
View Full Code Here

            exprType[] expr = returnExpr.toArray(new exprType[0]);
            if (expr.length > 1) {
                expr = new exprType[] { new Tuple(expr, Tuple.Load, false) };
            }

            return new Assign(expr, methodCall);
        }
    }
View Full Code Here

        //initAttributes
        for (INodeAdapter adapter : attributes) {
            exprType target = new Attribute(new Name(NodeHelper.KEYWORD_SELF, Name.Load, false), new NameTok(
                    adapter.getName(), NameTok.Attrib), Attribute.Store);
            Assign initParam1 = new Assign(new exprType[] { target }, new Name(nodeHelper.getPublicAttr(adapter
                    .getName()), Name.Load, false));
            Assign initParam = initParam1;
            body.add(initParam);
        }

        //create function def
        return new FunctionDef(new NameTok(NodeHelper.KEYWORD_INIT, NameTok.FunctionName), args,
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

    @Override
    protected SimpleNode getEditNode() {
        exprType[] target = new exprType[] { new Name(propertyName, Name.Store, false) };
        Call property = createPropertyCall();

        return new Assign(target, property);
    }
View Full Code Here

                    for (Object[] objAndType : metaclassAttrs) {
                        //Note that the line/col is important so that we correctly acknowledge it inside the "class Model" scope.
                        Name name = new Name((String) objAndType[0], Name.Store, false);
                        name.beginColumn = classDef.beginColumn + 4;
                        name.beginLine = classDef.beginLine + 1;
                        newBody[i] = new Assign(new exprType[] { name }, (exprType) objAndType[1]);
                        newBody[i].beginColumn = classDef.beginColumn + 4;
                        newBody[i].beginLine = classDef.beginLine + 1;

                        i += 1;
                    }
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.