# HG changeset patch # User masa # Date 1444302452 -32400 # Node ID 5072a44ed84286593e149cc2cba1549d23f79cbc # Parent 3d1c71fbd4a4d207cc8dddb0b14276303a8367cb add Word diff -r 3d1c71fbd4a4 -r 5072a44ed842 c/regexParser/createRegexTree.cc --- a/c/regexParser/createRegexTree.cc Wed Oct 07 18:21:32 2015 +0900 +++ b/c/regexParser/createRegexTree.cc Thu Oct 08 20:07:32 2015 +0900 @@ -38,8 +38,9 @@ // ::= [a-z][A-Z][0-9] NodePtr literal(RegexInfoPtr ri) { + unsigned char *top = ri->ptr; NodePtr n = createNode(ri->ptr[0],0,0); - ri->ptr++; + token(ri); return n; } diff -r 3d1c71fbd4a4 -r 5072a44ed842 c/regexParser/regexParser.h --- a/c/regexParser/regexParser.h Wed Oct 07 18:21:32 2015 +0900 +++ b/c/regexParser/regexParser.h Thu Oct 08 20:07:32 2015 +0900 @@ -7,11 +7,17 @@ } *rangeList; } CharClass, *CharClassPtr; +typedef struct word { + unsigned char *word; + long length; +} Word, *WordPtr; + typedef struct node { unsigned char type; union value { - charClass cc; + CharClassPtr cc; unsigned char character; + WordPtr w; } Value, *ValuePtr; struct node *self; struct node *parent;