Mercurial > hg > Members > masakoha > testcode
changeset 242:6aebc4d7dd75
fix condition generateSequentialSearch
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 21 Jan 2016 16:12:10 +0900 |
parents | 87ad91af8a15 |
children | 7189d24dd45e |
files | regexParser/generateSequentialSearch.cc regexParser/grepWalk.cc |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/generateSequentialSearch.cc Wed Jan 20 20:28:40 2016 +0900 +++ b/regexParser/generateSequentialSearch.cc Thu Jan 21 16:12:10 2016 +0900 @@ -39,7 +39,11 @@ if (begin == end) { fprintf(fp,"if (c=='%c') state%lx(buff);\n",(unsigned char)begin, bi.bitContainer); } else { - fprintf(fp,"if (c<'%c') stateSkip(buff);\n",(unsigned char)begin); + if (state->bitState.bitContainer & 2) { + fprintf(fp,"if (c<'%c') stateMatch(buff);\n",(unsigned char)begin); + } else { + fprintf(fp,"if (c<'%c') stateSkip(buff);\n",(unsigned char)begin); + } fprintf(fp," else if (c<='%c') state%lx(buff);\n",(unsigned char)end, bi.bitContainer); } }
--- a/regexParser/grepWalk.cc Wed Jan 20 20:28:40 2016 +0900 +++ b/regexParser/grepWalk.cc Thu Jan 21 16:12:10 2016 +0900 @@ -38,7 +38,7 @@ if (found == false) { grepSkip(tg,buff); - } else if (found == true && (cc->nextState.bitContainer == 2)) { // Accept + } else if (found == true && (cc->nextState.bitContainer | 2)) { // Accept grepMatch(tg,buff); } else { grep(tg,buff,cc->nextState.bitContainer);