Mercurial > hg > Applications > Grep
diff regexParser/subsetConstraction.cc @ 172:540fc12871d9 pairPro
remove some warnings and errors (not working)
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Dec 2015 15:56:33 +0900 |
parents | 684363c44d6f |
children | cca8bb5aeded |
line wrap: on
line diff
--- a/regexParser/subsetConstraction.cc Mon Dec 21 17:37:41 2015 +0900 +++ b/regexParser/subsetConstraction.cc Tue Dec 22 15:56:33 2015 +0900 @@ -112,17 +112,17 @@ return cc; } -CharClassWalkerPtr findLeftMost(CharClassPtr next,CharClassWalker walk) { +CharClassWalkerPtr findLeftMost(CharClassPtr next,CharClassWalkerPtr walk) { while (next->left) { CharClassStackPtr ccs = NEW(CharClassStack); - ccs->next = &walk.stack; + ccs->next = &walk->stack; ccs->left = false; ccs->cc = next; - walk.stack = *ccs; + walk->stack = *ccs; next = next->left; } - walk.next = next; - return &walk; + walk->next = next; + return walk; } CharClassWalkerPtr createCharClassWalker (CharClassPtr next) { @@ -133,7 +133,7 @@ walk->next = next; return walk; } - walk = findLeftMost(next,*walk); + walk = findLeftMost(next,walk); return walk; } @@ -145,7 +145,7 @@ CharClassPtr current = walk->next; if (walk->next->left && current->right) { walk->stack.left = true; - CharClassPtr next = findLeftMost(current->right,*walk)->next; + CharClassPtr next = findLeftMost(current->right,walk)->next; walk->next = next; } else { TransitionPtr tsOld = ts; @@ -162,13 +162,14 @@ TransitionPtr mergeTransition(TransitionPtr x,TransitionPtr y) { CharClassWalkerPtr walk = createCharClassWalker(x->condition); CharClassPtr ccy = y->condition; + BitVector bi; for (CharClassPtr cc = getNext(walk); hasNext(walk); cc=getNext(walk)) { unsigned long begin = cc->cond.range.begin; unsigned long end = cc->cond.range.end; - BitVector bi = cc->nextState; + bi = cc->nextState; ccy = charClassMerge(ccy,begin,end,bi); } - TransitionPtr z = createTransition(ccy); + TransitionPtr z = createTransition(ccy,&bi); free(walk); return z; } @@ -195,7 +196,7 @@ tgv.asterisk = true; return tgv; } else if (n->tokenType == 'c'){ - tgv2.ts = createTransition(n->cc); + tgv2.ts = createTransition(n->cc,0); return tgv2; } else if (n->tokenType == 'a'){ TGValue tgv;