Mercurial > hg > Members > masakoha > testcode
changeset 251:e22e3475f664
fix
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Jan 2016 14:10:28 +0900 |
parents | e60dd2fa3409 |
children | 2b276fdd99bd |
files | regexParser/regexParser.h regexParser/threadedSearch.cc |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/regexParser.h Sat Jan 23 13:51:33 2016 +0900 +++ b/regexParser/regexParser.h Sat Jan 23 14:10:28 2016 +0900 @@ -62,7 +62,7 @@ State *state; void stateSkip(tsValue); int ccvSize; - CCV ccv; + CCVPtr ccv; } TState, *TStatePtr; typedef struct result {
--- a/regexParser/threadedSearch.cc Sat Jan 23 13:51:33 2016 +0900 +++ b/regexParser/threadedSearch.cc Sat Jan 23 14:10:28 2016 +0900 @@ -9,17 +9,17 @@ tsv.current->stateSkip(tsv); } -TStatePtr generateTState(State state) { +TStatePtr generateTState(StatePtr state) { TStatePtr tState = NEW(TState); int ccvSize = 0; - CharClassWalkerPtr ccw = createCharClassWalker(state.cc); + CharClassWalkerPtr ccw = createCharClassWalker(state->cc); while (hasNext(ccw)) { CharClassPtr cc = getNext(ccw); ccvSize++; } if (ccvSize == 0) return tState; else tState->ccv = (ccv*)malloc(sizeof(ccv)*ccvSize); - ccw = createCharClassWalker(state.cc); + ccw = createCharClassWalker(state->cc); int i = 0; while (hasNext(ccw)) { CharClassPtr cc = getNext(ccw); @@ -44,18 +44,18 @@ if (c<ccv->begin) tsv.current->stateSkip(tsv); else if (c<=ccv->end) { // range matched. - if (ccv->w) { + if (ccv->w.word) { // match the word. // if (not match) continue; } TStatePtr current = ccv->tState; if (current == NULL) { // create tSearch in next state. - StatePtr state = tsv.stateArray[ccv->state.bitContainer]; + StatePtr state = tsv.tg->stateArray[ccv->state.bitContainer]; if (state == NULL) { // on the fly subset construction. - state = createState(tg,bi); - tg->stateArray[bi.bitContainer] = state; + state = createState(tsv.tg,bi); + tsv.tg->stateArray[bi.bitContainer] = state; determinize(state,tsv.tg); } if (state->tState == NULL) {