org.codehaus.groovy.ast.expr
Class VariableExpression

Represents a local variable name, the simplest form of expression. e.g. "foo".

author:
James Strachan
version:
$Revision: 11961 $

Field Summary
 VariableExpression SUPER_EXPRESSION
           
 VariableExpression THIS_EXPRESSION
           
 Variable accessedVariable
           
 boolean closureShare
           
 boolean inStaticContext
           
 boolean isDynamicTyped
           
 ClassNode originType
           
 String variable
           
 
Constructor Summary
VariableExpression(String variable, ClassNode type)
           
VariableExpression(String variable)
           
VariableExpression(Variable variable)
           
 
Method Summary
Variable getAccessedVariable()
          
Expression getInitialExpression()
          
String getName()
          
ClassNode getOriginType()
          
String getText()
          
ClassNode getType()
          
boolean hasInitialExpression()
          
boolean isClosureSharedVariable()
          
boolean isDynamicTyped()
          
boolean isInStaticContext()
          
void setAccessedVariable(Variable origin)
          
void setClosureSharedVariable(boolean inClosure)
          
void setInStaticContext(boolean inStaticContext)
          
void setType(ClassNode cn)
          
String toString()
          
Expression transformExpression(ExpressionTransformer transformer)
          
void visit(GroovyCodeVisitor visitor)
          
 

Constructor Detail

VariableExpression

public VariableExpression(String variable, ClassNode type)


VariableExpression

public VariableExpression(String variable)


VariableExpression

public VariableExpression(Variable variable)


Method Detail

getAccessedVariable

public Variable getAccessedVariable()


getInitialExpression

public Expression getInitialExpression()


getName

public String getName()


getOriginType

public ClassNode getOriginType()


getText

public String getText()


getType

public ClassNode getType()


hasInitialExpression

public boolean hasInitialExpression()


isClosureSharedVariable

public boolean isClosureSharedVariable()


isDynamicTyped

public boolean isDynamicTyped()


isInStaticContext

public boolean isInStaticContext()


setAccessedVariable

public void setAccessedVariable(Variable origin)


setClosureSharedVariable

public void setClosureSharedVariable(boolean inClosure)


setInStaticContext

public void setInStaticContext(boolean inStaticContext)


setType

public void setType(ClassNode cn)


toString

public String toString()
return:
true if this variable is dynamically typed


transformExpression

public Expression transformExpression(ExpressionTransformer transformer)


visit

public void visit(GroovyCodeVisitor visitor)