Search in sources :

Example 1 with ExpressionAsVariableSlot

use of org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot in project groovy-core by groovy.

the class TemporaryVariableExpression method visit.

@Override
public void visit(final GroovyCodeVisitor visitor) {
    if (visitor instanceof AsmClassGenerator) {
        if (variable == null) {
            AsmClassGenerator acg = (AsmClassGenerator) visitor;
            WriterController controller = acg.getController();
            variable = new ExpressionAsVariableSlot(controller, expression);
        }
        variable.visit(visitor);
    } else {
        expression.visit(visitor);
    }
}
Also used : WriterController(org.codehaus.groovy.classgen.asm.WriterController) ExpressionAsVariableSlot(org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot) AsmClassGenerator(org.codehaus.groovy.classgen.AsmClassGenerator)

Example 2 with ExpressionAsVariableSlot

use of org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot in project groovy by apache.

the class TemporaryVariableExpression method visit.

@Override
public void visit(final GroovyCodeVisitor visitor) {
    if (visitor instanceof AsmClassGenerator) {
        if (variable == null) {
            AsmClassGenerator acg = (AsmClassGenerator) visitor;
            WriterController controller = acg.getController();
            variable = new ExpressionAsVariableSlot(controller, expression);
        }
        variable.visit(visitor);
    } else {
        expression.visit(visitor);
    }
}
Also used : WriterController(org.codehaus.groovy.classgen.asm.WriterController) ExpressionAsVariableSlot(org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot) AsmClassGenerator(org.codehaus.groovy.classgen.AsmClassGenerator)

Aggregations

AsmClassGenerator (org.codehaus.groovy.classgen.AsmClassGenerator)2 ExpressionAsVariableSlot (org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot)2 WriterController (org.codehaus.groovy.classgen.asm.WriterController)2