Mercurial > hg > Members > masakoha > testcode
changeset 148:d1ebba6e117a pairPro
add test routing
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Dec 2015 18:09:54 +0900 |
parents | 84d32375383a |
children | f1880f25fabf |
files | c/regexParser/Makefile c/regexParser/regexParser.cc c/regexParser/subsetConstraction.cc |
diffstat | 3 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/c/regexParser/Makefile Tue Dec 15 17:14:35 2015 +0900 +++ b/c/regexParser/Makefile Tue Dec 15 18:09:54 2015 +0900 @@ -48,3 +48,8 @@ ./$(TARGET) -regex 'a|[a-z]' ./$(TARGET) -regex 'a|[a-z]*' ./$(TARGET) -regex 'a*|[a-z]' + ./$(TARGET) -regex '[a-cb-d]' + ./$(TARGET) -regex '[c-eb-d]' + ./$(TARGET) -regex '[a-db-d]' + ./$(TARGET) -regex '[c-db-d]' + ./$(TARGET) -regex '[b-da-e]'
--- a/c/regexParser/regexParser.cc Tue Dec 15 17:14:35 2015 +0900 +++ b/c/regexParser/regexParser.cc Tue Dec 15 18:09:54 2015 +0900 @@ -61,7 +61,7 @@ CharClassPtr insertCharClass(CharClassPtr cc, unsigned char begin, unsigned char end) { if (end < cc->cond.range.begin ) { - CharClassPtr cc1 = createCharClassRange(cc->begin,cc->end,cc->left,cc->right); + CharClassPtr cc1 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc->left,cc->right); if (cc->left) { cc1->left = insertCharClass(cc->left,begin,end); return cc1; @@ -77,9 +77,9 @@ cc->cond.range.begin = begin; } } else if (begin > cc->cond.range.end ) { - CharClassPtr cc1 = createCharClassRange(cc->begin,cc->end,cc->left,cc->right); + CharClassPtr cc1 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc->left,cc->right); if (cc->right) { - cc1->rigt = insertCharClass(cc->right,begin,end); + cc1->right = insertCharClass(cc->right,begin,end); return cc1; } else { CharClassPtr cc2 = createCharClassRange(begin,end,0,0); @@ -101,6 +101,8 @@ NodePtr n = createNode(ri,'c',cc,0,0); cc->type = 'r'; cc->nextState.bitContainer = 0; + cc->left = NULL; + cc->right = NULL; RangeListPtr rangeList = &cc->cond.range; rangeList->begin = *ri->ptr; rangeList->end = *ri->ptr;
--- a/c/regexParser/subsetConstraction.cc Tue Dec 15 17:14:35 2015 +0900 +++ b/c/regexParser/subsetConstraction.cc Tue Dec 15 18:09:54 2015 +0900 @@ -6,10 +6,6 @@ static CharClassPtr createCharClassWord(unsigned char *w, CharClassPtr cc1, CharClassPtr cc2) { CharClassPtr cc = NEW(CharClass); - cc->type = 'a'; - cc->cond.w.word = ri->tokenValue; - cc->cond.w.length = ri->ptr - ri->tokenValue; - cc->nextState.bitContainer = 0; return cc1; }