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