Mercurial > hg > Applications > Grep
comparison c/regexParser/subsetConstraction.cc @ 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 | c292c67b3100 |
comparison
equal
deleted
inserted
replaced
116:66c633575b53 | 117:166136236891 |
---|---|
1 #include <stdio.h> | 1 #include <stdio.h> |
2 #include <stdlib.h> | 2 #include <stdlib.h> |
3 #include <ctype.h> | 3 #include <ctype.h> |
4 #include "bitVector.h" | 4 #include "subsetConstraction.h" |
5 | |
6 extern BitVectorListPtr initBitVector(); | |
7 BitVectorListPtr setNextBitVectorList(unsigned char, BitVectorListPtr, BitVectorListPtr); | |
8 | 5 |
9 void printBitVectorList (BitVectorListPtr bvl) { | 6 void printBitVectorList (BitVectorListPtr bvl) { |
10 bool isFirstPrint = true; | 7 bool isFirstPrint = true; |
11 for (int i = 0; i < 256; i++) { | 8 for (int i = 0; i < 256; i++) { |
12 if (bvl->next[i] != NULL) { | 9 if (bvl->next[i] != NULL) { |
27 printBitVectorList(bvl->next[i]); | 24 printBitVectorList(bvl->next[i]); |
28 } | 25 } |
29 } | 26 } |
30 } | 27 } |
31 | 28 |
29 const | |
32 BitVectorListPtr descendTreeNode(NodePtr n,BitVectorListPtr bvl, BitVectorListPtr prev, bool &fromOr, bool &fromAsterisk) { | 30 BitVectorListPtr descendTreeNode(NodePtr n,BitVectorListPtr bvl, BitVectorListPtr prev, bool &fromOr, bool &fromAsterisk) { |
33 bool leftIsOr, rightIsOr; | 31 bool leftIsOr, rightIsOr; |
34 if (n->cc->cond->character == '*') { | 32 if (n->cc->cond->character == '*') { |
35 bvl = descendTreeNode(n->left, bvl, prev, leftIsOr, fromAsterisk); | 33 bvl = descendTreeNode(n->left, bvl, prev, leftIsOr, fromAsterisk); |
36 unsigned char repertChar = 0; | 34 unsigned char repertChar = 0; |
70 fromOr = false; | 68 fromOr = false; |
71 } | 69 } |
72 return bvl; | 70 return bvl; |
73 } | 71 } |
74 | 72 |
73 const | |
75 BitVectorListPtr setNextBitVectorList(unsigned char inputChar, BitVectorListPtr bvl, BitVectorListPtr next){ | 74 BitVectorListPtr setNextBitVectorList(unsigned char inputChar, BitVectorListPtr bvl, BitVectorListPtr next){ |
76 if (isalnum((int)inputChar)){ | 75 if (isalnum((int)inputChar)){ |
77 bvl->next[(int)inputChar] = next; | 76 bvl->next[(int)inputChar] = next; |
78 } | 77 } |
79 return next; | 78 return next; |