Groovy 2.2.1

org.codehaus.groovy.classgen.asm
[Java] Class ExpressionAsVariableSlot

java.lang.Object
  org.codehaus.groovy.ast.ASTNode
      org.codehaus.groovy.ast.AnnotatedNode
          org.codehaus.groovy.ast.expr.Expression
              org.codehaus.groovy.classgen.BytecodeExpression
                  org.codehaus.groovy.classgen.asm.ExpressionAsVariableSlot

public class ExpressionAsVariableSlot
extends BytecodeExpression

Helper class that takes an Expression and if visited will load it normally, storing the result in a helper variable, which then can be requested after the visit is completed. A copy of the variable will stay on the stack. Subsequent visits will load the stored value instead of visiting the expression again

Authors:
Jochen "blackdrag" Theodorou


Field Summary
 
Fields inherited from class BytecodeExpression
NOP
 
Constructor Summary
ExpressionAsVariableSlot(WriterController controller, Expression expression, String name)

ExpressionAsVariableSlot(WriterController controller, Expression expression)

 
Method Summary
int getIndex()

returns the index of the bytecode variable

String getText()

void visit(org.objectweb.asm.MethodVisitor mv)

 
Methods inherited from class BytecodeExpression
transformExpression, visit, visit
 
Methods inherited from class Expression
getType, setType, transformExpression, transformExpressions, transformExpressions
 
Methods inherited from class AnnotatedNode
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic
 
Methods inherited from class ASTNode
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

ExpressionAsVariableSlot

public ExpressionAsVariableSlot(WriterController controller, Expression expression, String name)


ExpressionAsVariableSlot

public ExpressionAsVariableSlot(WriterController controller, Expression expression)


 
Method Detail

getIndex

public int getIndex()
returns the index of the bytecode variable


getText

@Override
public String getText()


visit

@Override
public void visit(org.objectweb.asm.MethodVisitor mv)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.