Mercurial > hg > Applications > Grep
comparison c/regexParser/subsetConstraction.cc @ 143:32977f5a2ed0 pairPro
add charClassMerge
author | masa |
---|---|
date | Fri, 11 Dec 2015 15:04:58 +0900 |
parents | de0f332d560c |
children | d8a4922eceae |
comparison
equal
deleted
inserted
replaced
142:de0f332d560c | 143:32977f5a2ed0 |
---|---|
1 #include <stdio.h> | 1 #include <stdio.h> |
2 #include <stdlib.h> | 2 #include <stdlib.h> |
3 #include <ctype.h> | 3 #include <ctype.h> |
4 #include "subsetConstraction.h" | 4 #include "subsetConstraction.h" |
5 | |
6 CharClassPtr charClassMerge(CharClassPtr src, CharClassPtr add) { | |
7 // 重なっているccの領域を分割する | |
8 // 必要ならばnextStateを重ねあわせる | |
9 // 変更があった場合は新しくリストを作って返す | |
10 if (src->type == 'a') { | |
11 if (add->type == 'a') { | |
12 if (src->cond.w.word[0] > add->cond.w.word[0]) { | |
13 // add のほうが小さいので小さい順のccをつくる | |
14 CharClassPtr left = charClassMerge(add->left.src); | |
15 return createCharClassWord(add->cond->w.word, left, add->right); | |
16 } else { | |
17 | |
18 } | |
19 } else if (add->type == 'c') { | |
20 // | |
21 if (src->cond.w.word[0] < add->cond.range.begin) { | |
22 | |
23 } else (src->cond->w.word[0] < add->end) { | |
24 } else if (src->type == 'c') { | |
25 | |
26 } | |
27 } | |
5 | 28 |
6 void printTransition(TransitionPtr ts) { | 29 void printTransition(TransitionPtr ts) { |
7 for (;;) { | 30 for (;;) { |
8 printf("Input Condition : %c\n",ts->condition->cond->w->word); | 31 printf("Input Condition : %c\n",ts->condition->cond->w->word); |
9 printf("Next State : "); bitPrint(ts->nextState); printf("\n"); | 32 printf("Next State : "); bitPrint(ts->nextState); printf("\n"); |