Mercurial > hg > Members > masakoha > testcode
diff regexParser/transition.cc @ 177:8de9a33f6ae5 pairPro
change createState aug
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 23 Dec 2015 17:28:59 +0900 |
parents | c092dd0e1ae0 |
children | d97bcab546e8 |
line wrap: on
line diff
--- a/regexParser/transition.cc Wed Dec 23 15:41:27 2015 +0900 +++ b/regexParser/transition.cc Wed Dec 23 17:28:59 2015 +0900 @@ -7,7 +7,7 @@ return stateArray; } if (stateArray->next == NULL) { - StatePtr s = createState(state,state->bitState); + StatePtr s = createState(state->bitState); stateArray = appendState(stateArray,s); return stateArray; } @@ -16,17 +16,16 @@ return stateArray; } -StatePtr createState(StatePtr state,BitVector bi) { - StatePtr s = state; - state = NEW(State); +StatePtr createState(BitVector bi) { + StatePtr state = NEW(State); state->bitState = bi; state->transition = NEW(Transition); state->nextNode = NEW(Node); - return s; + return state; } StatePtr appendState(StatePtr x,StatePtr y) { - StatePtr x0 = createState(x,x->bitState); + StatePtr x0 = createState(x->bitState); StatePtr x1 = x0; for(;;) { if (x->next == NULL) { @@ -34,7 +33,7 @@ return x0; } x = x->next; - x1->next = createState(x,x->bitState); + x1->next = createState(x->bitState); x1 = x1->next; } return x0;