Package org.codehaus.groovy.transform.sc

Examples of org.codehaus.groovy.transform.sc.TemporaryVariableExpression


            boolean safe,
            boolean spreadSafe,
            boolean requiresReturnValue,
            Expression location) {
        if (requiresReturnValue) {
            final TemporaryVariableExpression tmp = new TemporaryVariableExpression(arguments);
            MethodCallExpression call = new MethodCallExpression(
                    receiver,
                    setterMethod.getName(),
                    tmp
            ) {
                @Override
                public void visit(final GroovyCodeVisitor visitor) {
                    super.visit(visitor);
                    if (visitor instanceof AsmClassGenerator) {
                        // ignore the return of the call
                        ((AsmClassGenerator) visitor).getController().getOperandStack().pop();
                    }
                }
            };
            call.setImplicitThis(implicitThis);
            call.setSafe(safe);
            call.setSpreadSafe(spreadSafe);
            call.setMethodTarget(setterMethod);
            call.setSourcePosition(location);
            ListOfExpressionsExpression result = new ListOfExpressionsExpression(
                    Arrays.asList(
                            tmp,
                            call
                    )
            ) {
                @Override
                public void visit(final GroovyCodeVisitor visitor) {
                    super.visit(visitor);
                    if (visitor instanceof AsmClassGenerator) {
                        tmp.remove(((AsmClassGenerator) visitor).getController());
                    }
                }
            };
            result.setSourcePosition(location);
            return result;
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.transform.sc.TemporaryVariableExpression

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.