comparison 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
comparison
equal deleted inserted replaced
166:96854eba17e5 167:3bf2c6d6d53e
1 #include "error.h"
2
3 #define NEW(type) (type*)malloc(sizeof(type))
4
5 typedef struct bitVector {
6 unsigned long bitContainer;
7 }BitVector,*BitVectorPtr;
8
9 typedef struct word {
10 unsigned char *word;
11 int length;
12 } Word, *WordPtr;
13
14 typedef struct utf8Range {
15 unsigned long begin;
16 unsigned long end;
17 struct utf8Range *next; // only used in the parser.
18 } RangeList , *RangeListPtr;
19
20 typedef union condition {
21 RangeList range;
22 Word w;
23 } Condition, *ConditionList;
24
25 typedef struct charClass {
26 unsigned char type;
27 struct charClass *left;
28 struct charClass *right;
29 Condition cond;
30 BitVector nextState;
31 } CharClass, *CharClassPtr;
32
33 typedef struct node {
34 unsigned char tokenType;
35 unsigned long nodeNumber;
36 CharClassPtr cc;
37 struct node *left;
38 struct node *right;
39 } Node, *NodePtr;
40
41 typedef struct regexInfo {
42 unsigned char *ptr;
43 unsigned char tokenType;
44 unsigned char *tokenValue;
45 int nodeNumber;
46 } RegexInfo, *RegexInfoPtr;
47
48 CharClassPtr createCharClassRange(unsigned long begin, unsigned long end, CharClassPtr left, CharClassPtr right);