2 // This software is now distributed according to
\r
3 // the Lesser Gnu Public License. Please see
\r
4 // http://www.gnu.org/copyleft/lesser.txt for
\r
6 // -- Happy Computing!
\r
8 package com.stevesoft.pat;
\r
10 /** This class implements user defined special replacement rules
\r
11 * of the form ${=name}. See <a href="http://javaregex.com/code/trans2.java.html">trans2.java</a>
\r
12 * and <a href="http://javaregex.com/code/trans2a.java.html">trans2a.java</a>.
\r
14 public class ChangeRule extends SpecialRule {
\r
16 public ChangeRule(ChangeRule c) { NewRule=c.NewRule; }
\r
17 public ChangeRule(String nm,Regex rr) { name=nm; NewRule = rr; }
\r
18 public ChangeRule(String nm,Transformer tr) { name=nm; NewRule = tr.rp; }
\r
19 public Object clone1() { return new ChangeRule(this); }
\r
20 public String toString1() { return "${="+name+"}"; }
\r
21 public void apply(StringBufferLike sb,RegRes rr) {}
\r