comparison regexParser/regexParser.h @ 266:e51cac73e42a

CeriumGrep start
author masa
date Thu, 28 Jan 2016 21:14:34 +0900
parents ef95a7f1bc03
children 5d4afe6f6d00
comparison
equal deleted inserted replaced
265:1e2c12ec25b7 266:e51cac73e42a
65 int ccvSize; 65 int ccvSize;
66 CCVPtr ccv; 66 CCVPtr ccv;
67 } TState, *TStatePtr; 67 } TState, *TStatePtr;
68 68
69 typedef struct result { 69 typedef struct result {
70 unsigned char begin; 70 unsigned char *begin;
71 unsigned char end; 71 unsigned char *end;
72 struct result *next; 72 struct result *next;
73 } Result, *ResultPtr; 73 } Result, *ResultPtr;
74 74
75 typedef struct node { 75 typedef struct node {
76 unsigned char tokenType; 76 unsigned char tokenType;
92 long totalStateCount; 92 long totalStateCount;
93 StateStackPtr stack; 93 StateStackPtr stack;
94 StatePtr stateEnd; 94 StatePtr stateEnd;
95 StatePtr *stateArray; 95 StatePtr *stateArray;
96 StatePtr stateList; 96 StatePtr stateList;
97 StatePtr anyState;
98 TSValue stateSkip(TSValue tsv);
99 TSValue stateMatch(TSValue tsv);
100 TSValue stateNothing(TSValue tsv);
97 } TransitionGenerator, *TransitionGeneratorPtr; 101 } TransitionGenerator, *TransitionGeneratorPtr;
98 102
99 typedef struct buffer { 103 typedef struct buffer {
100 unsigned char *buff; 104 unsigned char *buff;
101 unsigned char *buffptr; 105 unsigned char *buffptr;
104 } Buffer, *BufferPtr; 108 } Buffer, *BufferPtr;
105 109
106 typedef struct tsValue { 110 typedef struct tsValue {
107 Buffer buff; 111 Buffer buff;
108 ResultPtr result; 112 ResultPtr result;
113 ResultPtr resultEnd;
109 TransitionGeneratorPtr tg; 114 TransitionGeneratorPtr tg;
110 TState *current; 115 TState *current;
111 TState *blockBegin; 116 TState *blockBegin;
112 TState *blockEnd; 117 TState *blockEnd;
113 } TSValue, *TSValuePtr; 118 } TSValue, *TSValuePtr;
147 152
148 typedef struct { 153 typedef struct {
149 unsigned char* file_mmap; 154 unsigned char* file_mmap;
150 off_t size; 155 off_t size;
151 } st_mmap_t; 156 } st_mmap_t;
157
158 typedef struct search {
159 TransitionGeneratorPtr tg;
160 const char* filename;
161 } Search, *SearchPtr;
152 #endif 162 #endif
153 163
154 extern NodePtr createNode(RegexInfoPtr ri,unsigned char type,CharClassPtr cc, NodePtr left, NodePtr right); 164 extern NodePtr createNode(RegexInfoPtr ri,unsigned char type,CharClassPtr cc, NodePtr left, NodePtr right);
155 extern CharClassPtr createCharClassRange(unsigned long begin, unsigned long end,unsigned long state, CharClassPtr left, CharClassPtr right); 165 extern CharClassPtr createCharClassRange(unsigned long begin, unsigned long end,unsigned long state, CharClassPtr left, CharClassPtr right);
156 extern NodePtr regex(RegexInfoPtr); 166 extern NodePtr regex(RegexInfoPtr);