Mercurial > hg > Applications > Grep
changeset 184:1da1b2eacb84 pairPro
gather struct
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 24 Dec 2015 20:09:21 +0900 |
parents | 7ae0a3070647 |
children | d25f4f3b4c34 |
files | regexParser/regexParser.h regexParser/subsetConstraction.cc regexParser/subsetConstraction.h regexParser/transition.h |
diffstat | 4 files changed, 47 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/regexParser.h Thu Dec 24 20:02:09 2015 +0900 +++ b/regexParser/regexParser.h Thu Dec 24 20:09:21 2015 +0900 @@ -7,6 +7,45 @@ unsigned long bitContainer; }BitVector,*BitVectorPtr; +typedef struct stateStack { + BitVector state; + struct stateStack *next; +} StateStack, *StateStackPtr; + +typedef struct transitionGenerator { + long stateMax; + StateStack stack; + StatePtr state; + StatePtr stateArray; + StatePtr stateArrayLast; + StatePtr currentState; + StatePtr nextState; +} TransitionGenerator, *TransitionGeneratorPtr; + +typedef struct tgValue { + bool asterisk; + int stateBegin; + int stateEnd; + TransitionGeneratorPtr tg; +} TGValue, *TGValuePtr; + +enum charClassStackState { + LEFT, + SELF, + RIGHT +}; + +typedef struct charClassStack { + charClassStackState turn; + CharClassPtr cc; + struct charClassStack *next; +} CharClassStack, *CharClassStackPtr; + +typedef struct charClassWalker { + CharClassStackPtr stack; + CharClassPtr next; +} CharClassWalker, *CharClassWalkerPtr; + typedef struct word { unsigned char *word; int length; @@ -42,6 +81,13 @@ struct node *right; } Node, *NodePtr; +typedef struct state { + BitVector bitState; + CharClassPtr cc; + NodePtr node; + struct state *next; +} State, *StatePtr; + typedef struct regexInfo { unsigned char *ptr; unsigned char tokenType;
--- a/regexParser/subsetConstraction.cc Thu Dec 24 20:02:09 2015 +0900 +++ b/regexParser/subsetConstraction.cc Thu Dec 24 20:09:21 2015 +0900 @@ -313,7 +313,7 @@ tgv.asterisk = false; tgv.tg = tg; StatePtr start = createState(tgv,n); - NodePtr eof = createNode(); + NodePtr eof = createNode(NULL,'e',NULL,NULL,NULL); StatePtr end = createState(tgv,eof); tgv.stateBegin = 0; tgv.stateEnd = 1;
--- a/regexParser/subsetConstraction.h Thu Dec 24 20:02:09 2015 +0900 +++ b/regexParser/subsetConstraction.h Thu Dec 24 20:09:21 2015 +0900 @@ -1,44 +1,4 @@ #include "transition.h" #define INIT_STATE_BIT 0 #define END_STATE_BIT 63 -typedef struct stateStack { - BitVector state; - struct stateStack *next; -} StateStack, *StateStackPtr; - -typedef struct transitionGenerator { - long stateMax; - StateStack stack; - StatePtr state; - StatePtr stateArray; - StatePtr stateArrayLast; - StatePtr currentState; - StatePtr nextState; -} TransitionGenerator, *TransitionGeneratorPtr; - -typedef struct tgValue { - bool asterisk; - int stateBegin; - int stateEnd; - StatePtr state; - TransitionGeneratorPtr tg; -} TGValue, *TGValuePtr; - -enum charClassStackState { - LEFT, - SELF, - RIGHT -}; - -typedef struct charClassStack { - charClassStackState turn; - CharClassPtr cc; - struct charClassStack *next; -} CharClassStack, *CharClassStackPtr; - -typedef struct charClassWalker { - CharClassStackPtr stack; - CharClassPtr next; -} CharClassWalker, *CharClassWalkerPtr; - CharClassPtr charClassMerge(CharClassPtr cc,unsigned long begin, unsigned long end, BitVector nextState);
--- a/regexParser/transition.h Thu Dec 24 20:02:09 2015 +0900 +++ b/regexParser/transition.h Thu Dec 24 20:09:21 2015 +0900 @@ -1,12 +1,5 @@ #include "bitVector.h" -typedef struct state { - BitVector bitState; - CharClassPtr cc; - NodePtr node; - struct state *next; -} State, *StatePtr; - StatePtr createState(BitVector bi); StatePtr appendState(StatePtr x,StatePtr y); /*