Mercurial > hg > Applications > Grep
comparison regexParser/generateLoop.cc @ 313:90ccd94906c0
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 09 Feb 2016 11:02:35 +0900 |
parents | c9ac6f06e706 |
children |
comparison
equal
deleted
inserted
replaced
312:c9ac6f06e706 | 313:90ccd94906c0 |
---|---|
11 | 11 |
12 fprintf(fp,"static TSValue state%lx(TSValue tsv) {\n",stateNum); | 12 fprintf(fp,"static TSValue state%lx(TSValue tsv) {\n",stateNum); |
13 if (accept && state->accept) { | 13 if (accept && state->accept) { |
14 fputs(" tsv=tsv.tg->stateMatch(tsv);\n",fp); | 14 fputs(" tsv=tsv.tg->stateMatch(tsv);\n",fp); |
15 } | 15 } |
16 fputs(" if (tsv.buff.buffptr >= tsv.buff.buffend) return tsv;\n",fp); | |
17 CharClassWalkerPtr ccw = createCharClassWalker(state->cc); | 16 CharClassWalkerPtr ccw = createCharClassWalker(state->cc); |
18 if (hasNext(ccw)) fputs(" unsigned char c = *tsv.buff.buffptr++;\n",fp); | 17 if (hasNext(ccw)) fputs(" unsigned char c = *tsv.buff.buffptr++;\n",fp); |
19 fputs(" if (0) ;\n",fp); | 18 fputs(" if (0) ;\n",fp); |
20 while (hasNext(ccw)) { | 19 while (hasNext(ccw)) { |
21 CharClassPtr cc = getNext(ccw); | 20 CharClassPtr cc = getNext(ccw); |
41 if (fp==NULL) { | 40 if (fp==NULL) { |
42 perror(""); | 41 perror(""); |
43 fprintf(stderr,"cannot write state.cc\n"); | 42 fprintf(stderr,"cannot write state.cc\n"); |
44 exit(1); | 43 exit(1); |
45 } | 44 } |
46 fprintf(fp,"static TSValue state%lx(TSValue tsv) ;\n",0); | 45 fprintf(fp,"static TSValue state%lx(TSValue tsv) ;\n",0L); |
47 for (;state;state = state->next) { | 46 for (;state;state = state->next) { |
48 if (state->bitState.bitContainer!=1) // state1 always unused but state0 | 47 if (state->bitState.bitContainer!=1) // state1 always unused but state0 |
49 fprintf(fp,"static TSValue state%lx(TSValue tsv);\n",state->bitState.bitContainer); | 48 fprintf(fp,"static TSValue state%lx(TSValue tsv);\n",state->bitState.bitContainer); |
50 } | 49 } |
51 fputs("\n",fp); | 50 fputs("\n",fp); |