public static CodeRangeBuffer addCodeRangeToBuff(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to) { return addCodeRangeToBuff(pbuf, env, from, to, true); }
public static CodeRangeBuffer addCodeRangeToBuff(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to) { return addCodeRangeToBuff(pbuf, env, from, to, true); }
void addCodeRangeToBuf(ScanEnvironment env, int from, int to, boolean checkDup) { mbuf = CodeRangeBuffer.addCodeRangeToBuff(mbuf, env, from, to, checkDup); }
void addCodeRangeToBuf(ScanEnvironment env, int from, int to, boolean checkDup) { mbuf = CodeRangeBuffer.addCodeRangeToBuff(mbuf, env, from, to, checkDup); }
public static CodeRangeBuffer andCodeRange1(CodeRangeBuffer pbuf, ScanEnvironment env, int from1, int to1, int[]data, int n) { for (int i=0; i<n; i++) { int from2 = data[i * 2 + 1]; int to2 = data[i * 2 + 2]; if (from2 < from1) { if (to2 < from1) { continue; } else { from1 = to2 + 1; } } else if (from2 <= to1) { if (to2 < to1) { if (from1 <= from2 - 1) { pbuf = addCodeRangeToBuff(pbuf, env, from1, from2 - 1); } from1 = to2 + 1; } else { to1 = from2 - 1; } } else { from1 = from2; } if (from1 > to1) break; } if (from1 <= to1) { pbuf = addCodeRangeToBuff(pbuf, env, from1, to1); } return pbuf; }
public static CodeRangeBuffer andCodeRange1(CodeRangeBuffer pbuf, ScanEnvironment env, int from1, int to1, int[]data, int n) { for (int i=0; i<n; i++) { int from2 = data[i * 2 + 1]; int to2 = data[i * 2 + 2]; if (from2 < from1) { if (to2 < from1) { continue; } else { from1 = to2 + 1; } } else if (from2 <= to1) { if (to2 < to1) { if (from1 <= from2 - 1) { pbuf = addCodeRangeToBuff(pbuf, env, from1, from2 - 1); } from1 = to2 + 1; } else { to1 = from2 - 1; } } else { from1 = from2; } if (from1 > to1) break; } if (from1 <= to1) { pbuf = addCodeRangeToBuff(pbuf, env, from1, to1); } return pbuf; }
protected static CodeRangeBuffer setAllMultiByteRange(ScanEnvironment env, CodeRangeBuffer pbuf) { return addCodeRangeToBuff(pbuf, env, mbcodeStartPosition(env.enc), LAST_CODE_POINT); }
protected static CodeRangeBuffer setAllMultiByteRange(ScanEnvironment env, CodeRangeBuffer pbuf) { return addCodeRangeToBuff(pbuf, env, mbcodeStartPosition(env.enc), LAST_CODE_POINT); }
public static CodeRangeBuffer addCodeRange(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to, boolean checkDup) { if (from >to) { if (env.syntax.allowEmptyRangeInCC()) { return pbuf; } else { throw new ValueException(ErrorMessages.EMPTY_RANGE_IN_CHAR_CLASS); } } return addCodeRangeToBuff(pbuf, env, from, to, checkDup); }
public static CodeRangeBuffer addCodeRange(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to, boolean checkDup) { if (from >to) { if (env.syntax.allowEmptyRangeInCC()) { return pbuf; } else { throw new ValueException(ErrorMessages.EMPTY_RANGE_IN_CHAR_CLASS); } } return addCodeRangeToBuff(pbuf, env, from, to, checkDup); }
public static CodeRangeBuffer notCodeRangeBuff(ScanEnvironment env, CodeRangeBuffer bbuf) { CodeRangeBuffer pbuf = null; if (bbuf == null) return setAllMultiByteRange(env, pbuf); int[]p = bbuf.p; int n = p[0]; if (n <= 0) return setAllMultiByteRange(env, pbuf); int pre = mbcodeStartPosition(env.enc); int from; int to = 0; for (int i=0; i<n; i++) { from = p[i * 2 + 1]; to = p[i * 2 + 2]; if (pre <= from - 1) { pbuf = addCodeRangeToBuff(pbuf, env, pre, from - 1); } if (to == LAST_CODE_POINT) break; pre = to + 1; } if (to < LAST_CODE_POINT) pbuf = addCodeRangeToBuff(pbuf, env, to + 1, LAST_CODE_POINT); return pbuf; }
public static CodeRangeBuffer notCodeRangeBuff(ScanEnvironment env, CodeRangeBuffer bbuf) { CodeRangeBuffer pbuf = null; if (bbuf == null) return setAllMultiByteRange(env, pbuf); int[]p = bbuf.p; int n = p[0]; if (n <= 0) return setAllMultiByteRange(env, pbuf); int pre = mbcodeStartPosition(env.enc); int from; int to = 0; for (int i=0; i<n; i++) { from = p[i * 2 + 1]; to = p[i * 2 + 2]; if (pre <= from - 1) { pbuf = addCodeRangeToBuff(pbuf, env, pre, from - 1); } if (to == LAST_CODE_POINT) break; pre = to + 1; } if (to < LAST_CODE_POINT) pbuf = addCodeRangeToBuff(pbuf, env, to + 1, LAST_CODE_POINT); return pbuf; }
int from = from1 > from2 ? from1 : from2; int to = to1 < to2 ? to1 : to2; pbuf = addCodeRangeToBuff(pbuf, env, from, to);
int from = from1 > from2 ? from1 : from2; int to = to1 < to2 ? to1 : to2; pbuf = addCodeRangeToBuff(pbuf, env, from, to);
int from = p1[i * 2 + 1]; int to = p1[i * 2 + 2]; pbuf = addCodeRangeToBuff(pbuf, env, from, to);
int from = p1[i * 2 + 1]; int to = p1[i * 2 + 2]; pbuf = addCodeRangeToBuff(pbuf, env, from, to);