Class VariableExpressionReplacer

java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.transform.tailrec.VariableExpressionReplacer
All Implemented Interfaces:
GroovyCodeVisitor

public class VariableExpressionReplacer extends CodeVisitorSupport
Tool for replacing VariableExpression instances in an AST by other VariableExpression instances. Regardless of a real change taking place in nested expressions, all considered expression (trees) will be replaced. This could be optimized to accelerate compilation.

Within @TailRecursive it is used - to swap the access of method args with the access to iteration variables - to swap the access of iteration variables with the access of temp vars