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
9 import java.util.Hashtable;
\r
11 /** This class is needed internally to make backtracking work
\r
12 * correctly in user-defined patterns.
\r
14 class CustomEndpoint extends Pattern {
\r
16 CustomEndpoint(Custom cm) { c = cm; }
\r
17 public int matchInternal(int pos,Pthings pt) {
\r
18 int npos = c.v.validate(pt.src,c.start,pos);
\r
20 return nextMatch(npos,pt);
\r
23 public String toString() { return ""; }
\r
24 Pattern clone1(Hashtable h) {
\r
25 return new CustomEndpoint((Custom)c.clone(h));
\r