Mercurial > hg > Applications > Grep
comparison 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 |
comparison
equal
deleted
inserted
replaced
301:4cb6eea3ab12 | 302:27414e6fb33c |
---|---|
13 void TMend(TaskManager *); | 13 void TMend(TaskManager *); |
14 static double st_time; | 14 static double st_time; |
15 static double ed_time; | 15 static double ed_time; |
16 const char* usr_help_str = ""; | 16 const char* usr_help_str = ""; |
17 | 17 |
18 void exportState(TransitionGeneratorPtr tg) { | |
19 } | |
20 | |
18 static double | 21 static double |
19 getTime() { | 22 getTime() { |
20 struct timeval tv; | 23 struct timeval tv; |
21 gettimeofday(&tv, NULL); | 24 gettimeofday(&tv, NULL); |
22 return tv.tv_sec + (double)tv.tv_usec*1e-6; | 25 return tv.tv_sec + (double)tv.tv_usec*1e-6; |
23 } | 26 } |
27 | |
28 void addResult(TSValue tsv,bool cont, unsigned char *begin, unsigned char *end) { | |
29 ResultPtr r = NEW(Result); | |
30 r->continued = cont; | |
31 r->begin = begin; | |
32 r->end = end; | |
33 *tsv.blk->resultEnd = r; | |
34 r->next = NULL; | |
35 tsv.blk->resultEnd = &r->next; | |
36 } | |
37 | |
24 | 38 |
25 static | 39 static |
26 TSValue stateNothing(TSValue tsv) { | 40 TSValue stateNothing(TSValue tsv) { |
27 return tsv; | 41 return tsv; |
28 } | 42 } |
29 | 43 |
30 static | 44 static |
31 TSValue stateSkip(TSValue tsv) { | 45 TSValue stateSkip(TSValue tsv) { |
32 tsv.current = tsv.tg->stateStart->tState; | 46 tsv.current = tsv.tg->stateStart->tState; |
33 if (tsv.matchEnd) { | 47 if (tsv.matchEnd) { |
34 ResultPtr r = NEW(Result); | 48 addResult(tsv,false,tsv.matchBegin,tsv.matchEnd); |
35 r->continued = false; | |
36 r->begin = tsv.matchBegin; | |
37 r->end = tsv.matchEnd; | |
38 *tsv.blk->resultEnd = r; | |
39 r->next = NULL; | |
40 tsv.blk->resultEnd = &r->next; | |
41 tsv.matchEnd=NULL; | |
42 } | 49 } |
43 tsv.matchBegin = tsv.buff.buffptr; // next char may be matchBegin | 50 tsv.matchBegin = tsv.buff.buffptr; // next char may be matchBegin |
44 return tsv; | 51 return tsv; |
45 } | 52 } |
46 | 53 |