dd1ac9ce0aee8e69270bb8557c0c64fb8d312998
[jalview.git] / src / com / stevesoft / pat / PushRule.java
1 //
2 // This software is now distributed according to
3 // the Lesser Gnu Public License.  Please see
4 // http://www.gnu.org/copyleft/lesser.txt for
5 // the details.
6 //    -- Happy Computing!
7 //
8 package com.stevesoft.pat;
9
10 /**
11  * See the example file <a
12  * href="http://javaregex.com/code/trans3.java.html">trans3.java</a> for further
13  * examples of how this is used. You will probably not want to call it directly.
14  */
15 public class PushRule extends SpecialRule
16 {
17   Regex NewRule;
18
19   public PushRule(PushRule p)
20   {
21     NewRule = p.NewRule;
22   }
23
24   public PushRule(String nm, Regex rr)
25   {
26     name = nm;
27     NewRule = rr;
28   }
29
30   public PushRule(String nm, Transformer tr)
31   {
32     name = nm;
33     NewRule = tr.rp;
34   }
35
36   public Object clone1()
37   {
38     return new PushRule(this);
39   }
40
41   public String String1()
42   {
43     return "${+" + name + "}";
44   }
45
46   public void apply(StringBufferLike sbl, RegRes rr)
47   {
48   }
49 }