24 #include "stringManipulate.h"
34 unsigned int bitCount;
35 unsigned int tmp_bits_val = 0;
52 #if BUILD_IN_GRAMMARS_USE
59 #if DEBUG_CONTENT_IO == ON
64 prodCount = currentRule->
pCount;
92 return handleProduction(strm, ¤tRule->
production[0], nonTermID_out, handler, app_data);
98 if(tmp_bits_val < prodCount)
116 return handleProduction(strm, ¤tRule->
production[prodCount - 1 - tmp_bits_val], nonTermID_out, handler, app_data);
124 return stateMachineProdDecode(strm, currentRule, nonTermID_out, handler, app_data);
167 unsigned int prodCnt = 0;
168 unsigned int tmp_bits_val = 0;
173 #if BUILD_IN_GRAMMARS_USE
180 unsigned int state = 0;
191 state_mask[4] =
TRUE;
192 state_mask[5] =
TRUE;
197 state_mask[0] =
TRUE;
198 state_mask[1] =
TRUE;
203 state_mask[2] =
TRUE;
209 state_mask[3] =
TRUE;
216 state_mask[6] =
TRUE;
222 state_mask[7] =
TRUE;
226 state = tmp_bits_val;
228 for(i = 0; i <= state && state < 8; i++)
230 state = state + (state_mask[i] == 0);
316 unsigned int state = 0;
317 unsigned int level3ProdCnt = 0;
330 if(level3ProdCnt > 0)
336 if(tmp_bits_val == 0)
338 else if(tmp_bits_val == 1)
341 if(level3ProdCnt == 2)
344 state = tmp_bits_val + 1;
346 else if(level3ProdCnt == 1)
356 else if(prodCnt == 1)
363 if(level3ProdCnt == 2)
366 state = tmp_bits_val + 1;
368 else if(level3ProdCnt == 1)
390 state = tmp_bits_val + 1;
392 else if(prodCnt == 1)
438 unsigned int state = 1;
454 else if(prodCnt == 2)
476 TRY(decodeQNameValue(strm, handler, nonTermID_out, app_data));
514 unsigned int state = 0;
521 boolean state_mask[11] = {
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE, FALSE};
531 boolean isContent2Grammar =
FALSE;
536 isContent2Grammar =
TRUE;
541 isContent2Grammar =
TRUE;
545 state_mask[7] =
TRUE;
546 state_mask[8] =
TRUE;
547 if(isContent2Grammar ||
551 state_mask[3] =
TRUE;
552 state_mask[4] =
TRUE;
558 state_mask[0] =
TRUE;
564 state_mask[1] =
TRUE;
565 state_mask[2] =
TRUE;
570 state_mask[5] =
TRUE;
575 state_mask[6] =
TRUE;
582 state_mask[9] =
TRUE;
588 state_mask[10] =
TRUE;
593 state = tmp_bits_val;
595 for(i = 0; i <= state && state < 11; i++)
597 state = state + (state_mask[i] == 0);
623 TRY(decodeQNameValue(strm, handler, nonTermID_out, app_data));
746 unsigned int tmp_val_buf = 0;
760 *uriId = tmp_val_buf - 1;
808 unsigned char prefixBits = 0;
809 unsigned int prefixID = 0;
837 unsigned int tmp_val_buf = 0;
852 *pfxId = tmp_val_buf-1;
868 #if VALUE_CROSSTABLE_USE
869 unsigned int vxEntryId = 0;
870 unsigned char vxBits;
886 unsigned int valueEntryID = 0;
887 unsigned char valueBits;
938 #if DEBUG_CONTENT_IO == ON && EXIP_DEBUG_LEVEL == INFO
958 if(elemGrammar !=
NULL)
980 #if DEBUG_CONTENT_IO == ON && EXIP_DEBUG_LEVEL == INFO
1050 unsigned int uintVal;
1104 if(bool_val ==
TRUE)
1139 unsigned int totalDigits = 0;
1141 if(decVal.exponent != 0 && decVal.mantissa != 0)
1143 int64_t mantissa = decVal.mantissa;
1150 if(decVal.exponent > 0)
1151 totalDigits += decVal.exponent;
1162 unsigned int fractionDigits = 0;
1164 if(decVal.exponent < 0 && decVal.mantissa != 0)
1165 fractionDigits = -decVal.exponent;
1210 for(i = 0; i < itemCount; i++)
1212 TRY(
decodeValueItem(strm, itemTypeId, handler, nonTermID_out, localQNameID, app_data));
1220 TRY(decodeQNameValue(strm, handler, nonTermID_out, app_data));
1226 boolean freeable =
FALSE;
1236 eDefSearch.
typeId = typeId;
1238 if(eDefFound ==
NULL)
1271 boolean bool =
FALSE;
1306 #if EXI_PROFILE_DEFAULT
1314 if(elemGrammar !=
NULL)
1321 #if BUILD_IN_GRAMMARS_USE
1324 TRY(createBuiltInElementGrammar(&newElementGrammar, strm));
1329 #elif EXI_PROFILE_DEFAULT
1331 unsigned int prodCnt = 4;
1332 unsigned int tmp_bits_val = 0;
1335 boolean nsProdHit =
FALSE;
1350 if(tmp_bits_val != 1)
1360 if(tmp_bits_val != 1)
1402 if(elemGrammar !=
NULL)
1438 DEBUG_MSG(
ERROR,
DEBUG_CONTENT_IO, (
">In schema-informed grammars, xsi:type and xsi:nil attributes MUST NOT be represented using AT(*) terminal\n"));
1472 if(newGrammar !=
NULL)