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 PushRule(PushRule p)19 public PushRule(PushRule p) 20 { 21 NewRule = p.NewRule; 22 } 23 PushRule(String nm, Regex rr)24 public PushRule(String nm, Regex rr) 25 { 26 name = nm; 27 NewRule = rr; 28 } 29 PushRule(String nm, Transformer tr)30 public PushRule(String nm, Transformer tr) 31 { 32 name = nm; 33 NewRule = tr.rp; 34 } 35 clone1()36 public Object clone1() 37 { 38 return new PushRule(this); 39 } 40 String1()41 public String String1() 42 { 43 return "${+" + name + "}"; 44 } 45 apply(StringBufferLike sbl, RegRes rr)46 public void apply(StringBufferLike sbl, RegRes rr) 47 { 48 } 49 } 50