changeset 85:5072a44ed842

add Word
author masa
date Thu, 08 Oct 2015 20:07:32 +0900
parents 3d1c71fbd4a4
children 1d7ca366b199
files c/regexParser/createRegexTree.cc c/regexParser/regexParser.h
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 
 // <literal> ::= [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;
 }
 
--- 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;