Lines Matching refs:rule
303 int32_t parse(const UnicodeString& rule, int32_t pos, int32_t limit, UErrorCode& status);
305 int32_t parseSection(const UnicodeString& rule, int32_t pos, int32_t limit,
329 const UnicodeString& rule, in syntaxError() argument
332 return parser.syntaxError(code, rule, start, status); in syntaxError()
362 int32_t RuleHalf::parse(const UnicodeString& rule, int32_t pos, int32_t limit, UErrorCode& status) { in parse() argument
365 pos = parseSection(rule, pos, limit, text, UnicodeString(TRUE, ILLEGAL_TOP, -1), FALSE, status); in parse()
368 return syntaxError(U_MISPLACED_CURSOR_OFFSET, rule, start, status); in parse()
397 int32_t RuleHalf::parseSection(const UnicodeString& rule, int32_t pos, int32_t limit, in parseSection() argument
414 UChar c = rule.charAt(pos++); in parseSection()
424 return syntaxError(U_UNCLOSED_SEGMENT, rule, start, status); in parseSection()
430 return syntaxError(U_MALFORMED_VARIABLE_REFERENCE, rule, start, status); in parseSection()
432 if (UnicodeSet::resemblesPattern(rule, pos-1)) { in parseSection()
434 buf.append(parser.parseSet(rule, pp, status)); in parseSection()
436 return syntaxError(U_MALFORMED_SET, rule, start, status); in parseSection()
444 return syntaxError(U_TRAILING_BACKSLASH, rule, start, status); in parseSection()
446 UChar32 escaped = rule.unescapeAt(pos); // pos is already past '\\' in parseSection()
448 return syntaxError(U_MALFORMED_UNICODE_ESCAPE, rule, start, status); in parseSection()
451 return syntaxError(U_VARIABLE_RANGE_OVERLAP, rule, start, status); in parseSection()
458 int32_t iq = rule.indexOf(QUOTE, pos); in parseSection()
472 return syntaxError(U_UNTERMINATED_QUOTE, rule, start, status); in parseSection()
475 rule.extractBetween(pos, iq, scratch); in parseSection()
478 if (pos < limit && rule.charAt(pos) == QUOTE) { in parseSection()
480 iq = rule.indexOf(QUOTE, pos+1); in parseSection()
490 return syntaxError(U_VARIABLE_RANGE_OVERLAP, rule, start, status); in parseSection()
498 return syntaxError(U_VARIABLE_RANGE_OVERLAP, rule, start, status); in parseSection()
502 syntaxError(U_ILLEGAL_CHARACTER, rule, start, status); in parseSection()
515 rule, start, status); in parseSection()
530 … pos = parseSection(rule, pos, limit, buf, UnicodeString(TRUE, ILLEGAL_SEG, -1), TRUE, status); in parseSection()
540 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseSection()
554 TransliteratorIDParser::parseFilterID(rule, iref); in parseSection()
557 !ICU_Utility::parseChar(rule, iref, SEGMENT_OPEN)) { in parseSection()
558 return syntaxError(U_INVALID_FUNCTION, rule, start, status); in parseSection()
564 return syntaxError(U_INVALID_FUNCTION, rule, start, status); in parseSection()
572 … pos = parseSection(rule, iref, limit, buf, UnicodeString(TRUE, ILLEGAL_FUNC, -1), TRUE, status); in parseSection()
581 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseSection()
603 c = rule.charAt(pos); in parseSection()
606 r = ICU_Utility::parseNumber(rule, pos, 10); in parseSection()
609 rule, start, status); in parseSection()
615 parseReference(rule, pp, limit); in parseSection()
651 return syntaxError(U_MISPLACED_QUANTIFIER, rule, start, status); in parseSection()
675 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseSection()
692 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseSection()
713 return syntaxError(U_MULTIPLE_ANTE_CONTEXTS, rule, start, status); in parseSection()
719 return syntaxError(U_MULTIPLE_POST_CONTEXTS, rule, start, status); in parseSection()
725 return syntaxError(U_MULTIPLE_CURSORS, rule, start, status); in parseSection()
732 return syntaxError(U_MISPLACED_CURSOR_OFFSET, rule, start, status); in parseSection()
737 return syntaxError(U_MISPLACED_CURSOR_OFFSET, rule, start, status); in parseSection()
747 return syntaxError(U_MISPLACED_CURSOR_OFFSET, rule, start, status); in parseSection()
764 return syntaxError(U_UNQUOTED_SPECIAL, rule, start, status); in parseSection()
884 void TransliteratorParser::parseRules(const UnicodeString& rule, in parseRules() argument
926 int32_t limit = rule.length(); in parseRules()
937 UChar c = rule.charAt(pos++); in parseRules()
944 pos = rule.indexOf((UChar)0x000A /*\n*/, pos) + 1; in parseRules()
964 rule.compare(pos, ID_TOKEN_LEN, ID_TOKEN) == 0) { in parseRules()
966 c = rule.charAt(pos); in parseRules()
969 c = rule.charAt(pos); in parseRules()
986 TransliteratorIDParser::parseSingleID(rule, p, direction, status); in parseRules()
987 if (p != pos && ICU_Utility::parseChar(rule, p, END_OF_RULE)) { in parseRules()
1000 … UnicodeSet* f = TransliteratorIDParser::parseGlobalFilter(rule, p, direction, withParens, NULL); in parseRules()
1002 if (ICU_Utility::parseChar(rule, p, END_OF_RULE) in parseRules()
1007 syntaxError(U_MULTIPLE_COMPOUND_FILTERS, rule, pos, status); in parseRules()
1019 syntaxError(U_INVALID_ID, rule, pos, status); in parseRules()
1053 if (resemblesPragma(rule, pos, limit)) { in parseRules()
1054 int32_t ppp = parsePragma(rule, pos, limit, status); in parseRules()
1056 syntaxError(U_MALFORMED_PRAGMA, rule, pos, status); in parseRules()
1061 pos = parseRule(rule, pos, limit, status); in parseRules()
1199 UBool TransliteratorParser::resemblesPragma(const UnicodeString& rule, int32_t pos, int32_t limit) { in resemblesPragma() argument
1201 … return ICU_Utility::parsePattern(rule, pos, limit, UnicodeString(TRUE, PRAGMA_USE, 4), NULL) >= 0; in resemblesPragma()
1213 int32_t TransliteratorParser::parsePragma(const UnicodeString& rule, int32_t pos, int32_t limit, UE… in parsePragma() argument
1226 …int p = ICU_Utility::parsePattern(rule, pos, limit, UnicodeString(TRUE, PRAGMA_VARIABLE_RANGE, -1)… in parsePragma()
1232 …p = ICU_Utility::parsePattern(rule, pos, limit, UnicodeString(TRUE, PRAGMA_MAXIMUM_BACKUP, -1), ar… in parsePragma()
1238 … p = ICU_Utility::parsePattern(rule, pos, limit, UnicodeString(TRUE, PRAGMA_NFD_RULES, -1), NULL); in parsePragma()
1244 … p = ICU_Utility::parsePattern(rule, pos, limit, UnicodeString(TRUE, PRAGMA_NFC_RULES, -1), NULL); in parsePragma()
1267 int32_t TransliteratorParser::parseRule(const UnicodeString& rule, int32_t pos, int32_t limit, UErr… in parseRule() argument
1283 pos = left->parse(rule, pos, limit, status); in parseRule()
1288 if (pos == limit || u_strchr(gOPERATORS, (op = rule.charAt(--pos))) == NULL) { in parseRule()
1289 return syntaxError(U_MISSING_OPERATOR, rule, start, status); in parseRule()
1295 (pos < limit && rule.charAt(pos) == FORWARD_RULE_OP)) { in parseRule()
1313 pos = right->parse(rule, pos, limit, status); in parseRule()
1319 if (rule.charAt(--pos) == END_OF_RULE) { in parseRule()
1323 return syntaxError(U_UNQUOTED_SPECIAL, rule, start, status); in parseRule()
1337 return syntaxError(U_BAD_VARIABLE_DEFINITION, rule, start, status); in parseRule()
1341 return syntaxError(U_MALFORMED_VARIABLE_DEFINITION, rule, start, status); in parseRule()
1345 return syntaxError(U_MALFORMED_VARIABLE_DEFINITION, rule, start, status); in parseRule()
1351 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseRule()
1363 rule, start, status); in parseRule()
1368 syntaxError(U_UNDEFINED_SEGMENT_REFERENCE, rule, start, status); in parseRule()
1372 syntaxError(U_INTERNAL_TRANSLITERATOR_ERROR, rule, start, status); // will never happen in parseRule()
1377 syntaxError(U_INTERNAL_TRANSLITERATOR_ERROR, rule, start, status); // will never happen in parseRule()
1430 return syntaxError(U_MALFORMED_RULE, rule, start, status); in parseRule()
1439 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseRule()
1454 return syntaxError(U_MEMORY_ALLOCATION_ERROR, rule, start, status); in parseRule()
1472 const UnicodeString& rule, in syntaxError() argument
1484 rule.extract(start,stop-start,parseError.preContext); in syntaxError()
1490 stop = uprv_min(pos + LEN, rule.length()); in syntaxError()
1492 rule.extract(start,stop-start,parseError.postContext); in syntaxError()
1505 UChar TransliteratorParser::parseSet(const UnicodeString& rule, in parseSet() argument
1508 UnicodeSet* set = new UnicodeSet(rule, pos, USET_IGNORE_SPACE, parseData, status); in parseSet()