org.codehaus.groovy.ast.expr
Class VariableExpression

java.lang.Object
  extended byorg.codehaus.groovy.ast.ASTNode
      extended byorg.codehaus.groovy.ast.expr.Expression
          extended byorg.codehaus.groovy.ast.expr.VariableExpression

public class VariableExpression
extends Expression

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

Version:
$Revision: 1.9 $
Author:
James Strachan

Field Summary
static VariableExpression SUPER_EXPRESSION
           
static VariableExpression THIS_EXPRESSION
           
 
Fields inherited from class org.codehaus.groovy.ast.expr.Expression
type, typeClass, typeResolved
 
Fields inherited from class org.codehaus.groovy.ast.ASTNode
EMPTY_STRING_ARRAY
 
Constructor Summary
VariableExpression(String variable)
           
VariableExpression(String variable, String type)
           
 
Method Summary
 String getText()
           
 String getType()
           
 String getVariable()
           
 boolean isDynamic()
          true if the datatype can be changed, false otherwise.
protected  void resolveType(AsmClassGenerator resolver)
           
 void setDynamic(boolean dynamic)
           
 String toString()
           
 Expression transformExpression(ExpressionTransformer transformer)
          Return a copy of the expression calling the transformer on any nested expressions
 void visit(GroovyCodeVisitor visitor)
           
 
Methods inherited from class org.codehaus.groovy.ast.expr.Expression
getFailure, getTypeClass, isResolveFailed, isTypeResolved, resolve, setFailure, setResolveFailed, setType, setTypeClass, setTypeResolved, shouldContinue, transformExpressions
 
Methods inherited from class org.codehaus.groovy.ast.ASTNode
getColumnNumber, getLineNumber, setColumnNumber, setCSTNode, setLineNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

THIS_EXPRESSION

public static final VariableExpression THIS_EXPRESSION

SUPER_EXPRESSION

public static final VariableExpression SUPER_EXPRESSION
Constructor Detail

VariableExpression

public VariableExpression(String variable,
                          String type)

VariableExpression

public VariableExpression(String variable)
Method Detail

visit

public void visit(GroovyCodeVisitor visitor)
Overrides:
visit in class ASTNode

transformExpression

public Expression transformExpression(ExpressionTransformer transformer)
Description copied from class: Expression
Return a copy of the expression calling the transformer on any nested expressions

Specified by:
transformExpression in class Expression
Parameters:
transformer -
Returns:

resolveType

protected void resolveType(AsmClassGenerator resolver)
Specified by:
resolveType in class Expression

getVariable

public String getVariable()

getText

public String getText()
Overrides:
getText in class ASTNode

getType

public String getType()
Overrides:
getType in class Expression

isDynamic

public boolean isDynamic()
Description copied from class: Expression
true if the datatype can be changed, false otherwise.

Overrides:
isDynamic in class Expression
Returns:

toString

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

setDynamic

public void setDynamic(boolean dynamic)


Copyright © 2003-2005 The Codehaus. All Rights Reserved.