Lines Matching refs:status
95 ParseResourceFunction(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status);
97 static struct SResource *parseResource(ParseState* state, char *tag, const struct UString *comment, UErrorCode *status);
109 getToken(&value, NULL, status);
110 getToken(NULL, NULL, status); bad - value is now a different string
113 initLookahead(ParseState* state, UCHARBUF *buf, UErrorCode *status)
130 state->lookahead[i].type = getNextToken(state->buffer, &state->lookahead[i].value, &state->lookahead[i].line, &state->lookahead[i].comment, status);
131 if (U_FAILURE(*status))
137 *status = U_ZERO_ERROR;
153 getToken(ParseState* state, struct UString **tokenValue, struct UString* comment, uint32_t *linenumber, UErrorCode *status)
172 ustr_cpy(comment, &(state->lookahead[state->lookaheadPosition].comment), status);
177 ustr_setlen(&state->lookahead[i].comment, 0, status);
178 ustr_setlen(&state->lookahead[i].value, 0, status);
179 state->lookahead[i].type = getNextToken(state->buffer, &state->lookahead[i].value, &state->lookahead[i].line, &state->lookahead[i].comment, status);
187 peekToken(ParseState* state, uint32_t lookaheadCount, struct UString **tokenValue, uint32_t *linenumber, struct UString *comment, UErrorCode *status)
191 if (U_FAILURE(*status))
198 *status = U_INTERNAL_PROGRAM_ERROR;
213 ustr_cpy(comment, &(state->lookahead[state->lookaheadPosition].comment), status);
220 expect(ParseState* state, enum ETokenType expectedToken, struct UString **tokenValue, struct UString *comment, uint32_t *linenumber, UErrorCode *status)
224 enum ETokenType token = getToken(state, tokenValue, comment, &line, status);
231 if (U_FAILURE(*status))
238 *status = U_INVALID_FORMAT_ERROR;
243 *status = U_ZERO_ERROR;
247 static char *getInvariantString(ParseState* state, uint32_t *line, struct UString *comment, UErrorCode *status)
253 expect(state, TOK_STRING, &tokenValue, comment, line, status);
255 if (U_FAILURE(*status))
262 *status = U_INVALID_FORMAT_ERROR;
271 *status = U_MEMORY_ALLOCATION_ERROR;
280 parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status)
298 expect(state, TOK_STRING, &tokenValue, NULL, &line, status);
304 if (U_FAILURE(*status))
321 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
323 if (U_FAILURE(*status))
333 ucbuf = ucbuf_open(filename, &cp, getShowWarning(),FALSE, status);
335 if (U_FAILURE(*status)) {
353 c = ucbuf_getc(ucbuf, status);
369 c = ucbuf_getc(ucbuf, status);
375 c = ucbuf_getc(ucbuf, status);
381 c = unescape(ucbuf, status);
414 result = string_open(state->bundle, tag, pTarget, (int32_t)(target - pTarget), NULL, status);
425 parseTransliterator(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status)
439 expect(state, TOK_STRING, &tokenValue, NULL, &line, status);
445 if (U_FAILURE(*status))
462 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
464 if (U_FAILURE(*status))
471 ucbuf = ucbuf_open(filename, &cp, getShowWarning(),FALSE, status);
473 if (U_FAILURE(*status)) {
482 pSource = ucbuf_getBuffer(ucbuf, &size, status);
487 size = utrans_stripRules(pSource, size, pTarget, status);
492 result = string_open(state->bundle, tag, pTarget, size, NULL, status);
503 parseDependency(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status)
512 expect(state, TOK_STRING, &tokenValue, NULL, &line, status);
518 if (U_FAILURE(*status))
535 if (U_FAILURE(*status))
548 dependencyArray = array_open(state->bundle, "%%DEPENDENCY", NULL, status);
551 result = string_open(state->bundle, tag, tokenValue->fChars, tokenValue->fLength, comment, status);
553 elem = string_open(state->bundle, NULL, tokenValue->fChars, tokenValue->fLength, comment, status);
555 array_add(dependencyArray, elem, status);
557 if (U_FAILURE(*status))
561 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
565 parseString(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status)
572 return parseUCARules(tag, startline, status);
577 expect(state, TOK_STRING, &tokenValue, NULL, NULL, status);
579 if (U_SUCCESS(*status))
584 result = string_open(state->bundle, tag, tokenValue->fChars, tokenValue->fLength, comment, status);
585 if(U_SUCCESS(*status) && result) {
586 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
588 if (U_FAILURE(*status))
600 parseAlias(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status)
605 expect(state, TOK_STRING, &tokenValue, NULL, NULL, status);
611 if (U_SUCCESS(*status))
616 result = alias_open(state->bundle, tag, tokenValue->fChars, tokenValue->fLength, comment, status);
618 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
620 if (U_FAILURE(*status))
654 static const UChar* importFromDataFile(void* context, const char* locale, const char* type, int32_t* pLength, UErrorCode* status){
686 if (status==NULL || U_FAILURE(*status)) {
690 *status=U_ILLEGAL_ARGUMENT_ERROR;
711 *status = U_MEMORY_ALLOCATION_ERROR;
727 *status = U_MEMORY_ALLOCATION_ERROR;
753 *status = U_MEMORY_ALLOCATION_ERROR;
763 *status = U_ZERO_ERROR;
764 ucbuf = ucbuf_open(openFileName, &cp,getShowWarning(),TRUE, status);
766 if(*status == U_FILE_ACCESS_ERROR) {
771 if (ucbuf == NULL || U_FAILURE(*status)) {
772 fprintf(stderr, "An error occured processing file %s. Error: %s\n", openFileName == NULL ? filename : openFileName,u_errorName(*status));
777 data = parse(ucbuf, genrbdata->inputDir, genrbdata->outputDir, status);
805 addCollation(ParseState* state, struct SResource *result, uint32_t startline, UErrorCode *status)
822 token = getToken(state, &tokenValue, &comment, &line, status);
832 *status = U_INVALID_FORMAT_ERROR;
848 if (U_FAILURE(*status))
854 member = parseResource(state, subtag, NULL, status);
856 if (U_FAILURE(*status))
875 table_add(result, member, line, status);
886 table_add(result, member, line, status);
935 struct SResource *collationBin = bin_open(state->bundle, "%%CollationBin", len, data, NULL, NULL, status);
936 table_add(result, collationBin, line, status);
942 struct SResource *reorderCodeRes = intvector_open(state->bundle, "%%ReorderCodes", NULL, status);
944 intvector_add(reorderCodeRes, reorderCodes[reorderCodeIndex], status);
946 table_add(result, reorderCodeRes, line, status);
953 *status = U_INVALID_FORMAT_ERROR;
964 *status = intStatus;
969 *status = intStatus;
984 table_add(result, member, line, status);
988 /*member = string_open(bundle, subtag, tokenValue->fChars, tokenValue->fLength, status);*/
990 /*expect(TOK_CLOSE_BRACE, NULL, NULL, status);*/
992 if (U_FAILURE(*status))
1001 /* *status = U_INTERNAL_PROGRAM_ERROR;
1006 parseCollationElements(ParseState* state, char *tag, uint32_t startline, UBool newCollation, UErrorCode *status)
1017 result = table_open(state->bundle, tag, NULL, status);
1019 if (result == NULL || U_FAILURE(*status))
1027 return addCollation(state, result, startline, status);
1032 token = getToken(state, &tokenValue, &comment, &line, status);
1042 *status = U_INVALID_FORMAT_ERROR;
1058 if (U_FAILURE(*status))
1066 member = parseResource(state, subtag, NULL, status);
1068 if (U_FAILURE(*status))
1074 table_add(result, member, line, status);
1078 token = peekToken(state, 0, &tokenValue, &line, &comment, status);
1083 token = getToken(state, &tokenValue, &comment, &line, status);
1084 collationRes = table_open(state->bundle, subtag, NULL, status);
1085 collationRes = addCollation(state, collationRes, startline, status); /* need to parse the collation data regardless */
1087 table_add(result, collationRes, startline, status);
1091 token = peekToken(state, 1, &tokenValue, &line, &comment, status);
1094 member = parseResource(state, subtag, NULL, status);
1096 if (U_FAILURE(*status))
1102 table_add(result, member, line, status);
1105 *status = U_INVALID_FORMAT_ERROR;
1110 *status = U_INVALID_FORMAT_ERROR;
1115 /*member = string_open(bundle, subtag, tokenValue->fChars, tokenValue->fLength, status);*/
1117 /*expect(TOK_CLOSE_BRACE, NULL, NULL, status);*/
1119 if (U_FAILURE(*status))
1131 realParseTable(ParseState* state, struct SResource *table, char *tag, uint32_t startline, UErrorCode *status)
1148 token = getToken(state, &tokenValue, &comment, &line, status);
1160 *status = U_INVALID_FORMAT_ERROR;
1177 *status = U_INVALID_FORMAT_ERROR;
1182 if (U_FAILURE(*status))
1184 error(line, "parse error. Stopped parsing tokens with %s", u_errorName(*status));
1188 member = parseResource(state, subtag, &comment, status);
1190 if (member == NULL || U_FAILURE(*status))
1192 error(line, "parse error. Stopped parsing resource with %s", u_errorName(*status));
1196 table_add(table, member, line, status);
1198 if (U_FAILURE(*status))
1200 error(line, "parse error. Stopped parsing table with %s", u_errorName(*status));
1209 /* *status = U_INTERNAL_PROGRAM_ERROR;
1214 parseTable(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status)
1220 return parseCollationElements(state, tag, startline, FALSE, status);
1224 return parseCollationElements(state, tag, startline, TRUE, status);
1230 result = table_open(state->bundle, tag, comment, status);
1232 if (result == NULL || U_FAILURE(*status))
1237 return realParseTable(state, result, tag, startline, status);
1241 parseArray(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status)
1250 result = array_open(state->bundle, tag, comment, status);
1252 if (result == NULL || U_FAILURE(*status))
1266 ustr_setlen(&memberComments, 0, status);
1269 token = peekToken(state, 0, &tokenValue, NULL, &memberComments, status);
1274 getToken(state, NULL, NULL, NULL, status);
1284 *status = U_INVALID_FORMAT_ERROR;
1292 getToken(state, &tokenValue, &memberComments, NULL, status);
1293 member = string_open(state->bundle, NULL, tokenValue->fChars, tokenValue->fLength, &memberComments, status);
1297 member = parseResource(state, NULL, &memberComments, status);
1300 if (member == NULL || U_FAILURE(*status))
1306 array_add(result, member, status);
1308 if (U_FAILURE(*status))
1315 token = peekToken(state, 0, NULL, NULL, NULL, status);
1319 getToken(state, NULL, NULL, NULL, status);
1322 if (U_FAILURE(*status))
1335 parseIntVector(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status)
1346 result = intvector_open(state->bundle, tag, comment, status);
1348 if (result == NULL || U_FAILURE(*status))
1360 ustr_setlen(&memberComments, 0, status);
1363 token = peekToken(state, 0, NULL, NULL,&memberComments, status);
1368 getToken(state, NULL, NULL, NULL, status);
1376 string = getInvariantString(state, NULL, NULL, status);
1378 if (U_FAILURE(*status))
1390 intvector_add(result, value, status);
1392 token = peekToken(state, 0, NULL, NULL, NULL, status);
1397 *status=U_INVALID_CHAR_FOUND;
1400 if (U_FAILURE(*status))
1410 getToken(state, NULL, NULL, NULL, status);
1417 /* intvector_close(result, status);
1418 *status = U_INTERNAL_PROGRAM_ERROR;
1423 parseBinary(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status)
1435 string = getInvariantString(state, &line, NULL, status);
1437 if (string == NULL || U_FAILURE(*status))
1442 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
1444 if (U_FAILURE(*status))
1462 *status = U_MEMORY_ALLOCATION_ERROR;
1477 *status=U_INVALID_CHAR_FOUND;
1482 result = bin_open(state->bundle, tag, (i >> 1), value,NULL, comment, status);
1488 *status = U_INVALID_CHAR_FOUND;
1496 result = bin_open(state->bundle, tag, 0, NULL, "",comment,status);
1505 parseInteger(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status)
1513 string = getInvariantString(state, NULL, NULL, status);
1515 if (string == NULL || U_FAILURE(*status))
1520 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
1522 if (U_FAILURE(*status))
1543 result = int_open(state->bundle, tag, value, comment, status);
1547 *status=U_INVALID_CHAR_FOUND;
1555 parseImport(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status)
1565 filename = getInvariantString(state, &line, NULL, status);
1567 if (U_FAILURE(*status))
1572 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
1574 if (U_FAILURE(*status))
1612 *status
1630 *status = U_MEMORY_ALLOCATION_ERROR;
1645 *status = U_FILE_ACCESS_ERROR;
1654 *status = U_MEMORY_ALLOCATION_ERROR;
1662 result = bin_open(state->bundle, tag, len, data, fullname, comment, status);
1672 parseInclude(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status)
1686 filename = getInvariantString(state, &line, NULL, status);
1689 if (U_FAILURE(*status))
1694 expect(state, TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
1696 if (U_FAILURE(*status))
1710 *status = U_MEMORY_ALLOCATION_ERROR;
1735 ucbuf = ucbuf_open(fullname, &cp,getShowWarning(),FALSE,status);
1737 if (U_FAILURE(*status)) {
1742 uBuffer = ucbuf_getBuffer(ucbuf,&len,status);
1743 result = string_open(state->bundle, tag, uBuffer, len, comment, status);
1850 parseResourceType(ParseState* state, UErrorCode *status)
1857 expect(state, TOK_STRING, &tokenValue, &comment, &line, status);
1859 if (U_FAILURE(*status))
1864 *status = U_ZERO_ERROR;
1884 *status = U_INVALID_FORMAT_ERROR;
1893 parseResource(ParseState* state, char *tag, const struct UString *comment, UErrorCode *status)
1902 token = getToken(state, &tokenValue, NULL, &startline, status);
1915 *status = U_INVALID_FORMAT_ERROR;
1920 *status = U_INVALID_FORMAT_ERROR;
1924 resType = parseResourceType(state, status);
1925 expect(state, TOK_OPEN_BRACE, &tokenValue, NULL, &startline, status);
1927 if (U_FAILURE(*status))
1938 *status = U_INVALID_FORMAT_ERROR;
1957 token = peekToken(state, 0, NULL, &line, NULL,status);
1959 if (U_FAILURE(*status))
1970 token = peekToken(state, 1, NULL, &line, NULL, status);
1972 if (U_FAILURE(*status))
1984 *status = U_INVALID_FORMAT_ERROR;
1991 *status = U_INVALID_FORMAT_ERROR;
1998 *status = U_INVALID_FORMAT_ERROR;
2007 return parseFunction(state, tag, startline, comment, status);
2010 *status = U_INTERNAL_PROGRAM_ERROR;
2019 parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UErrorCode *status)
2036 initLookahead(&state, buf, status);
2044 expect(&state, TOK_STRING, &tokenValue, &comment, NULL, status);
2046 state.bundle = bundle_open(&comment, FALSE, status);
2048 if (state.bundle == NULL || U_FAILURE(*status))
2054 bundle_setlocale(state.bundle, tokenValue->fChars, status);
2057 token = getToken(&state, NULL, NULL, &line, status);
2059 *status=U_ZERO_ERROR;
2060 bundleType=parseResourceType(&state, status);
2064 expect(&state, TOK_OPEN_BRACE, NULL, NULL, &line, status);
2068 *status=U_PARSE_ERROR;
2071 error(line, "parse error. Stopped parsing with %s", u_errorName(*status));
2079 *status=U_ZERO_ERROR;
2085 *status=U_PARSE_ERROR;
2087 error(line, "parse error, did not find open-brace '{' or colon ':', stopped with %s", u_errorName(*status));
2091 if (U_FAILURE(*status))
2093 bundle_close(state.bundle, status);
2106 realParseTable(&state, state.bundle->fRoot, NULL, line, status);
2109 table_add(state.bundle->fRoot, dependencyArray, 0, status);
2112 if (U_FAILURE(*status))
2114 bundle_close(state.bundle, status);
2119 if (getToken(&state, NULL, NULL, &line, status) != TOK_EOF)
2123 *status = U_INVALID_FORMAT_ERROR;