Mercurial > hg > Applications > Grep
view regexParser/regexParser.h @ 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 | 3e8aae8beba9 |
line wrap: on
line source
#include "error.h" #define NEW(type) (type*)malloc(sizeof(type)) #define SYNTAX_NODENUMBER 100 typedef struct bitVector { 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; } Word, *WordPtr; typedef struct utf8Range { unsigned long begin; unsigned long end; struct utf8Range *next; // only used in the parser. } RangeList , *RangeListPtr; typedef struct condition { RangeList range; Word w; } Condition, *ConditionList; typedef struct charClass { unsigned char type; struct charClass *left; struct charClass *right; Condition cond; BitVector nextState; } CharClass, *CharClassPtr; typedef struct node { unsigned char tokenType; unsigned long nodeNumber; CharClassPtr cc; int stateNum; int nextStateNum; StatePtr state; struct node *left; 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; unsigned char *tokenValue; int stateNumber; } RegexInfo, *RegexInfoPtr; CharClassPtr createCharClassRange(unsigned long begin, unsigned long end, CharClassPtr left, CharClassPtr right);