1 46 package org.codehaus.groovy.ast.expr; 47 48 import org.codehaus.groovy.ast.GroovyCodeVisitor; 49 import org.codehaus.groovy.classgen.AsmClassGenerator; 50 51 56 public class SpreadExpression extends Expression { 57 58 private Expression expression; 59 60 public SpreadExpression(Expression expression) { 61 this.expression = expression; 62 } 63 64 public Expression getExpression() { 65 return expression; 66 } 67 68 public void visit(GroovyCodeVisitor visitor) { 69 visitor.visitSpreadExpression(this); 70 } 71 72 public Expression transformExpression(ExpressionTransformer transformer) { 73 return new SpreadExpression(transformer.transform(expression)); 74 } 75 76 protected void resolveType(AsmClassGenerator resolver) { 77 expression.resolve(resolver); 78 setTypeClass(expression.getTypeClass()); 79 } 80 81 public String getText() { 82 return "*" + expression.getText(); 83 } 84 85 public String getType() { 86 return expression.getType(); 87 } 88 89 public boolean isDynamic() { 90 return false; } 92 93 public Class getTypeClass() { 94 return expression.getTypeClass(); 95 } 96 } 97 | Popular Tags |