| @@ -1,21 +1,21 @@ | | | @@ -1,21 +1,21 @@ |
1 | /* $NetBSD: output.c,v 1.15 2016/01/09 22:05:33 christos Exp $ */ | | 1 | /* $NetBSD: output.c,v 1.16 2017/01/24 22:28:42 christos Exp $ */ |
2 | | | 2 | |
3 | /* Id: output.c,v 1.74 2014/10/05 23:21:09 tom Exp */ | | 3 | /* Id: output.c,v 1.74 2014/10/05 23:21:09 tom Exp */ |
4 | | | 4 | |
5 | #include "defs.h" | | 5 | #include "defs.h" |
6 | | | 6 | |
7 | #include <sys/cdefs.h> | | 7 | #include <sys/cdefs.h> |
8 | __RCSID("$NetBSD: output.c,v 1.15 2016/01/09 22:05:33 christos Exp $"); | | 8 | __RCSID("$NetBSD: output.c,v 1.16 2017/01/24 22:28:42 christos Exp $"); |
9 | | | 9 | |
10 | #define StaticOrR (rflag ? "" : "static ") | | 10 | #define StaticOrR (rflag ? "" : "static ") |
11 | #define CountLine(fp) (!rflag || ((fp) == code_file)) | | 11 | #define CountLine(fp) (!rflag || ((fp) == code_file)) |
12 | | | 12 | |
13 | #if defined(YYBTYACC) | | 13 | #if defined(YYBTYACC) |
14 | #define PER_STATE 3 | | 14 | #define PER_STATE 3 |
15 | #else | | 15 | #else |
16 | #define PER_STATE 2 | | 16 | #define PER_STATE 2 |
17 | #endif | | 17 | #endif |
18 | | | 18 | |
19 | static int nvectors; | | 19 | static int nvectors; |
20 | static int nentries; | | 20 | static int nentries; |
21 | static Value_t **froms; | | 21 | static Value_t **froms; |
| @@ -1207,27 +1207,28 @@ output_defines(FILE * fp) | | | @@ -1207,27 +1207,28 @@ output_defines(FILE * fp) |
1207 | if (fp != defines_file || iflag) | | 1207 | if (fp != defines_file || iflag) |
1208 | fprintf(fp, "#define YYERRCODE %d\n", symbol_value[1]); | | 1208 | fprintf(fp, "#define YYERRCODE %d\n", symbol_value[1]); |
1209 | | | 1209 | |
1210 | if (fp == defines_file || (iflag && !dflag)) | | 1210 | if (fp == defines_file || (iflag && !dflag)) |
1211 | { | | 1211 | { |
1212 | if (unionized) | | 1212 | if (unionized) |
1213 | { | | 1213 | { |
1214 | if (union_file != 0) | | 1214 | if (union_file != 0) |
1215 | { | | 1215 | { |
1216 | rewind(union_file); | | 1216 | rewind(union_file); |
1217 | while ((c = getc(union_file)) != EOF) | | 1217 | while ((c = getc(union_file)) != EOF) |
1218 | putc_code(fp, c); | | 1218 | putc_code(fp, c); |
1219 | } | | 1219 | } |
1220 | fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix); | | 1220 | if (!pure_parser) |
| | | 1221 | fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix); |
1221 | } | | 1222 | } |
1222 | } | | 1223 | } |
1223 | } | | 1224 | } |
1224 | | | 1225 | |
1225 | static void | | 1226 | static void |
1226 | output_stored_text(FILE * fp) | | 1227 | output_stored_text(FILE * fp) |
1227 | { | | 1228 | { |
1228 | int c; | | 1229 | int c; |
1229 | FILE *in; | | 1230 | FILE *in; |
1230 | | | 1231 | |
1231 | rewind(text_file); | | 1232 | rewind(text_file); |
1232 | if (text_file == NULL) | | 1233 | if (text_file == NULL) |
1233 | open_error("text_file"); | | 1234 | open_error("text_file"); |