Mercurial > hg > Members > masakoha > testcode
changeset 250:e60dd2fa3409
remove SCValue
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Jan 2016 13:51:33 +0900 |
parents | 9493800265a8 |
children | e22e3475f664 |
files | regexParser/subsetConstruction.cc |
diffstat | 1 files changed, 13 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/subsetConstruction.cc Sat Jan 23 12:34:50 2016 +0900 +++ b/regexParser/subsetConstruction.cc Sat Jan 23 13:51:33 2016 +0900 @@ -198,6 +198,18 @@ bitvector を index とした配列に BitVectorPtr を格納 state に対応する NodePtr を */ +StatePtr createState(TransitionGeneratorPtr tg,BitVector bi) { + StatePtr s = NEW(State); + s->stateNum = tg->totalStateCount++; + s->next = NULL; + tg->stateEnd->next = s; + tg->stateEnd = s; + s->bitState = bi; + s->cc = NULL; + s->node = NULL; + return s; +} + StatePtr createState(TGValue tgv,NodePtr n) { BitVector bi = createBitVector(tgv.tg->totalStateCount); StatePtr s = createState(tgv.tg,bi); @@ -211,18 +223,6 @@ return s; } -SCValue createState(TransitionGeneratorPtr tg,BitVector bi) { - StatePtr s = NEW(State); - s->stateNum = tg->totalStateCount++; - s->next = NULL; - tg->stateEnd->next = s; - tg->stateEnd = s; - s->bitState = bi; - s->cc = NULL; - s->node = NULL; - return scv; -} - /** pass 1 : 正規表現に必要な状態を探して、それぞれに番号を割り振る 前が * でない + は新しく状態を作る @@ -352,17 +352,6 @@ } } -SCValue createSCValue(TGValue tgv) { - SCValue scv; - scv.tg = tgv.tg; - scv.stateTop = tgv.tg->stateList; - scv.stateEnd = scv.stateTop; - while (scv.stateEnd->next) { - scv.stateEnd = scv.stateEnd->next; - } - return scv; -} - /** 現在のステートに含まれる組み合わせ状態をとってくる 組み合わされた個々の charclass をmerge して新しい charclass をつくり、組み合わせ状態に登録する @@ -391,7 +380,7 @@ void subsetConstruction(TransitionGeneratorPtr tg) { for (;tg->stateTop;tg->stateTop = tg->stateTop->next) { - CharClassWalkerPtr cw = createCharClassWalker(state->cc); + CharClassWalkerPtr cw = createCharClassWalker(tg->stateTop->cc); while (hasNext(cw)) { CharClassPtr cc = getNext(cw); BitVector bi = cc->nextState;