Mercurial > hg > Applications > Grep
changeset 117:166136236891 pairPro
add header files
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 25 Nov 2015 14:58:03 +0900 |
parents | 66c633575b53 |
children | 31b0ba0050fa 2f0653f8eabb |
files | c/regexParser/bitVector.cc c/regexParser/bitVectorNode.cc c/regexParser/bitVectorNode.h c/regexParser/determinize.cc c/regexParser/determinize.h c/regexParser/node.cc c/regexParser/node.h c/regexParser/subsetConstraction.cc c/regexParser/subsetConstraction.h c/regexParser/word.c c/regexParser/word.h |
diffstat | 11 files changed, 29 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/c/regexParser/bitVector.cc Tue Nov 24 17:07:08 2015 +0900 +++ b/c/regexParser/bitVector.cc Wed Nov 25 14:58:03 2015 +0900 @@ -5,8 +5,6 @@ extern BitVectorListPtr allocateBitVectorList(); const BitVectorPtr allocateBitVector(); -int bitBlock = sizeof(unsigned long) * 8; - BitVectorListPtr createBitVector(NodePtr n,BitVectorListPtr bvl) { BitVectorListPtr nextBvl = allocateBitVectorList(); nextBvl->bi = bitSet(n->nodeNumber); @@ -38,11 +36,11 @@ BitVectorPtr bi = allocateBitVector(); - bi->arrayNum = (bitSetPosition + bitBlock) / bitBlock; + bi->arrayNum = (bitSetPosition + BITBLOCK) / BITBLOCK; - int arrayPosition = bitSetPosition / bitBlock; + int arrayPosition = bitSetPosition / BITBLOCK; - unsigned long tmp = 1 << (bitSetPosition % bitBlock); + unsigned long tmp = 1 << (bitSetPosition % BITBLOCK); bi->bitContainer[arrayPosition] = bi->bitContainer[arrayPosition] | tmp; return bi; @@ -51,7 +49,7 @@ void bitPrint(BitVectorPtr bi) { for (int i = 0; i < bi->arrayNum ; i++) { unsigned long vec = bi->bitContainer[i]; - for (int j = 0; j < bitBlock; j++) { + for (int j = 0; j < BITBLOCK; j++) { printf( "%lu", vec & 1 ); vec >>= 1; }
--- a/c/regexParser/bitVectorNode.cc Tue Nov 24 17:07:08 2015 +0900 +++ b/c/regexParser/bitVectorNode.cc Wed Nov 25 14:58:03 2015 +0900 @@ -1,11 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <ctype.h> -#include "bitVector.h" - -extern BitVectorPtr bitSet(int); -BitVectorListPtr allocateBitVectorList(); -BitVectorListPtr initBitVector(); +#include "bitVectorNode.h" BitVectorListPtr allocateBitVectorList() { BitVectorListPtr bvl = (BitVectorListPtr)malloc(sizeof(BitVectorList));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/regexParser/bitVectorNode.h Wed Nov 25 14:58:03 2015 +0900 @@ -0,0 +1,4 @@ +#include "bitVector.h" + +BitVectorListPtr allocateBitVectorList(); +BitVectorListPtr initBitVector();
--- a/c/regexParser/determinize.cc Tue Nov 24 17:07:08 2015 +0900 +++ b/c/regexParser/determinize.cc Wed Nov 25 14:58:03 2015 +0900 @@ -1,4 +1,4 @@ -#include "transition.h" +#include "determinize.h" TransitionPtr determinize(TransitionPtr cond, TransitionPtr list) { TransitionPtr x0 = createTransition(x->condition, x->nextState);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/regexParser/determinize.h Wed Nov 25 14:58:03 2015 +0900 @@ -0,0 +1,3 @@ +#include "transition.h" + +TransitionPtr determinize(TransitionPtr, TransitionPtr);
--- a/c/regexParser/node.cc Tue Nov 24 17:07:08 2015 +0900 +++ b/c/regexParser/node.cc Wed Nov 25 14:58:03 2015 +0900 @@ -1,8 +1,5 @@ #include <stdio.h> -#include "regexParser.h" - -static void descendTree(NodePtr,int); -void printTree(NodePtr); +#include "node.h" static void descendTree(NodePtr n, int d) { if (n->right != NULL) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/regexParser/node.h Wed Nov 25 14:58:03 2015 +0900 @@ -0,0 +1,4 @@ +#include "regexParser.h" + +static void descendTree(NodePtr,int); +void printTree(NodePtr);
--- a/c/regexParser/subsetConstraction.cc Tue Nov 24 17:07:08 2015 +0900 +++ b/c/regexParser/subsetConstraction.cc Wed Nov 25 14:58:03 2015 +0900 @@ -1,10 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <ctype.h> -#include "bitVector.h" - -extern BitVectorListPtr initBitVector(); -BitVectorListPtr setNextBitVectorList(unsigned char, BitVectorListPtr, BitVectorListPtr); +#include "subsetConstraction.h" void printBitVectorList (BitVectorListPtr bvl) { bool isFirstPrint = true; @@ -29,6 +26,7 @@ } } +const BitVectorListPtr descendTreeNode(NodePtr n,BitVectorListPtr bvl, BitVectorListPtr prev, bool &fromOr, bool &fromAsterisk) { bool leftIsOr, rightIsOr; if (n->cc->cond->character == '*') { @@ -72,6 +70,7 @@ return bvl; } +const BitVectorListPtr setNextBitVectorList(unsigned char inputChar, BitVectorListPtr bvl, BitVectorListPtr next){ if (isalnum((int)inputChar)){ bvl->next[(int)inputChar] = next;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/regexParser/subsetConstraction.h Wed Nov 25 14:58:03 2015 +0900 @@ -0,0 +1,6 @@ +#include "bitVector.h" +extern BitVectorListPtr initBitVector(); +void printBitVectorList(BitVectorListPtr); +const BitVectorListPtr descendTreeNode(NodePtr,BitVectorListPtr, BitVectorListPtr, bool&, bool&); +const BitVectorListPtr setNextBitVectorList(unsigned char, BitVectorListPtr, BitVectorListPtr); +BitVectorListPtr createBitVectorList(NodePtr);