Mercurial > hg > Applications > Grep
comparison c/regexParser/regexParser.cc @ 120:5d29b6a1b50f testcode
include Word in Node
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 26 Nov 2015 20:40:30 +0900 |
parents | 31b0ba0050fa |
children | aa266a4db47c |
comparison
equal
deleted
inserted
replaced
118:31b0ba0050fa | 120:5d29b6a1b50f |
---|---|
34 } | 34 } |
35 | 35 |
36 n->tokenType = ri->tokenType; | 36 n->tokenType = ri->tokenType; |
37 n->left = left; | 37 n->left = left; |
38 n->right = right; | 38 n->right = right; |
39 n->nodeNumber = ri->nodeNumber; | |
40 ri->nodeNumber++; | |
39 | 41 |
40 if (ri->tokenType == 'a') { | 42 if (ri->tokenType == 'a') { |
41 n->nodeNumber = ri->nodeNumber; | |
42 ri->nodeNumber++; | |
43 ri->tokenType = 0; | 43 ri->tokenType = 0; |
44 n->cc->cond->w = getWord(ri->tokenValue); | 44 n->cc->cond->w = getWord(ri->tokenValue); |
45 ri->ptr += n->cc->cond->w->length-1; | 45 ri->ptr += n->cc->cond->w->length-1; |
46 } else { | 46 } else { |
47 WordPtr w = (WordPtr)malloc(sizeof(Word)); | 47 WordPtr w = (WordPtr)malloc(sizeof(Word)); |
126 ri->tokenValue = ri->ptr; | 126 ri->tokenValue = ri->ptr; |
127 ri->ptr++; | 127 ri->ptr++; |
128 return; | 128 return; |
129 } | 129 } |
130 } | 130 } |
131 ri->tokenType = 0; | |
132 ri->tokenValue = 0; | |
133 return; | 131 return; |
134 } | 132 } |
135 | 133 |
136 // <regexAtom> ::= <literal>|<charClass>|<group> | 134 // <regexAtom> ::= <literal>|<charClass>|<group> |
137 static | 135 static |