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
8 package com.stevesoft.pat;
10 import java.util.Hashtable;
12 //class AddToEnd extends RegSyntax {};
15 * Compiles the '$' or the '\Z' Pattern. It is an error to have further Pattern
16 * elements after '\Z'. It is the end of the String.
18 class End extends Pattern
27 public int matchInternal(int pos, Pthings pt)
29 if (retIsEnd && pt.mFlag && pos < pt.src.length())
31 if (pt.src.charAt(pos) == '\n')
33 return nextMatch(pos, pt);
36 if (pt.src.length() == pos)
38 return nextMatch(pos, pt);
40 else if (pos < pt.src.length())
42 // Access the next character...
43 // this is crucial to making
50 public String toString()
62 public patInt maxChars()
67 public Pattern clone1(Hashtable h)
69 return new End(retIsEnd);