Mercurial > hg > Applications > Grep
changeset 259:6a6546a753cf
tSearch of driver in main.cc (not working)
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Jan 2016 13:34:33 +0900 |
parents | 29e467a491ba |
children | 3f3c9902bb6d |
files | regexParser/main.cc regexParser/threadedSearch.cc |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/main.cc Tue Jan 26 02:30:51 2016 +0900 +++ b/regexParser/main.cc Tue Jan 26 13:34:33 2016 +0900 @@ -13,6 +13,7 @@ bool generate = true; bool subset = false; bool generateSequentialSearch = false; + bool tSearch = false; char *filename; RegexInfo ri; @@ -28,6 +29,8 @@ generateSequentialSearch = true; } else if (strcmp(argv[i],"-file") == 0) { filename = argv[i+1]; i++; + } else if (strcmp(argv[i],"-tSearch") == 0) { + tSearch = true; } } if (!ri.ptr) return 0; @@ -57,7 +60,8 @@ int fd = 0; st_mmap_t st_mmap = createSt_mmap(filename,fd); Buffer buff = createBuffer(st_mmap); - grepWalk(tgv.tg,buff); + if (tSearch) tSearch(tsv); + else grepWalk(tgv.tg,buff); close(fd); } return 0;
--- a/regexParser/threadedSearch.cc Tue Jan 26 02:30:51 2016 +0900 +++ b/regexParser/threadedSearch.cc Tue Jan 26 13:34:33 2016 +0900 @@ -5,14 +5,17 @@ #include "threadedSearch.h" #include "subsetConstruction.h" +void tSearch(TSValue tsv); + void stateSkip(TSValue tsv) { tsv.buff.matchBegin = tsv.buff.buffptr; - tsv.current->stateSkip(tsv); + tSearch(tsv); } void stateMatch(TSValue tsv) { - tsv.buff.matchBegin = tsv.buff.buffptr; - tsv.current->stateSkip(tsv); + fwrite(tsv.buff.matchBegin,tsv.buff.buffptr-buff.matchBegin,1,stdout); + puts("\n"); + grepSkip(tg,buff); } TStatePtr generateTState(StatePtr state) {