1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Multi_stage2", ["com.stevesoft.pat.RegSyntaxError", "$.patInt"], function () {
3 c$ = Clazz.decorateAsClass (function () {
8 this.matchFewest = false;
10 Clazz.instantialize (this, arguments);
11 }, com.stevesoft.pat, "Multi_stage2", com.stevesoft.pat.PatternSub);
12 Clazz.defineMethod (c$, "toString",
15 ret += this.sub.toString ();
16 ret += "{" + this.matchMin + "," + this.matchMax + "}";
17 if (this.matchFewest) {
19 }ret += this.parent.nextString ();
22 Clazz.makeConstructor (c$,
24 Clazz.superConstructor (this, com.stevesoft.pat.Multi_stage2, []);
26 com.stevesoft.pat.RegSyntaxError.endItAll ("Multiple match of Null pattern requested.");
29 this.sub.setParent (this);
32 this.count = new com.stevesoft.pat.patInt (0);
34 com.stevesoft.pat.RegSyntaxError.endItAll ("Bad Multi Args: " + a + ">" + b);
35 }var i = new com.stevesoft.pat.patInt (-1);
37 com.stevesoft.pat.RegSyntaxError.endItAll ("Bad Multi Args: " + a + "< 0");
38 }}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
39 Clazz.defineMethod (c$, "getNext",
43 Clazz.overrideMethod (c$, "matchInternal",
45 this.sub.setParent (this);
47 if (this.pos_old >= 0 && pos == this.pos_old) {
50 if (this.matchMin.lessEq (this.count)) {
52 }if (!this.count.lessEq (this.matchMax) || pos > pt.src.length ()) {
54 }if ((this.matchFewest || this.count.equals (this.matchMax)) && canUse >= 0) {
55 var n = Clazz.superCall (this, com.stevesoft.pat.Multi_stage2, "getNext", []);
58 }var ret = this.testMatch (n, pos, pt);
65 if (this.count.lessEq (this.matchMax)) {
66 var r = this.testMatch (this.sub, pos, pt);
72 if (!this.matchFewest && canUse >= 0) {
73 var n = Clazz.superCall (this, com.stevesoft.pat.Multi_stage2, "getNext", []);
76 }var ret = this.testMatch (n, pos, pt);
80 }}, "~N,com.stevesoft.pat.Pthings");
81 Clazz.overrideMethod (c$, "clone1",
84 var m = new com.stevesoft.pat.Multi_stage2 (this.matchMin, this.matchMax, this.sub.clone (h));
85 m.matchFewest = this.matchFewest;
88 if (Clazz.exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
94 }, "java.util.Hashtable");