Mercurial > hg > Members > masakoha > testcode
comparison c/regexParser/main.cc @ 77:7f53a587bf97
add regexParser.h
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 28 Sep 2015 16:51:13 +0900 |
parents | d98a036441e2 |
children | 52da06c3f050 |
comparison
equal
deleted
inserted
replaced
76:d98a036441e2 | 77:7f53a587bf97 |
---|---|
7 */ | 7 */ |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 #include <string.h> | 11 #include <string.h> |
12 | 12 #include "regexParser.h" |
13 typedef struct node { | |
14 unsigned char type; | |
15 union value { | |
16 charClass *cc; | |
17 unsigned char character; | |
18 } Value, *ValuePtr; | |
19 struct node *self; | |
20 struct node *parent; | |
21 struct node *left; | |
22 struct node *right; | |
23 } Node, *NodePtr; | |
24 | |
25 typedef struct charClass { | |
26 NodePtr nextState[256]; | |
27 struct utf8Range { | |
28 unsigned char *begin; | |
29 unsigned char *end; | |
30 struct utf8Range *next; | |
31 NodePtr nextState; | |
32 } *rangeList; | |
33 } CharClass, *CharClassPtr; | |
34 | 13 |
35 unsigned char *ptr; | 14 unsigned char *ptr; |
36 unsigned char tokenType; | 15 unsigned char tokenType; |
37 int tokenValue; | 16 int tokenValue; |
38 NodePtr regexHeadNode; | 17 NodePtr regexHeadNode; |