1 Clazz.declarePackage ("com.stevesoft.pat");
\r
2 Clazz.load (null, "com.stevesoft.pat.Pattern", ["com.stevesoft.pat.MessageManager", "$.patInf", "$.patInt", "java.lang.Error", "$.StringBuffer"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
7 Clazz.instantialize (this, arguments);
\r
8 }, com.stevesoft.pat, "Pattern");
\r
9 Clazz.defineMethod (c$, "getNext",
\r
11 return this.next != null ? this.next : (this.parent == null ? null : this.parent.getNext ());
\r
13 Clazz.defineMethod (c$, "setParent",
\r
15 if (this.next != null) {
\r
16 this.next.setParent (p);
\r
19 }}, "com.stevesoft.pat.Pattern");
\r
20 Clazz.defineMethod (c$, "nextMatch",
\r
22 var p = this.getNext ();
\r
23 return p == null ? i : p.matchInternal (i, pt);
\r
24 }, "~N,com.stevesoft.pat.Pthings");
\r
25 Clazz.defineMethod (c$, "nextString",
\r
27 if (this.next == null) {
\r
29 }return this.next.toString ();
\r
31 c$.inString = Clazz.defineMethod (c$, "inString",
\r
34 for (i = 0; i < s.length; i++) {
\r
35 if (s.charAt (i) == c) {
\r
40 c$.protect = Clazz.defineMethod (c$, "protect",
\r
41 function (s, PROTECT_THESE, esc) {
\r
43 var sb = new StringBuffer ();
\r
44 var p = PROTECT_THESE + esc;
\r
45 for (i = 0; i < s.length; i++) {
\r
46 var c = s.charAt (i);
\r
47 if (com.stevesoft.pat.Pattern.inString (c, p)) {
\r
51 return sb.toString ();
\r
53 Clazz.defineMethod (c$, "match",
\r
55 return this.matchAt (s, 0, pt);
\r
56 }, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
\r
57 Clazz.defineMethod (c$, "matchAt",
\r
58 function (s, i, pt) {
\r
60 var r = this.matchInternal (i, pt);
\r
63 }this.mfrom = r < i ? r + 1 : i;
\r
64 return r < i ? i - r - 1 : r - i;
\r
65 }, "com.stevesoft.pat.StringLike,~N,com.stevesoft.pat.Pthings");
\r
66 Clazz.defineMethod (c$, "Masked",
\r
68 return pt.cbits == null ? false : pt.cbits.get (i);
\r
69 }, "~N,com.stevesoft.pat.Pthings");
\r
70 Clazz.defineMethod (c$, "add",
\r
72 if (this.next == null) {
\r
76 p.parent = this.parent;
\r
81 }, "com.stevesoft.pat.Pattern");
\r
82 Clazz.defineMethod (c$, "minChars",
\r
84 return new com.stevesoft.pat.patInt (0);
\r
86 Clazz.defineMethod (c$, "maxChars",
\r
88 return new com.stevesoft.pat.patInf ();
\r
90 Clazz.defineMethod (c$, "countMinChars",
\r
93 var sum = new com.stevesoft.pat.patInt (0);
\r
95 sum.pluseq (p.minChars ());
\r
100 Clazz.defineMethod (c$, "countMaxChars",
\r
103 var sum = new com.stevesoft.pat.patInt (0);
\r
104 while (p != null) {
\r
105 sum.pluseq (p.maxChars ());
\r
110 Clazz.defineMethod (c$, "testMatch",
\r
111 function (p, pos, pt) {
\r
113 if (pt.marks != null) {
\r
115 tab = Clazz.newIntArray (pt.marks.length, 0);
\r
116 for (var i = 0; i < tab.length; i++) {
\r
117 tab[i] = pt.marks[i];
\r
121 }var ret = p.matchInternal (pos, pt);
\r
125 }, "com.stevesoft.pat.Pattern,~N,com.stevesoft.pat.Pthings");
\r
126 Clazz.defineMethod (c$, "clone1",
\r
128 throw new Error (com.stevesoft.pat.MessageManager.formatMessage ("error.no_such_method_as_clone1_for", Clazz.newArray (-1, [this.getClass ().getName ()])));
\r
129 }, "java.util.Hashtable");
\r
130 Clazz.defineMethod (c$, "clone",
\r
132 var p = h.get (this);
\r
135 }p = this.clone1 (h);
\r
137 throw new Error (com.stevesoft.pat.MessageManager.getString ("error.null_from_clone1"));
\r
140 if (this.next != null) {
\r
141 p.next = this.next.clone (h);
\r
142 }if (this.parent != null) {
\r
143 p.parent = this.parent.clone (h);
\r
145 }, "java.util.Hashtable");
\r
146 Clazz.overrideMethod (c$, "equals",
\r
150 Clazz.defineStatics (c$,
\r
152 "PROTECT_THESE", "[]{}(),$,-\"^.");
\r