OLD | NEW |
1 #include <stdlib.h> | 1 #include <stdlib.h> |
2 #include <string.h> | 2 #include <string.h> |
3 #include <ctype.h> | 3 #include <ctype.h> |
4 #include "tools/re2c/substr.h" | 4 #include "tools/re2c/substr.h" |
5 #include "tools/re2c/globals.h" | 5 #include "tools/re2c/globals.h" |
6 #include "tools/re2c/dfa.h" | 6 #include "tools/re2c/dfa.h" |
7 #include "tools/re2c/parse.h" | 7 #include "tools/re2c/parse.h" |
8 | 8 |
9 static void useLabel(size_t value) { | 9 static void useLabel(size_t value) { |
10 while (value >= vUsedLabelAlloc) { | 10 while (value >= vUsedLabelAlloc) { |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 start_label = label; | 837 start_label = label; |
838 | 838 |
839 Action_new_Enter(d->head, label++); | 839 Action_new_Enter(d->head, label++); |
840 | 840 |
841 for(s = d->head; s; s = s->next) | 841 for(s = d->head; s; s = s->next) |
842 s->label = label++; | 842 s->label = label++; |
843 | 843 |
844 nOrgOline = oline; | 844 nOrgOline = oline; |
845 maxFillIndexes = vFillIndexes; | 845 maxFillIndexes = vFillIndexes; |
846 orgVFillIndexes = vFillIndexes; | 846 orgVFillIndexes = vFillIndexes; |
847 tmpo = fopen("re2c.tmp", "wt"); | 847 tmpo = tmpfile(); |
848 for(s = d->head; s; s = s->next){ | 848 for(s = d->head; s; s = s->next){ |
849 int readCh = 0; | 849 int readCh = 0; |
850 State_emit(s, tmpo, &readCh); | 850 State_emit(s, tmpo, &readCh); |
851 Go_genGoto(&s->go, tmpo, s, s->next, &readCh); | 851 Go_genGoto(&s->go, tmpo, s, s->next, &readCh); |
852 } | 852 } |
853 fclose(tmpo); | 853 fclose(tmpo); |
854 remove("re2c.tmp"); | |
855 maxFillIndexes = vFillIndexes; | 854 maxFillIndexes = vFillIndexes; |
856 vFillIndexes = orgVFillIndexes; | 855 vFillIndexes = orgVFillIndexes; |
857 oline = nOrgOline; | 856 oline = nOrgOline; |
858 | 857 |
859 fputs("\n", o); | 858 fputs("\n", o); |
860 oline++; | 859 oline++; |
861 if (!iFlag) | 860 if (!iFlag) |
862 fprintf(o, "#line %u \"%s\"\n", oline++, outputFileName); | 861 fprintf(o, "#line %u \"%s\"\n", oline++, outputFileName); |
863 | 862 |
864 if (!hasFillLabels) { | 863 if (!hasFillLabels) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 if (bitmap_brace) { | 901 if (bitmap_brace) { |
903 fputs("}\n", o); | 902 fputs("}\n", o); |
904 oline++; | 903 oline++; |
905 } | 904 } |
906 | 905 |
907 BitMap_first = NULL; | 906 BitMap_first = NULL; |
908 | 907 |
909 free(saves); | 908 free(saves); |
910 free(rules); | 909 free(rules); |
911 } | 910 } |
OLD | NEW |