Examples of BinOp


Examples of org.python.antlr.ast.BinOp

        values.addAll(right);
        return new BoolOp(t, op, castExprs(values));
    }

    BinOp makeBinOp(Token t, PythonTree left, operatorType op, List rights) {
        BinOp current = new BinOp(t, castExpr(left), op, castExpr(rights.get(0)));
        for (int i = 1; i< rights.size(); i++) {
            expr right = castExpr(rights.get(i));
            current = new BinOp(left, current, op, right);
        }
        return current;
    }
View Full Code Here

Examples of org.python.antlr.ast.BinOp

        }
        return current;
    }

    BinOp makeBinOp(Token t, PythonTree left, List ops, List rights, List toks) {
        BinOp current = new BinOp(t, castExpr(left), (operatorType)ops.get(0), castExpr(rights.get(0)));
        for (int i = 1; i< rights.size(); i++) {
            expr right = castExpr(rights.get(i));
            operatorType op = (operatorType)ops.get(i);
            current = new BinOp((Token)toks.get(i), current, op, right);
        }
        return current;
    }
View Full Code Here

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

            case JJTAUG_FLOORDIVIDE:
                ret = new AugAssign(null, AugAssign.FloorDiv, null);
                break;

            case JJTOR_2OP:
                ret = new BinOp(null, BinOp.BitOr, null);
                break;
            case JJTXOR_2OP:
                ret = new BinOp(null, BinOp.BitXor, null);
                break;
            case JJTAND_2OP:
                ret = new BinOp(null, BinOp.BitAnd, null);
                break;
            case JJTLSHIFT_2OP:
                ret = new BinOp(null, BinOp.LShift, null);
                break;
            case JJTRSHIFT_2OP:
                ret = new BinOp(null, BinOp.RShift, null);
                break;
            case JJTADD_2OP:
                ret = new BinOp(null, BinOp.Add, null);
                break;
            case JJTSUB_2OP:
                ret = new BinOp(null, BinOp.Sub, null);
                break;
            case JJTMUL_2OP:
                ret = new BinOp(null, BinOp.Mult, null);
                break;
            case JJTDIV_2OP:
                ret = new BinOp(null, BinOp.Div, null);
                break;
            case JJTMOD_2OP:
                ret = new BinOp(null, BinOp.Mod, null);
                break;
            case JJTPOW_2OP:
                ret = new BinOp(null, BinOp.Pow, null);
                break;
            case JJTFLOORDIV_2OP:
                ret = new BinOp(null, BinOp.FloorDiv, null);
                break;

            case JJTPOS_1OP:
                ret = new UnaryOp(UnaryOp.UAdd, null);
                break;
View Full Code Here

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

            case JJTMUL_2OP:
            case JJTDIV_2OP:
            case JJTMOD_2OP:
            case JJTPOW_2OP:
            case JJTFLOORDIV_2OP:
                BinOp op = (BinOp) n;
                exprType right = (exprType) stack.popNode();
                exprType left = (exprType) stack.popNode();
                op.right = right;
                op.left = left;
                return n;
View Full Code Here

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

            }
            return val;
        }

        if (node instanceof BinOp) {
            BinOp binOp = (BinOp) node;
            if (binOp.left instanceof Str && binOp.op == BinOp.Mod) {
                node = binOp.left;
                //Just change the node... the check below will work with the Str already.
            }
        }
View Full Code Here

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

            return buf.toString();

        }

        if (node instanceof BinOp) {
            BinOp binOp = (BinOp) node;
            if (binOp.left instanceof Str && binOp.op == BinOp.Mod) {
                //It's something as 'aaa' % (1,2), so, we know it's a string.
                return getRepresentationString(node, true);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.