Mercurial > hg > Applications > Grep
diff regexParser/regexParser.h @ 167:3bf2c6d6d53e pairPro
move regexparser dir
author | masa |
---|---|
date | Sat, 19 Dec 2015 15:38:45 +0900 |
parents | c/regexParser/regexParser.h@6cd0141bed6c |
children | 3be0fbcd4b52 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/regexParser/regexParser.h Sat Dec 19 15:38:45 2015 +0900 @@ -0,0 +1,48 @@ +#include "error.h" + +#define NEW(type) (type*)malloc(sizeof(type)) + +typedef struct bitVector { + unsigned long bitContainer; +}BitVector,*BitVectorPtr; + +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 union 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; + struct node *left; + struct node *right; +} Node, *NodePtr; + +typedef struct regexInfo { + unsigned char *ptr; + unsigned char tokenType; + unsigned char *tokenValue; + int nodeNumber; +} RegexInfo, *RegexInfoPtr; + +CharClassPtr createCharClassRange(unsigned long begin, unsigned long end, CharClassPtr left, CharClassPtr right);