private Expression copyVarExpr(VariableExpression varExpr) {
    VariableExpression newVarExpr = new VariableExpression(varExpr.getName(), varExpr.getOriginType());
    newVarExpr.setAccessedVariable(varExpr.getAccessedVariable());
    newVarExpr.setSourcePosition(varExpr);
    return newVarExpr;
  }
A Spec visitor responsible for most of the rewriting of a Spec's AST.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java