1 Clazz.declarePackage ("com.stevesoft.pat");
\r
2 Clazz.load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.DotMulti", null, function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.fewestMatches = null;
\r
5 this.mostMatches = null;
\r
6 this.matchFewest = false;
\r
9 this.dotDoesntMatchCR = true;
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, com.stevesoft.pat, "DotMulti", com.stevesoft.pat.PatternSub);
\r
12 Clazz.overrideMethod (c$, "minChars",
\r
14 return this.fewestMatches;
\r
16 Clazz.overrideMethod (c$, "maxChars",
\r
18 return this.mostMatches;
\r
20 Clazz.makeConstructor (c$,
\r
22 Clazz.superConstructor (this, com.stevesoft.pat.DotMulti, []);
\r
23 this.fewestMatches = a;
\r
24 this.mostMatches = b;
\r
25 }, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");
\r
26 Clazz.overrideMethod (c$, "toString",
\r
28 return ".{" + this.fewestMatches + "," + this.mostMatches + "}" + (this.matchFewest ? "?" : "") + "(?# <= dot multi)" + this.nextString ();
\r
30 Clazz.defineMethod (c$, "submatchInternal",
\r
31 function (pos, pt) {
\r
32 if (pos < this.srclength) {
\r
33 if (this.dotDoesntMatchCR) {
\r
34 if (this.src.charAt (pos) != '\n') {
\r
39 }, "~N,com.stevesoft.pat.Pthings");
\r
40 Clazz.overrideMethod (c$, "matchInternal",
\r
41 function (pos, pt) {
\r
45 this.srclength = this.src.length ();
\r
46 this.dotDoesntMatchCR = pt.dotDoesntMatchCR;
\r
47 if (this.matchFewest) {
\r
49 while (this.fewestMatches.intValue () > nMatches) {
\r
50 i = this.submatchInternal (i, pt);
\r
57 }var ii = this.nextMatch (i, pt);
\r
60 }if (!this.mostMatches.finite ()) {
\r
62 i = this.submatchInternal (i, pt);
\r
65 }ii = this.nextMatch (i, pt);
\r
71 i = this.submatchInternal (i, pt);
\r
75 if (nMatches > this.mostMatches.intValue ()) {
\r
77 }ii = this.nextMatch (i, pt);
\r
83 while (this.fewestMatches.intValue () > nMatches) {
\r
84 i = this.submatchInternal (i, pt);
\r
91 if (this.mostMatches.finite ()) {
\r
92 while (nMatches < this.mostMatches.intValue ()) {
\r
93 i = this.submatchInternal (i, pt);
\r
102 i = this.submatchInternal (i, pt);
\r
109 }while (m >= pos) {
\r
110 var r = this.nextMatch (m, pt);
\r
115 if (nMatches < this.fewestMatches.intValue ()) {
\r
119 }, "~N,com.stevesoft.pat.Pthings");
\r
120 Clazz.overrideMethod (c$, "clone1",
\r
122 var dm = new com.stevesoft.pat.DotMulti (this.fewestMatches, this.mostMatches);
\r
123 dm.matchFewest = this.matchFewest;
\r
125 }, "java.util.Hashtable");
\r
126 Clazz.defineStatics (c$,
\r