• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/ICU-531.30/icuSources/common/

Lines Matching refs:pattern

280 // helper functions for matching of pattern syntax pieces ------------------ ***
288 isPerlOpen(const UnicodeString &pattern, int32_t pos) {
290 return pattern.charAt(pos)==BACKSLASH && ((c=pattern.charAt(pos+1))==LOWER_P || c==UPPER_P);
294 isPerlClose(const UnicodeString &pattern, int32_t pos) {
295 return pattern.charAt(pos)==CLOSE_BRACE;
299 isNameOpen(const UnicodeString &pattern, int32_t pos) {
300 return pattern.charAt(pos)==BACKSLASH && pattern.charAt(pos+1)==UPPER_N;
304 isPOSIXOpen(const UnicodeString &pattern, int32_t pos) {
305 return pattern.charAt(pos)==SET_OPEN && pattern.charAt(pos+1)==COLON;
309 isPOSIXClose(const UnicodeString &pattern, int32_t pos) {
310 return pattern.charAt(pos)==COLON && pattern.charAt(pos+1)==SET_CLOSE;
323 * Constructs a set from the given pattern, optionally ignoring
325 * pattern language.
326 * @param pattern a string specifying what characters are in the set
328 UnicodeSet::UnicodeSet(const UnicodeString& pattern,
341 applyPattern(pattern, status);
351 UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern,
354 // return applyPattern(pattern, USET_IGNORE_SPACE, NULL, status);
357 applyPatternIgnoreSpace(pattern, pos, NULL, status);
362 ICU_Utility::skipWhitespace(pattern, i, TRUE);
363 if (i != pattern.length()) {
370 UnicodeSet::applyPatternIgnoreSpace(const UnicodeString& pattern,
381 // Need to build the pattern in a temporary string because
384 RuleCharacterIterator chars(pattern, symbols, pos);
396 * Return true if the given position, in the given pattern, appears
397 * to be the start of a UnicodeSet pattern.
399 UBool UnicodeSet::resemblesPattern(const UnicodeString& pattern, int32_t pos) {
400 return ((pos+1) < pattern.length() &&
401 pattern.charAt(pos) == (UChar)91/*[*/) ||
402 resemblesPropertyPattern(pattern, pos);
428 * Parse the pattern from the given RuleCharacterIterator. The
429 * iterator is advanced over the parsed pattern.
430 * @param chars iterator over the pattern characters. Upon return
432 * pattern, or the end of the iteration if all characters are
436 * @param rebuiltPat the pattern that was parsed, rebuilt or
437 * copied from the input pattern, as appropriate.
484 // -------- Check for property pattern
495 // opening delimiter for this pattern, parse special
551 // the pattern or represented by a stand-in that has
597 // Entire pattern is a category; leave parse loop
809 * pattern should be compiled case-insensitive, then we need
823 // Use the rebuilt pattern (patLocal) only if necessary. Prefer the
824 // generated pattern.
1136 * Return true if the given position, in the given pattern, appears
1137 * to be the start of a property set pattern.
1139 UBool UnicodeSet::resemblesPropertyPattern(const UnicodeString& pattern,
1142 if ((pos+5) > pattern.length()) {
1147 return isPOSIXOpen(pattern, pos) || isPerlOpen(pattern, pos) || isNameOpen(pattern, pos);
1152 * property pattern. Regardless of the result, return with the
1154 * @param chars iterator over the pattern characters. Upon return
1178 * Parse the given property pattern at the given parse position.
1180 UnicodeSet& UnicodeSet::applyPropertyPattern(const UnicodeString& pattern,
1192 if ((pos+5) > pattern.length()) {
1198 if (isPOSIXOpen(pattern, pos)) {
1201 pos = ICU_Utility::skipWhitespace(pattern, pos);
1202 if (pos < pattern.length() && pattern.charAt(pos) == COMPLEMENT) {
1206 } else if (isPerlOpen(pattern, pos) || isNameOpen(pattern, pos)) {
1207 UChar c = pattern.charAt(pos+1);
1211 pos = ICU_Utility::skipWhitespace(pattern, pos);
1212 if (pos == pattern.length() || pattern.charAt(pos++) != OPEN_BRACE) {
1224 close = pattern.indexOf(POSIX_CLOSE, 2, pos);
1226 close = pattern.indexOf(CLOSE_BRACE, pos);
1235 // pattern.
1236 int32_t equals = pattern.indexOf(EQUALS, pos);
1239 // Equals seen; parse medium/long pattern
1240 pattern.extractBetween(pos, equals, propName);
1241 pattern.extractBetween(equals+1, close, valueName);
1246 pattern.extractBetween(pos, close, propName);
1276 * Parse a property pattern.
1277 * @param chars iterator over the pattern characters. Upon return
1279 * pattern, or the end of the iteration if all characters are
1281 * @param rebuiltPat the pattern that was parsed, rebuilt or
1282 * copied from the input pattern, as appropriate.
1288 UnicodeString pattern;
1289 chars.lookahead(pattern);
1291 applyPropertyPattern(pattern, pos, ec);
1294 // syntaxError(chars, "Invalid property pattern");
1299 rebuiltPat.append(pattern, 0, pos.getIndex());