Examples of copyNodeMetaData()


Examples of org.codehaus.groovy.ast.MethodNode.copyNodeMetaData()

                MethodNode methodNode = new MethodNode(runScriptMethod.getName(), runScriptMethod.getModifiers() & ~ACC_ABSTRACT
                        , runScriptMethod.getReturnType(), runScriptMethod.getParameters(), runScriptMethod.getExceptions()
                        , defaultMethod.getCode());
                // The AST node metadata has the flag that indicates that this method is a script body.
                // It may also be carrying data for other AST transforms.
                methodNode.copyNodeMetaData(defaultMethod);
                cNode.addMethod(methodNode);
            }
        }

        // If the new script base class does not have a contextual constructor (g.l.Binding), then we won't either.
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BinaryExpression.copyNodeMetaData()

                ClassNode subscriptType = operandStack.getTopOperand();
                int id = controller.getCompileStack().defineTemporaryVariable("$subscript", subscriptType, true);
                VariableSlotLoader subscriptExpression = new VariableSlotLoader(subscriptType, id, operandStack);
                // do modified visit
                BinaryExpression newBe = new BinaryExpression(be.getLeftExpression(), be.getOperation(), subscriptExpression);
                newBe.copyNodeMetaData(be);
                newBe.setSourcePosition(be);
                newBe.visit(controller.getAcg());
                return subscriptExpression;
            }
        }
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.Expression.copyNodeMetaData()

                    exp instanceof DeclarationExpression ?new DeclarationExpression(
                            leftTransform, operation, rightTransform
                    ):
                    new BinaryExpression(leftTransform, operation, rightTransform);
            ret.setSourcePosition(exp);
            ret.copyNodeMetaData(exp);
            return ret;
        } else if (exp instanceof StaticMethodCallExpression) {
            StaticMethodCallExpression call = (StaticMethodCallExpression) exp;
            ClassNode ownerType = call.getOwnerType();
            if (traitClass.equals(ownerType)) {
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.MethodCallExpression.copyNodeMetaData()

                    "isCase",
                    leftExpression
            );
            call.setMethodTarget((MethodNode) bin.getNodeMetaData(StaticTypesMarker.DIRECT_METHOD_CALL_TARGET));
            call.setSourcePosition(bin);
            call.copyNodeMetaData(bin);
            TernaryExpression tExp = new TernaryExpression(
                    new BooleanExpression(
                            new BinaryExpression(rightExpression, Token.newSymbol("==",-1,-1), new ConstantExpression(null))
                    ),
                    new BinaryExpression(leftExpression, Token.newSymbol("==", -1, -1), new ConstantExpression(null)),
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.MethodCallExpression.copyNodeMetaData()

                    orig.getMethod(),
                    orig.getArguments()
            );
            call.setMethodTarget(target);
            call.setSourcePosition(orig);
            call.copyNodeMetaData(orig);
            return transformer.transform(call);
        }
        return transformer.superTransform(orig);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.PropertyExpression.copyNodeMetaData()

        // handle it
        Object val = expr.getNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER);
        if (val==null) return expr;
        VariableExpression implicitThis = new VariableExpression("this");
        PropertyExpression pexp = new PropertyExpression(implicitThis, expr.getName());
        pexp.copyNodeMetaData(expr);
        pexp.setImplicitThis(true);
        ClassNode owner = expr.getNodeMetaData(StaticCompilationMetadataKeys.PROPERTY_OWNER);
        if (owner!=null) {
            implicitThis.putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, owner);
            implicitThis.putNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER, val);
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.