1 46 package org.codehaus.groovy.ast.expr; 47 48 import java.util.regex.Pattern ; 49 50 import org.codehaus.groovy.ast.GroovyCodeVisitor; 51 import org.codehaus.groovy.classgen.AsmClassGenerator2; 52 53 60 public class RegexExpression extends Expression { 61 62 private Expression string; 63 64 public RegexExpression(Expression string) { 65 this.string = string; 66 super.setTypeClass(Pattern .class); 67 } 68 69 public void visit(GroovyCodeVisitor visitor) { 70 visitor.visitRegexExpression(this); 71 } 72 73 public Expression transformExpression(ExpressionTransformer transformer) { 74 return new RegexExpression(transformer.transform(string)); 75 } 76 77 protected void resolveType(AsmClassGenerator2 resolver) { 78 } 80 81 public Expression getRegex() { 82 return string; 83 } 84 85 } 86 | Popular Tags |