Mercurial > hg > Applications > Grep
changeset 154:1fad21fd6028 pairPro
remove errors and warnings
author | masa |
---|---|
date | Fri, 18 Dec 2015 14:16:02 +0900 |
parents | e2e717fbeb2f |
children | 6cd0141bed6c |
files | c/regexParser/main.cc c/regexParser/subsetConstraction.cc |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/c/regexParser/main.cc Fri Dec 18 14:02:41 2015 +0900 +++ b/c/regexParser/main.cc Fri Dec 18 14:16:02 2015 +0900 @@ -20,6 +20,5 @@ printf("regex : %s\n",ri->ptr); NodePtr n = regex(ri); printTree(n); - TransitionGenerator tg = generateTransitionList(n); return 0; }
--- a/c/regexParser/subsetConstraction.cc Fri Dec 18 14:02:41 2015 +0900 +++ b/c/regexParser/subsetConstraction.cc Fri Dec 18 14:16:02 2015 +0900 @@ -3,10 +3,9 @@ #include <ctype.h> #include "subsetConstraction.h" -static CharClassPtr createCharClassWord(unsigned char *w, CharClassPtr cc1, CharClassPtr cc2) { CharClassPtr cc = NEW(CharClass); - return cc1; + return cc; } CharClassPtr charClassMerge(CharClassPtr cc,unsigned long begin, unsigned long end, BitVector nextState) { @@ -19,7 +18,7 @@ cc1->left = charClassMerge(cc->left,begin,end,nextState); return cc1; } else { - CharClassPtr cc2 = charClassMerge(begin,end,0,0); + CharClassPtr cc2 = charClassMerge(cc,begin,end,nextState); cc2->nextState = nextState; cc1->left = cc2; return cc1; @@ -34,9 +33,9 @@ return cc; } else if (begin > cc->cond.range.end ) { // 13 if (cc->right) { - cc->right = charClassMerge(cc->right,begin,end); + cc->right = charClassMerge(cc->right,begin,end,nextState); } else { - cc->right = charClassMerge(begin,end,0,0); + cc->right = charClassMerge(cc,begin,end,nextState); } return cc; } @@ -44,7 +43,7 @@ CharClassPtr right = cc->right; begin = cc->cond.range.begin; free(cc); - return charClassMerge(right,begin,end); + return charClassMerge(right,begin,end,nextState); } if (begin >= cc->cond.range.begin && begin <= cc->cond.range.end) { // 12 if (end > cc->cond.range.end) cc->cond.range.end = end; // 11,8 @@ -58,6 +57,7 @@ } TGValue generateTransition(NodePtr n,TransitionGenerator tg) { + TGValue tgv2; if (n->tokenType == '+') { TGValue tgv = generateTransition(n->left,tg); if (tgv.asterisk) { @@ -78,7 +78,7 @@ tgv.asterisk = true; return tgv; } else if (n->tokenType == 'c'){ - + return tgv2; } else if (n->tokenType == 'a'){ TGValue tgv; tgv.ts = (TransitionPtr)malloc(sizeof(Transition)); @@ -90,6 +90,7 @@ } else { // error } + return tgv2; } void printTransitionList(TransitionPtr ts) {