Package org.codehaus.groovy.ast.expr

Examples of org.codehaus.groovy.ast.expr.ArrayExpression


        }
        return "$lock";
    }

    private Expression zeroLengthObjectArray() {
        return new ArrayExpression(ClassHelper.OBJECT_TYPE, null, Arrays.asList((Expression)new ConstantExpression(0)));
    }
View Full Code Here


        }
        return "$lock";
    }

    private Expression zeroLengthObjectArray() {
        return new ArrayExpression(OBJECT_TYPE, null, Arrays.asList((Expression)new ConstantExpression(0)));
    }
View Full Code Here

        }
        return "$lock";
    }

    private Expression zeroLengthObjectArray() {
        return new ArrayExpression(ClassHelper.OBJECT_TYPE, null, Arrays.asList((Expression)constX(0)));
    }
View Full Code Here

                REFLECTION_INVOKER_TYPE,
                "invoke",
                args(
                        fieldExpr,
                        constX("clone"),
                        new ArrayExpression(ClassHelper.OBJECT_TYPE.makeArray(), Collections.<Expression>emptyList())
                )
        );
        return castX(type, smce);
    }
View Full Code Here

        MethodCallExpression getProxy = new MethodCallExpression(proxyReceiver, "getProxyTarget", ArgumentListExpression.EMPTY_ARGUMENTS);
        getProxy.setImplicitThis(true);
        StaticMethodCallExpression proxyCall = new StaticMethodCallExpression(
                ClassHelper.make(InvokerHelper.class),
                "invokeMethod",
                new ArgumentListExpression(getProxy, new ConstantExpression(forwarderMethod.getName()), new ArrayExpression(ClassHelper.OBJECT_TYPE, args.getExpressions()))
        );
        IfStatement stmt = new IfStatement(
                new BooleanExpression(instanceOfExpr),
                new ExpressionStatement(new CastExpression(returnType,proxyCall)),
                new ExpressionStatement(superCall)
View Full Code Here

            return transformer.superTransform(expr);
        }
    }

    private Expression transformArrayConstructor(final ListExpression expr, final MethodNode target) {
        ArrayExpression aex = new ArrayExpression(target.getDeclaringClass().getComponentType(), transformArguments(expr));
        aex.setSourcePosition(expr);
        return aex;
    }
View Full Code Here

        // let's evaluate the RHS and store the result
        ClassNode rhsType;
        if (rightExpression instanceof ListExpression && lhsType.isArray()) {
            ListExpression list = (ListExpression) rightExpression;
            ArrayExpression array = new ArrayExpression(lhsType.getComponentType(), list.getExpressions());
            array.setSourcePosition(list);
            array.visit(acg);
        } else if (rightExpression instanceof EmptyExpression) {
            rhsType = leftExpression.getType();
            loadInitValue(rhsType);
        } else {
            rightExpression.visit(acg);
View Full Code Here

            if (exp.getArguments() instanceof ArgumentListExpression) {
                args = ((ArgumentListExpression) exp.getArguments()).getExpressions();
            } else {
                args = Collections.singletonList(exp.getArguments());
            }
            Expression newArguments = transform(new ArgumentListExpression(new ConstantExpression(name.substring(1)), new ArrayExpression(ClassHelper.OBJECT_TYPE, args)));
            MethodCallExpression call = new MethodCallExpression(
                    new VariableExpression("this"),
                    "methodMissing",
                    newArguments
            );
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.ast.expr.ArrayExpression

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.