annotate c/regexParser/createBitVectorList.cc @ 109:6401c708f5dd impl-bitvector

fix printBitVectorList (print Loop when include asterisk node)
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Fri, 20 Nov 2015 15:19:09 +0900
parents 70069d4647a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdio.h>
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include <stdlib.h>
101
2cc097419169 fix print
masasann
parents: 100
diff changeset
3 #include <ctype.h>
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "bitVector.h"
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include "regexParser.h"
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 extern BitVectorPtr bitSet(int);
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 extern void bitPrint(BitVectorPtr);
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 BitVectorListPtr createBitVector(NodePtr);
104
3eb3cb5d581f implemented 'or' node translator
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
10 BitVectorListPtr descendTreeNode(NodePtr, BitVectorListPtr, BitVectorListPtr, bool&);
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
11 BitVectorListPtr setNextBitVectorList(unsigned char, BitVectorListPtr, BitVectorListPtr);
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
99
1e5b56e8263b remove some variable
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
13 BitVectorListPtr initBvl;
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
100
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
15 BitVectorListPtr allocateBitVectorList() {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
16 BitVectorListPtr bvl = (BitVectorListPtr)malloc(sizeof(BitVectorList));
108
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
17 if (bvl == NULL) {
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
18 fprintf(stderr, "Failed to allocate memory.\n");
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
19 exit(-1);
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
20 }
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
21
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
22 bvl->self = bvl;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
23 bvl->bi = (BitVectorPtr)malloc(sizeof(BitVector));
108
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
24 if (bvl->bi == NULL) {
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
25 fprintf(stderr, "Failed to allocate memory.\n");
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
26 exit(-1);
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
27 }
70069d4647a0 implement malloc error checking
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 107
diff changeset
28
100
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
29
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
30 return bvl;
100
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
31 }
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
32
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 BitVectorListPtr createBitVector(NodePtr n,BitVectorListPtr bvl) {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
34 BitVectorListPtr nextBvl = allocateBitVectorList();
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
35 nextBvl->bi = bitSet(n->nodeNumber);
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
36 nextBvl->initBvl = initBvl;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
37 return nextBvl;
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 }
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
100
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
40
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 BitVectorListPtr initBitVector() {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
42
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
43 BitVectorListPtr bvl = allocateBitVectorList();
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
44 bvl->initBvl = initBvl = bvl;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
45 bvl->bi = bitSet(0);
100
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
46
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
47 for (int i = 0; i < 256; i++) {
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
48 bvl->next[i] = NULL;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
49 }
100
804e51f19f17 implement allocateBitVectorList
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
50
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
51 return bvl;
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 }
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53
101
2cc097419169 fix print
masasann
parents: 100
diff changeset
54 void printBitVectorList (BitVectorListPtr bvl) {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
55 bool isFirstPrint = true;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
56 for (int i = 0; i < 256; i++) {
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
57 if (bvl->next[i] != NULL) {
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
58 if (isFirstPrint){
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
59 puts("----");
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
60 printf(" state : "); bitPrint(bvl->bi);
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
61 isFirstPrint = false;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
62 }
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
63 printf("input char : %c\n",i);
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
64 printf("next state : ");bitPrint(bvl->next[i]->bi);
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
65 bvl->isLoop = bvl->isLoopAnker;
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
66 }
104
3eb3cb5d581f implemented 'or' node translator
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
67 }
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
68
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
69 for (int i = 0; i < 256; i++) {
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
70 if ((bvl->next[i] != NULL) && !(bvl->isLoop && bvl->isLoopAnker)) {
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
71 // if ((bvl->next[i] != NULL) ) {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
72 printBitVectorList(bvl->next[i]);
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
73 }
104
3eb3cb5d581f implemented 'or' node translator
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
74 }
3eb3cb5d581f implemented 'or' node translator
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
75 }
3eb3cb5d581f implemented 'or' node translator
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
76
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
77 BitVectorListPtr descendTreeNode(NodePtr n,BitVectorListPtr bvl, BitVectorListPtr prev, bool &fromOr, bool &fromAsterisk) {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
78 bool leftIsOr, rightIsOr;
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
79 if (n->Value.character == '*') {
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
80 bvl = descendTreeNode(n->left, bvl, prev, leftIsOr, fromAsterisk);
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
81 unsigned char repertChar = 0;
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
82 for (int i = 0; i < 256; i++) {
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
83 if (prev->next[i] != NULL) repertChar = i;
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
84 }
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
85 setNextBitVectorList(repertChar, bvl, prev->next[repertChar]); // here
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
86 bvl->isLoopAnker = true;
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
87 fromAsterisk = true;
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
88
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
89 return prev;
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
90 } else if (n->Value.character == '|') {
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
91 bvl = descendTreeNode(n->left, bvl, prev, leftIsOr, fromAsterisk);
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
92 setNextBitVectorList(n->left->Value.character, prev, bvl);
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
93 bvl = descendTreeNode(n->right, bvl, prev, rightIsOr, fromAsterisk);
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
94 setNextBitVectorList(n->right->Value.character, prev, bvl);
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
95 fromOr = true;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
96 return prev;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
97 } else if (n->Value.character == '+') {
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
98 bvl = descendTreeNode(n->left, bvl, prev, leftIsOr, fromAsterisk);
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
99 setNextBitVectorList(n->left->Value.character, prev, bvl);
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
100 prev = bvl;
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
101 bvl = descendTreeNode(n->right, bvl, prev, rightIsOr, fromAsterisk);
104
3eb3cb5d581f implemented 'or' node translator
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
102
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
103 if (leftIsOr){
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
104 for (int i = 0; i < 256; i++)
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
105 if (prev->next[i] != NULL)
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
106 setNextBitVectorList(n->right->Value.character, prev->next[i], bvl);
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
107 }
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
108 else {
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
109 setNextBitVectorList(n->right->Value.character, prev, bvl);
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
110 }
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
111
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
112 fromOr = false;
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
113 } else if (n->tokenType == 'a') {
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
114 bvl = createBitVector(n,bvl);
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
115 fromOr = false;
101
2cc097419169 fix print
masasann
parents: 100
diff changeset
116 }
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
117 return bvl;
101
2cc097419169 fix print
masasann
parents: 100
diff changeset
118 }
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
107
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
120 BitVectorListPtr setNextBitVectorList(unsigned char inputChar, BitVectorListPtr bvl, BitVectorListPtr next){
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
121 if (isalnum((int)inputChar)){
c9f5ee891b5e change variable of setNextBitVectorList()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
122 bvl->next[(int)inputChar] = next;
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
123 }
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
124 return next;
101
2cc097419169 fix print
masasann
parents: 100
diff changeset
125 }
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 BitVectorListPtr createBitVectorList(NodePtr n) {
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
128 BitVectorListPtr bvl = initBitVector();
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
129 bool fromOr = false;
109
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
130 bool fromAsterisk = false;
6401c708f5dd fix printBitVectorList (print Loop when include asterisk node)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 108
diff changeset
131 descendTreeNode(n, bvl, bvl, fromOr, fromAsterisk);
105
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
132 printBitVectorList(bvl);
766fc2476f01 fix indent size
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
133 return bvl;
96
b807383bcc43 add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 }