comparison regexParser/cerium/CeriumMain.cc @ 281:b74e3b4b11d7

parallel search done
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Sun, 31 Jan 2016 18:28:58 +0900
parents 6bbd1cbf90d0
children 555ca452f031
comparison
equal deleted inserted replaced
280:6bbd1cbf90d0 281:b74e3b4b11d7
34 } 34 }
35 35
36 static 36 static
37 TSValue stateMatch(TSValue tsv) { 37 TSValue stateMatch(TSValue tsv) {
38 ResultPtr r = NEW(Result); 38 ResultPtr r = NEW(Result);
39 r->continued = false;
39 r->begin = tsv.buff.matchBegin; 40 r->begin = tsv.buff.matchBegin;
40 r->end = tsv.buff.buffptr; 41 r->end = tsv.buff.buffptr;
41 *tsv.resultEnd = r; 42 *tsv.resultEnd = r;
42 r->next = NULL; 43 r->next = NULL;
43 tsv.resultEnd = &r->next; 44 tsv.resultEnd = &r->next;
49 50
50 ResultPtr resultPrint(ResultPtr r,const char* comment) { 51 ResultPtr resultPrint(ResultPtr r,const char* comment) {
51 ResultPtr prev = NULL; 52 ResultPtr prev = NULL;
52 // printf("%s\n",comment); 53 // printf("%s\n",comment);
53 for (;r;r = r->next) { 54 for (;r;r = r->next) {
54 if (r->end == NULL) { 55 if (r->continued) {
55 prev = r; 56 prev = r;
56 break; 57 break;
57 } 58 }
58 fwrite(r->begin,r->end - r->begin-1,1,stdout); 59 fwrite(r->begin,r->end - r->begin-1,1,stdout);
59 puts(""); 60 puts("");