Mercurial > hg > Applications > Grep
diff regexParser/cerium/CeriumMain.cc @ 302:27414e6fb33c
retrying blocked search
fix for CbC support
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Feb 2016 08:59:38 +0900 |
parents | 63213964502a |
children | cc770cd8d000 |
line wrap: on
line diff
--- a/regexParser/cerium/CeriumMain.cc Thu Feb 04 03:26:18 2016 +0900 +++ b/regexParser/cerium/CeriumMain.cc Mon Feb 08 08:59:38 2016 +0900 @@ -15,6 +15,9 @@ static double ed_time; const char* usr_help_str = ""; +void exportState(TransitionGeneratorPtr tg) { +} + static double getTime() { struct timeval tv; @@ -22,6 +25,17 @@ return tv.tv_sec + (double)tv.tv_usec*1e-6; } +void addResult(TSValue tsv,bool cont, unsigned char *begin, unsigned char *end) { + ResultPtr r = NEW(Result); + r->continued = cont; + r->begin = begin; + r->end = end; + *tsv.blk->resultEnd = r; + r->next = NULL; + tsv.blk->resultEnd = &r->next; +} + + static TSValue stateNothing(TSValue tsv) { return tsv; @@ -31,14 +45,7 @@ TSValue stateSkip(TSValue tsv) { tsv.current = tsv.tg->stateStart->tState; if (tsv.matchEnd) { - ResultPtr r = NEW(Result); - r->continued = false; - r->begin = tsv.matchBegin; - r->end = tsv.matchEnd; - *tsv.blk->resultEnd = r; - r->next = NULL; - tsv.blk->resultEnd = &r->next; - tsv.matchEnd=NULL; + addResult(tsv,false,tsv.matchBegin,tsv.matchEnd); } tsv.matchBegin = tsv.buff.buffptr; // next char may be matchBegin return tsv;