Mercurial > hg > Members > masakoha > testcode
changeset 99:1e5b56e8263b impl-bitvector
remove some variable
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 10 Nov 2015 20:57:59 +0900 |
parents | d0d2262d4edf |
children | 804e51f19f17 |
files | c/regexParser/bitVector.h c/regexParser/createBitVectorList.cc c/regexParser/createRegexParser.cc |
diffstat | 3 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/c/regexParser/bitVector.h Tue Nov 10 18:08:53 2015 +0900 +++ b/c/regexParser/bitVector.h Tue Nov 10 20:57:59 2015 +0900 @@ -6,5 +6,6 @@ typedef struct bitVectorList { bitVectorList *self; BitVectorPtr bi; + bitVectorList* initBvl; bitVectorList* next[256]; }BitVectorList, *BitVectorListPtr;
--- a/c/regexParser/createBitVectorList.cc Tue Nov 10 18:08:53 2015 +0900 +++ b/c/regexParser/createBitVectorList.cc Tue Nov 10 20:57:59 2015 +0900 @@ -8,13 +8,14 @@ BitVectorListPtr createBitVector(NodePtr); BitVectorListPtr descendTreeNode(NodePtr,BitVectorListPtr); -int bvlIndex; +BitVectorListPtr initBvl; BitVectorListPtr createBitVector(NodePtr n,BitVectorListPtr bvl) { BitVectorListPtr nextBvl = bvl->next[(int)n->Value.character] = (BitVectorListPtr)malloc(sizeof(BitVectorList)); + nextBvl->self = bvl->next[(int)n->Value.character]; nextBvl->bi = (BitVectorPtr)malloc(sizeof(BitVector)); nextBvl->bi = bitSet(n->nodeNumber); - nextBvl->self = bvl->next[(int)n->Value.character]; + nextBvl->initBvl = initBvl; puts("-----"); printf(" state : "); bitPrint(bvl->bi); @@ -30,7 +31,7 @@ BitVectorListPtr initBitVector() { BitVectorListPtr bvl = (BitVectorListPtr)malloc(sizeof(BitVectorList)); - bvl->self = bvl; + bvl->initBvl = bvl->self = initBvl = bvl; bvl->bi = (BitVectorPtr)malloc(sizeof(BitVector)); bvl->bi = bitSet(0); return bvl; @@ -54,7 +55,6 @@ } BitVectorListPtr createBitVectorList(NodePtr n) { - bvlIndex = 0; BitVectorListPtr bvl = initBitVector(); descendTreeNode(n,bvl);
--- a/c/regexParser/createRegexParser.cc Tue Nov 10 18:08:53 2015 +0900 +++ b/c/regexParser/createRegexParser.cc Tue Nov 10 20:57:59 2015 +0900 @@ -23,7 +23,9 @@ n->left = left; n->right = right; - if (ri->tokenType != 'a') { + if (ri->tokenType == '*') { + n->left->parent = n->self; + } else if (ri->tokenType != 'a') { n->right = right; n->left->parent = n->right->parent = n->self; }