Mercurial > hg > Members > masakoha > testcode
annotate c/regexParser/subsetConstraction.cc @ 163:f0a347cd9c6a pairPro
fix subsetconstraction.cc
author | masa |
---|---|
date | Fri, 18 Dec 2015 19:44:07 +0900 |
parents | dcd751ba7103 |
children | 96854eba17e5 |
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 | 3 #include <ctype.h> |
117
166136236891
add header files
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
116
diff
changeset
|
4 #include "subsetConstraction.h" |
96
b807383bcc43
add createBitVectorList.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 |
144
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
6 CharClassPtr createCharClassWord(unsigned char *w, CharClassPtr cc1, CharClassPtr cc2) { |
146 | 7 CharClassPtr cc = NEW(CharClass); |
154 | 8 return cc; |
144
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
9 } |
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
10 |
152 | 11 CharClassPtr charClassMerge(CharClassPtr cc,unsigned long begin, unsigned long end, BitVector nextState) { |
143 | 12 // 重なっているccの領域を分割する |
13 // 必要ならばnextStateを重ねあわせる | |
14 // 変更があった場合は新しくリストを作って返す | |
152 | 15 if (end < cc->cond.range.begin ) { // 1 |
16 if (cc->left) { | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
17 return createCharClassRange(cc->cond.range.begin,cc->cond.range.end,charClassMerge(cc->left,begin,end,nextState),cc->right); |
152 | 18 } else { |
155 | 19 CharClassPtr cc1 = createCharClassRange(begin,end,NULL,cc); |
20 cc1->nextState = nextState; | |
152 | 21 return cc1; |
22 } | |
163 | 23 } else if (end == cc->cond.range.begin && begin != end ) { // 2 |
155 | 24 CharClassPtr cc1; |
25 if (cc->left) { | |
26 cc1 = charClassMerge(cc->left,begin,end-1,nextState); | |
152 | 27 } else { |
155 | 28 cc1 = createCharClassRange(begin,end-1,NULL,NULL); |
29 cc1->nextState = nextState; | |
30 } | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
31 if (cc->cond.range.begin == cc->cond.range.end) { |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
32 CharClassPtr cc2 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc1,cc->right); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
33 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 34 return cc2; |
35 } | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
36 CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin+1,cc->cond.range.end,cc->left,cc->right); |
155 | 37 cc3->nextState = cc->nextState; |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
38 CharClassPtr cc2 = createCharClassRange(cc->cond.range.begin,cc->cond.range.begin,cc1,cc3); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
39 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 40 return cc2; |
163 | 41 } else if (end < cc->cond.range.end) { // range.begin < end |
155 | 42 if (begin < cc->cond.range.begin) { // 3 |
43 CharClassPtr cc1; | |
44 if (cc->left) { | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
45 cc1 = charClassMerge(cc->left,begin,cc->cond.range.begin-1,nextState); |
155 | 46 } else { |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
47 cc1 = createCharClassRange(begin,cc->cond.range.begin-1,NULL,NULL); |
155 | 48 cc1->nextState = nextState; |
49 } | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
50 CharClassPtr cc3 = createCharClassRange(end+1,cc->cond.range.end,cc->left,cc->right); |
155 | 51 cc3->nextState = cc->nextState; |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
52 CharClassPtr cc2 = createCharClassRange(cc->cond.range.begin,end,cc1,cc3); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
53 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 54 return cc2; |
152 | 55 } |
155 | 56 if (begin == cc->cond.range.begin) { // 6 |
163 | 57 CharClassPtr cc2 = createCharClassRange(end+1,cc->cond.range.end,NULL,cc->right); |
155 | 58 cc2->nextState = cc->nextState; |
59 CharClassPtr cc1 = createCharClassRange(begin,end,cc->left,cc2); | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
60 cc1->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 61 return cc1; |
62 } | |
63 // 9 | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
64 CharClassPtr cc2 = createCharClassRange(cc->cond.range.begin,begin-1,cc->left,NULL); |
163 | 65 cc2->nextState = cc->nextState; |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
66 CharClassPtr cc3 = createCharClassRange(end+1,cc->cond.range.end,NULL,cc->right); |
155 | 67 cc3->nextState = cc->nextState; |
68 CharClassPtr cc1 = createCharClassRange(begin,end,cc2,cc3); | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
69 cc1->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 70 return cc1; |
71 } else if (end == cc->cond.range.end) { | |
72 if (begin == cc->cond.range.begin) { // 7 | |
73 CharClassPtr cc1 = createCharClassRange(begin,end,cc->left,cc->right); | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
74 cc1->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 75 return cc1; |
76 } else if (begin < cc->cond.range.begin) { // 4 | |
77 CharClassPtr cc1; | |
78 if (cc->left) { | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
79 cc1 = charClassMerge(cc->left,begin,cc->cond.range.begin-1,nextState); |
155 | 80 } else { |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
81 cc1 = createCharClassRange(begin,cc->cond.range.begin-1,NULL,NULL); |
155 | 82 cc1->nextState = nextState; |
83 } | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
84 CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin,end,cc1,cc->right); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
85 cc3->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 86 return cc3; |
87 } | |
163 | 88 // 10 cond.range.begin < begin |
155 | 89 CharClassPtr cc2 = createCharClassRange(begin,cc->cond.range.end,NULL,cc->right); |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
90 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
163 | 91 CharClassPtr cc1 = createCharClassRange(cc->cond.range.begin,begin-1,cc->left,cc2); |
155 | 92 cc1->nextState = cc->nextState; |
93 return cc1; | |
143 | 94 } |
155 | 95 if (begin > cc->cond.range.end ) { // 13 |
96 if (cc->right) { | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
97 return createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc->left,charClassMerge(cc->right,begin,end,nextState)); |
155 | 98 } else { |
99 CharClassPtr cc1 = createCharClassRange(begin,end,cc,NULL); | |
100 cc1->nextState = nextState; | |
101 return cc1; | |
102 } | |
152 | 103 } |
155 | 104 if (begin >= cc->cond.range.begin && begin <= cc->cond.range.end) { |
163 | 105 if (end > cc->cond.range.end) { // cond.range.end < end |
155 | 106 if (begin == cc->cond.range.begin) { // 8 |
107 CharClassPtr cc1; | |
157 | 108 if (cc->right) { |
163 | 109 cc1 = charClassMerge(cc->right,cc->cond.range.end+1,end,nextState); |
155 | 110 } else { |
163 | 111 cc1 = createCharClassRange(cc->cond.range.end+1,end,NULL,NULL); |
155 | 112 cc1->nextState = nextState; |
113 } | |
163 | 114 CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc->left,cc1); |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
115 cc3->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 116 return cc3; |
117 } | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
118 if (begin > cc->cond.range.begin) { // 11 |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
119 CharClassPtr cc1; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
120 if (cc->right) { |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
121 cc1 = charClassMerge(cc->right,cc->cond.range.end+1,end,nextState); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
122 } else { |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
123 cc1 = createCharClassRange(cc->cond.range.end+1,end,NULL,NULL); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
124 cc1->nextState = nextState; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
125 } |
163 | 126 CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin,begin-1,cc->left,NULL); |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
127 cc3->nextState = cc->nextState; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
128 CharClassPtr cc2 = createCharClassRange(begin,cc->cond.range.end,cc3,cc1); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
129 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
130 return cc2; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
131 } |
155 | 132 } |
163 | 133 // begin != end && end != cc->cond.range.end |
134 if (begin == cc->cond.range.end) { // 12 | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
135 CharClassPtr cc1; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
136 if (cc->right) { |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
137 cc1 = charClassMerge(cc->right,begin+1,end,nextState); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
138 } else { |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
139 cc1 = createCharClassRange(begin+1,end,NULL,NULL); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
140 cc1->nextState = nextState; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
141 } |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
142 if (cc->cond.range.begin == cc->cond.range.end) { |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
143 CharClassPtr cc2 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc1,cc->right); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
144 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
145 return cc2; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
146 } |
163 | 147 CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end-1,cc->left,NULL); |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
148 cc3->nextState = cc->nextState; |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
149 CharClassPtr cc2 = createCharClassRange(cc->cond.range.end,cc->cond.range.end,cc1,cc3); |
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
150 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; |
155 | 151 return cc2; |
152 } | |
156
b5ecfc008bcf
impl charClassMerge(not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
155
diff
changeset
|
153 } else if (begin < cc->cond.range.begin) { // 5 |
163 | 154 CharClassPtr cc1; |
155 if (cc->left) { | |
156 cc1 = charClassMerge(cc->left,begin,cc->cond.range.begin-1,nextState); | |
157 } else { | |
158 cc1 = createCharClassRange(begin,cc->cond.range.begin-1,NULL,NULL); | |
159 cc1->nextState = nextState; | |
160 } | |
161 CharClassPtr cc3; | |
162 if (cc->right) { | |
163 cc3 = charClassMerge(cc->right,cc->cond.range.end+1,end,nextState); | |
164 } else { | |
165 cc3 = createCharClassRange(cc->cond.range.end+1,end,NULL,NULL); | |
166 cc3->nextState = nextState; | |
167 } | |
168 CharClassPtr cc2 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc1,cc3); | |
169 cc2->nextState.bitContainer = cc->nextState.bitContainer | nextState.bitContainer; | |
170 return cc2; | |
152 | 171 } else { |
172 printf("charClassMerge Error : begin %lu end %lu cc->begin %lu cc->end %lu\n", begin,end,cc->cond.range.begin,cc->cond.range.end); | |
173 } | |
174 return cc; | |
143 | 175 } |
176 | |
142 | 177 TGValue generateTransition(NodePtr n,TransitionGenerator tg) { |
154 | 178 TGValue tgv2; |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
179 if (n->tokenType == '+') { |
142 | 180 TGValue tgv = generateTransition(n->left,tg); |
181 if (tgv.asterisk) { | |
182 TGValue tgv1 = generateTransition(n->right,tg); | |
153 | 183 tgv.ts->nextState->bitContainer |= tgv1.ts->nextState->bitContainer; |
142 | 184 return tgv; |
185 } | |
153 | 186 TGValue tgv1 = generateTransition(n->right,tg); |
187 tgv.ts->nextState = tgv1.ts->nextState; | |
142 | 188 return tgv; |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
189 } else if (n->tokenType == '|') { |
153 | 190 TGValue tgv = generateTransition(n->left,tg); |
191 TGValue tgv1 = generateTransition(n->right,tg); | |
192 tgv.ts = appendTransition(tgv.ts,tgv1.ts); | |
193 return tgv; | |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
194 } else if (n->tokenType == '*') { |
153 | 195 TGValue tgv = generateTransition(n->left,tg); |
196 tgv.asterisk = true; | |
197 return tgv; | |
144
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
198 } else if (n->tokenType == 'c'){ |
154 | 199 return tgv2; |
144
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
200 } else if (n->tokenType == 'a'){ |
153 | 201 TGValue tgv; |
202 tgv.ts = (TransitionPtr)malloc(sizeof(Transition)); | |
203 tgv.ts->condition = n->cc; | |
204 tgv.ts->nextState = (BitVectorPtr)malloc(sizeof(BitVector)); | |
205 bitSet(tgv.ts->nextState,n->nodeNumber); | |
206 tg.ts = appendTransition(tg.ts,tgv.ts); | |
207 return tgv; | |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
208 } else { |
144
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
209 // error |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
210 } |
154 | 211 return tgv2; |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
212 } |
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
213 |
153 | 214 void printTransitionList(TransitionPtr ts) { |
215 for (;ts;ts = ts->next) { | |
216 printf("\n"); | |
217 } | |
218 } | |
219 | |
144
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
220 TransitionGenerator generateTransitionList(NodePtr n) { |
d8a4922eceae
remove some errors (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
143
diff
changeset
|
221 TransitionGenerator tg; |
153 | 222 tg.ts = (TransitionPtr)malloc(sizeof(Transition)); |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
223 generateTransition(n,tg); |
153 | 224 printTransitionList(tg.ts); |
141
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
225 return tg; |
71f36a59cf6a
add appendState
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
139
diff
changeset
|
226 } |