Mercurial > hg > Members > masakoha > testcode
annotate regexParser/subsetConstraction.h @ 182:dbe004d03ef0 pairPro
implement stateAllocate()
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 24 Dec 2015 19:14:49 +0900 |
parents | 3c4db09b8581 |
children | 7ae0a3070647 |
rev | line source |
---|---|
139
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
1 #include "transition.h" |
175
3be0fbcd4b52
implement createTransitionGenerator
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
173
diff
changeset
|
2 #define INIT_STATE_BIT 0 |
3be0fbcd4b52
implement createTransitionGenerator
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
173
diff
changeset
|
3 #define END_STATE_BIT 63 |
170 | 4 typedef struct stateStack { |
5 BitVector state; | |
6 struct stateStack *next; | |
7 } StateStack, *StateStackPtr; | |
8 | |
139
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
9 typedef struct transitionGenerator { |
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
10 long stateMax; |
170 | 11 StateStack stack; |
173 | 12 StatePtr state; |
13 StatePtr stateArray; | |
14 StatePtr stateArrayLast; | |
15 StatePtr currentState; | |
16 StatePtr nextState; | |
139
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
17 } TransitionGenerator, *TransitionGeneratorPtr; |
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
18 |
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
19 typedef struct tgValue { |
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
20 bool asterisk; |
182
dbe004d03ef0
implement stateAllocate()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
181
diff
changeset
|
21 int stateBegin; |
dbe004d03ef0
implement stateAllocate()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
181
diff
changeset
|
22 int stateEnd; |
170 | 23 TransitionGeneratorPtr tg; |
139
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
24 } TGValue, *TGValuePtr; |
6c258910cacb
remove some warning and error
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
117
diff
changeset
|
25 |
180
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
26 enum charClassStackState { |
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
27 LEFT, |
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
28 SELF, |
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
29 RIGHT |
181
3c4db09b8581
change return value findLeftMost()
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
180
diff
changeset
|
30 }; |
180
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
31 |
169
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
32 typedef struct charClassStack { |
180
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
33 charClassStackState turn; |
169
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
34 CharClassPtr cc; |
171
684363c44d6f
remove some warning and error (not working)
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
170
diff
changeset
|
35 struct charClassStack *next; |
169
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
36 } CharClassStack, *CharClassStackPtr; |
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
37 |
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
38 typedef struct charClassWalker { |
180
d97bcab546e8
implement getNext
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
39 CharClassStackPtr stack; |
169
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
40 CharClassPtr next; |
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
41 } CharClassWalker, *CharClassWalkerPtr; |
313f1c176328
implement mergeTransition
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
167
diff
changeset
|
42 |
164
93d3ad1d20ed
add mergeTest.cc
Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
parents:
144
diff
changeset
|
43 CharClassPtr charClassMerge(CharClassPtr cc,unsigned long begin, unsigned long end, BitVector nextState); |