JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.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
13  * further examples of how this is used. You will probably not want to call it
14  * directly.
15  */
16 public class PushRule extends SpecialRule
17 {
18   Regex NewRule;
19
20   public PushRule(PushRule p)
21   {
22     NewRule = p.NewRule;
23   }
24
25   public PushRule(String nm, Regex rr)
26   {
27     name = nm;
28     NewRule = rr;
29   }
30
31   public PushRule(String nm, Transformer tr)
32   {
33     name = nm;
34     NewRule = tr.rp;
35   }
36
37   public Object clone1()
38   {
39     return new PushRule(this);
40   }
41
42   public String String1()
43   {
44     return "${+" + name + "}";
45   }
46
47   public void apply(StringBufferLike sbl, RegRes rr)
48   {
49   }
50 }