| 1313 | } |
| 1314 | |
| 1315 | void* fxCharSetStringsDisjunction(txPatternParser* parser, txCharSet* set) |
| 1316 | { |
| 1317 | void* result = set; |
| 1318 | if (set->strings) { |
| 1319 | txDisjunction* disjunction; |
| 1320 | txInteger index = 0; |
| 1321 | void* left = NULL; |
| 1322 | void* right = NULL; |
| 1323 | while (index < set->stringCount) { |
| 1324 | right = fxCharSetStringsSequence(parser, set->strings[index]); |
| 1325 | if (left) { |
| 1326 | disjunction = fxPatternParserCreateTerm(parser, sizeof(txDisjunction), fxDisjunctionMeasure); |
| 1327 | disjunction->left = left; |
| 1328 | disjunction->right = right; |
| 1329 | result = disjunction; |
| 1330 | } |
| 1331 | else { |
| 1332 | result = right; |
| 1333 | } |
| 1334 | left = result; |
| 1335 | index++; |
| 1336 | } |
| 1337 | if (set->characters[0]) { |
| 1338 | disjunction = fxPatternParserCreateTerm(parser, sizeof(txDisjunction), fxDisjunctionMeasure); |
| 1339 | disjunction->left = result; |
| 1340 | disjunction->right = (txTerm*)set; |
| 1341 | result = disjunction; |
| 1342 | } |
| 1343 | } |
| 1344 | return result; |
| 1345 | } |
| 1346 | |
| 1347 | void* fxCharSetStringsSequence(txPatternParser* parser, txString string) |
| 1348 | { |
no test coverage detected