1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (null, "com.stevesoft.pat.StrPos", ["com.stevesoft.pat.patInf", "$.patInt"], function () {
3 c$ = Clazz.decorateAsClass (function () {
8 this.dontMatch = false;
10 Clazz.instantialize (this, arguments);
11 }, com.stevesoft.pat, "StrPos");
12 Clazz.defineMethod (c$, "pos",
16 Clazz.defineMethod (c$, "thisChar",
20 Clazz.defineMethod (c$, "eos",
24 Clazz.makeConstructor (c$,
27 }, "com.stevesoft.pat.StrPos");
28 Clazz.defineMethod (c$, "dup",
33 this.dontMatch = sp.dontMatch;
35 }, "com.stevesoft.pat.StrPos");
36 Clazz.makeConstructor (c$,
42 Clazz.defineMethod (c$, "inc",
45 if (this.$pos >= this.s.length) {
49 this.c = this.s.charAt (this.$pos);
50 if (this.c == this.esc && this.$pos + 1 < this.s.length) {
52 this.c = this.s.charAt (this.$pos);
53 if (this.c != this.esc) {
54 this.dontMatch = true;
56 this.dontMatch = false;
58 this.dontMatch = false;
61 Clazz.defineMethod (c$, "match",
63 if (this.dontMatch || this.$eos) {
67 Clazz.defineMethod (c$, "escMatch",
69 if (!this.dontMatch || this.$eos) {
73 Clazz.defineMethod (c$, "escaped",
75 return this.dontMatch;
77 Clazz.defineMethod (c$, "incMatch",
79 var sp = new com.stevesoft.pat.StrPos (this);
81 for (i = 0; i < st.length; i++) {
82 if (!sp.match (st.charAt (i))) {
89 Clazz.defineMethod (c$, "getPatInt",
91 if (this.incMatch ("inf")) {
92 return new com.stevesoft.pat.patInf ();
95 var sp = new com.stevesoft.pat.StrPos (this);
96 for (i = 0; !sp.$eos && sp.c >= '0' && sp.c <= '9'; i++) {
97 cnt = 10 * cnt + sp.c.charCodeAt (0) - 48;
103 return new com.stevesoft.pat.patInt (cnt);
105 Clazz.defineMethod (c$, "getString",