1 19 20 package gnu.regexp; 21 22 final class RETokenAny extends REToken { 23 24 private boolean newline; 25 26 27 private boolean matchNull; 28 29 RETokenAny(int subIndex, boolean newline, boolean matchNull) { 30 super(subIndex); 31 this.newline = newline; 32 this.matchNull = matchNull; 33 } 34 35 int getMinimumLength() { 36 return 1; 37 } 38 39 boolean match(CharIndexed input, REMatch mymatch) { 40 char ch = input.charAt(mymatch.index); 41 if ((ch == CharIndexed.OUT_OF_BOUNDS) 42 || (!newline && (ch == '\n')) 43 || (matchNull && (ch == 0))) { 44 return false; 45 } 46 ++mymatch.index; 47 return next(input, mymatch); 48 } 49 50 void dump(StringBuffer os) { 51 os.append('.'); 52 } 53 } 54 55 | Popular Tags |