Home | History | Annotate | Download | only in common

Lines Matching refs:pattern

104 // if we have a correct pattern and the properties data is hardcoded and always available.
107 UnicodeSetSingleton(SimpleSingleton &s, const char *pattern) :
108 SimpleSingletonWrapper<UnicodeSet>(s), fPattern(pattern) {}
114 UnicodeString pattern((const char *)context, -1, US_INV);
115 UnicodeSet *set=new UnicodeSet(pattern, errorCode);
282 // helper functions for matching of pattern syntax pieces ------------------ ***
290 isPerlOpen(const UnicodeString &pattern, int32_t pos) {
292 return pattern.charAt(pos)==BACKSLASH && ((c=pattern.charAt(pos+1))==LOWER_P || c==UPPER_P);
296 isPerlClose(const UnicodeString &pattern, int32_t pos) {
297 return pattern.charAt(pos)==CLOSE_BRACE;
301 isNameOpen(const UnicodeString &pattern, int32_t pos) {
302 return pattern.charAt(pos)==BACKSLASH && pattern.charAt(pos+1)==UPPER_N;
306 isPOSIXOpen(const UnicodeString &pattern, int32_t pos) {
307 return pattern.charAt(pos)==SET_OPEN && pattern.charAt(pos+1)==COLON;
311 isPOSIXClose(const UnicodeString &pattern, int32_t pos) {
312 return pattern.charAt(pos)==COLON && pattern.charAt(pos+1)==SET_CLOSE;
325 * Constructs a set from the given pattern, optionally ignoring
327 * pattern language.
328 * @param pattern a string specifying what characters are in the set
330 UnicodeSet::UnicodeSet(const UnicodeString& pattern,
343 applyPattern(pattern, USET_IGNORE_SPACE, NULL, status);
350 * Constructs a set from the given pattern, optionally ignoring
352 * pattern language.
353 * @param pattern a string specifying what characters are in the set
354 * @param options bitmask for options to apply to the pattern.
357 UnicodeSet::UnicodeSet(const UnicodeString& pattern,
372 applyPattern(pattern, options, symbols, status);
378 UnicodeSet::UnicodeSet(const UnicodeString& pattern, ParsePosition& pos,
393 applyPattern(pattern, pos, options, symbols, status);
403 UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern,
405 return applyPattern(pattern, USET_IGNORE_SPACE, NULL, status);
411 * pattern, optionally ignoring white space. See the class
412 * description for the syntax of the pattern language.
413 * @param pattern a string specifying what characters are in the set
414 * @param options bitmask for options to apply to the pattern.
417 UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern,
426 applyPattern(pattern, pos, options, symbols, status);
433 ICU_Utility::skipWhitespace(pattern, i, TRUE);
436 if (i != pattern.length()) {
442 UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern,
450 // Need to build the pattern in a temporary string because
453 RuleCharacterIterator chars(pattern, symbols, pos);
466 * Return true if the given position, in the given pattern, appears
467 * to be the start of a UnicodeSet pattern.
469 UBool UnicodeSet::resemblesPattern(const UnicodeString& pattern, int32_t pos) {
470 return ((pos+1) < pattern.length() &&
471 pattern.charAt(pos) == (UChar)91/*[*/) ||
472 resemblesPropertyPattern(pattern, pos);
476 // Implementation: Pattern parsing
498 * Parse the pattern from the given RuleCharacterIterator. The
499 * iterator is advanced over the parsed pattern.
500 * @param chars iterator over the pattern characters. Upon return
502 * pattern, or the end of the iteration if all characters are
506 * @param rebuiltPat the pattern that was parsed, rebuilt or
507 * copied from the input pattern, as appropriate.
553 // -------- Check for property pattern
564 // opening delimiter for this pattern, parse special
620 // the pattern or represented by a stand-in that has
666 // Entire pattern is a category; leave parse loop
878 * pattern should be compiled case-insensitive, then we need
892 // Use the rebuilt pattern (patLocal) only if necessary. Prefer the
893 // generated pattern.
1208 * Return true if the given position, in the given pattern, appears
1209 * to be the start of a property set pattern.
1211 UBool UnicodeSet::resemblesPropertyPattern(const UnicodeString& pattern,
1214 if ((pos+5) > pattern.length()) {
1219 return isPOSIXOpen(pattern, pos) || isPerlOpen(pattern, pos) || isNameOpen(pattern, pos);
1224 * property pattern. Regardless of the result, return with the
1226 * @param chars iterator over the pattern characters. Upon return
1250 * Parse the given property pattern at the given parse position.
1252 UnicodeSet& UnicodeSet::applyPropertyPattern(const UnicodeString& pattern,
1264 if ((pos+5) > pattern.length()) {
1270 if (isPOSIXOpen(pattern, pos)) {
1273 pos = ICU_Utility::skipWhitespace(pattern, pos);
1274 if (pos < pattern.length() && pattern.charAt(pos) == COMPLEMENT) {
1278 } else if (isPerlOpen(pattern, pos) || isNameOpen(pattern, pos)) {
1279 UChar c = pattern.charAt(pos+1);
1283 pos = ICU_Utility::skipWhitespace(pattern, pos);
1284 if (pos == pattern.length() || pattern.charAt(pos++) != OPEN_BRACE) {
1294 int32_t close = pattern.indexOf(posix ? POSIX_CLOSE : PERL_CLOSE, pos);
1302 // pattern.
1303 int32_t equals = pattern.indexOf(EQUALS, pos);
1306 // Equals seen; parse medium/long pattern
1307 pattern.extractBetween(pos, equals, propName);
1308 pattern.extractBetween(equals+1, close, valueName);
1313 pattern.extractBetween(pos, close, propName);
1343 * Parse a property pattern.
1344 * @param chars iterator over the pattern characters. Upon return
1346 * pattern, or the end of the iteration if all characters are
1348 * @param rebuiltPat the pattern that was parsed, rebuilt or
1349 * copied from the input pattern, as appropriate.
1355 UnicodeString pattern;
1356 chars.lookahead(pattern);
1358 applyPropertyPattern(pattern, pos, ec);
1361 // syntaxError(chars, "Invalid property pattern");
1366 rebuiltPat.append(pattern, 0, pos.getIndex());