| Class | Line # | Actions | |||
|---|---|---|---|---|---|
| TransPat | 15 | 11 | 5 |
| 1 | // | |
| 2 | // This software is now distributed according to | |
| 3 | // the Lesser Gnu Public License. Please see | |
| 4 | // http://www.gnu.org/copyleft/lesser.txt for | |
| 5 | // the details. | |
| 6 | // -- Happy Computing! | |
| 7 | // | |
| 8 | package com.stevesoft.pat; | |
| 9 | ||
| 10 | /** | |
| 11 | * This class is used to implement the Transformer | |
| 12 | * | |
| 13 | * @see com.stevesoft.pat.Transform | |
| 14 | */ | |
| 15 | class TransPat extends Pattern | |
| 16 | { | |
| 17 | Regex[] ra = new Regex[10]; | |
| 18 | ||
| 19 | int ra_len = 0; | |
| 20 | ||
| 21 | int pn = -1; | |
| 22 | ||
| 23 | 0 | public String toString() |
| 24 | { | |
| 25 | 0 | return "(?#TransPat)"; |
| 26 | } | |
| 27 | ||
| 28 | 0 | TransPat() |
| 29 | { | |
| 30 | } | |
| 31 | ||
| 32 | int lastMatchedTo = -1; | |
| 33 | ||
| 34 | 0 | public int matchInternal(int pos, Pthings pt) |
| 35 | { | |
| 36 | 0 | for (int i = 0; i < ra_len; i++) |
| 37 | { | |
| 38 | 0 | pt.ignoreCase = ra[i].ignoreCase; |
| 39 | 0 | pt.mFlag = ra[i].mFlag; |
| 40 | 0 | pt.dotDoesntMatchCR = Regex.dotDoesntMatchCR; |
| 41 | 0 | int r = ra[i].thePattern.matchInternal(pos, pt); |
| 42 | 0 | if (r >= 0) |
| 43 | { | |
| 44 | 0 | pn = i; |
| 45 | 0 | return r; |
| 46 | } | |
| 47 | } | |
| 48 | 0 | pn = -1; |
| 49 | 0 | return -1; |
| 50 | } | |
| 51 | } |