19 #include "stringManipulate.h"
30 unsigned int* currRuleIndex,
unsigned int initialLeftRulesCount);
35 unsigned int ruleIterL = 0;
36 unsigned int ruleIterR = 0;
37 unsigned int prodIterL = 0;
38 unsigned int prodIterR = 0;
39 unsigned int currRuleIndex;
40 unsigned int initialLeftRulesCount;
69 initialLeftRulesCount = left->
count;
72 for(ruleIterR = 1; ruleIterR < right->
count; ruleIterR++)
78 for(prodIterR = 0; prodIterR < right->
rule[ruleIterR].
count; prodIterR++)
87 currRuleIndex = left->
count;
89 for(ruleIterL = 0; ruleIterL < initialLeftRulesCount; ruleIterL++)
91 for(prodIterL = 0; prodIterL < left->
rule[ruleIterL].
count; prodIterL++)
95 if(!rulesEqual(left, ruleIterL, right, 0))
103 for(prodIterR = 0; prodIterR < right->
rule[0].
count; prodIterR++)
115 TRY(addProductionsToARule(left,
120 initialLeftRulesCount - 1));
132 unsigned int* currRuleIndex,
unsigned int initialLeftRulesCount)
135 unsigned int prodIterL = 0;
136 unsigned int prodIterR = 0;
137 boolean rProdFoundInLeft =
FALSE;
139 unsigned int prodCountR = right->
rule[ruleIndxR].
count;
141 for(prodIterR = 0; prodIterR < prodCountR; prodIterR++)
144 rProdFoundInLeft =
FALSE;
157 unsigned int tmpIterL, tmpIterR;
158 boolean equalRRuleFound =
FALSE;
159 boolean allRProdIn =
TRUE;
160 boolean rProdFound =
FALSE;
163 for(tmpIterR = 0; tmpIterR < right->
rule[ruleIndxR].
count; tmpIterR++)
168 for(tmpIterL = 0; tmpIterL < left->
rule[ruleIndxL].
count; tmpIterL++)
177 if(rProdFound ==
FALSE)
188 nonTermRight = ruleIndxL;
193 for(tmpIterL = 0; tmpIterL < left->
count; tmpIterL++)
195 if(tmpIterL != ruleIndxL && rulesEqual(left, tmpIterL, right, ruleIndxR))
198 nonTermRight = tmpIterL;
199 equalRRuleFound =
TRUE;
204 if(equalRRuleFound ==
FALSE)
208 nonTermRight = *currRuleIndex;
214 for(tmpIterR = 0; tmpIterR < right->
rule[ruleIndxR].
count; tmpIterR++)
228 for(prodIterL = 0; prodIterL < left->
rule[ruleIndxL].
count; prodIterL++)
244 rProdFoundInLeft =
TRUE;
256 rProdFoundInLeft =
TRUE;
276 if(rProdFoundInLeft ==
FALSE)
314 if(isMixedContent && contentTypeGrammar !=
NULL)
321 for(i = 0; i < contentTypeGrammar->
count; i++)
327 if(attrUseArray->
count > 0)
335 for(i = 0; i < attrUseArray->
count; i++)
342 if(contentTypeGrammar !=
NULL)
349 if(contentTypeGrammar !=
NULL)
398 for(i = 0; i < minOccurs; i++)
403 if(maxOccurs - minOccurs > 0 || maxOccurs < 0)
405 boolean prodEEFound =
FALSE;
406 for(i = 0; i < (int)termGrammar->
rule[0].
count; i++)
414 if(prodEEFound ==
FALSE)
421 for(i = 0; i < maxOccurs - minOccurs; i++)
429 unsigned int currRuleIndex = termGrammar->
count;
432 for(i = 1; i < (int)termGrammar->
count; i++)
434 for(j = 0; j < termGrammar->
rule[i].
count; j++)
438 if(!rulesEqual(termGrammar, i, termGrammar, 0))
447 for(prodIterR = 0; prodIterR < termGrammar->
rule[0].
count; prodIterR++)
459 TRY(addProductionsToARule(termGrammar,
489 for(i = 0; i < count; i++)
508 TRY(
addProtoRule(wildcardGrammar, wildcardArraySize + 1, &pRuleEntry));
509 if(wildcardArraySize == 0 ||
510 (wildcardArraySize == 1 &&
519 else if(wildcardArraySize >= 1)
524 for(i = 0; i < wildcardArraySize; i++)
559 for(i = 0; i < arrSize; i++)
571 unsigned int ruleIterTerm = 0;
572 unsigned int prodIterTerm = 0;
573 unsigned int currRuleIndex;
574 unsigned int initialResultRulesCount;
583 tmpGrammar = pgArray->
pg[0];
584 if(tmpGrammar ==
NULL)
589 for(i = 1; i < pgArray->
count; i++)
592 tmpGrammar = pgArray->
pg[i];
594 if(tmpGrammar ==
NULL)
597 initialResultRulesCount = modGrpGrammar->
count;
599 for(ruleIterTerm = 1; ruleIterTerm < tmpGrammar->
count; ruleIterTerm++)
603 for(prodIterTerm = 0; prodIterTerm < tmpGrammar->
rule[ruleIterTerm].
count; prodIterTerm++)
613 currRuleIndex = modGrpGrammar->
count;
615 if(!rulesEqual(modGrpGrammar, 0, tmpGrammar, 0))
621 for(prodIterR = 0; prodIterR < tmpGrammar->
rule[0].
count; prodIterR++)
633 TRY(addProductionsToARule(modGrpGrammar,
638 initialResultRulesCount - 1));
723 for(i = 0; i < g1->
rule[ruleIndx1].
count; i++)
726 for(j = 0; j < g2->
rule[ruleIndx2].
count; j++)