--- /dev/null
+//\r
+// This software is now distributed according to\r
+// the Lesser Gnu Public License. Please see\r
+// http://www.gnu.org/copyleft/lesser.txt for\r
+// the details.\r
+// -- Happy Computing!\r
+//\r
+package com.stevesoft.pat;\r
+import java.util.Hashtable;\r
+\r
+/** This class is needed internally to make backtracking work\r
+ * correctly in user-defined patterns.\r
+ */\r
+class CustomEndpoint extends Pattern {\r
+ Custom c;\r
+ CustomEndpoint(Custom cm) { c = cm; }\r
+ public int matchInternal(int pos,Pthings pt) {\r
+ int npos = c.v.validate(pt.src,c.start,pos);\r
+ if(npos >= 0) \r
+ return nextMatch(npos,pt);\r
+ return -1;\r
+ }\r
+ public String toString() { return ""; }\r
+ Pattern clone1(Hashtable h) {\r
+ return new CustomEndpoint((Custom)c.clone(h));\r
+ }\r
+}\r