X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/9b8a5ce03b0b8c119913a83e65b638a25f854ceb..b2741627b109a934f745d7d83af756b18a29a39b:/src/parse-gram.c diff --git a/src/parse-gram.c b/src/parse-gram.c index a5a1a210..b62ba6bb 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -289,15 +289,17 @@ typedef struct YYLTYPE /* Line 219 of yacc.c. */ #line 291 "../../src/parse-gram.c" -/* Define YYMODERN_C if this compiler supports C89 or better. Some - modern compilers (e.g., IBM xlc 7.0) don't define __STDC__ for - pedantic reasons, but they define __STDC_VERSION__ so check that - as well. Consider a C++ compiler to be modern if it defines - __cplusplus. */ -#if defined (__STDC__) || defined (__STDC_VERSION__) || defined (__cplusplus) -# define YYMODERN_C 1 -#else -# define YYMODERN_C 0 +/* Define YYMODERN_C if this compiler supports C89 or better. If + __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run + as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic + reasons, but it defines __C99__FUNC__ so check that as well. + Consider a C++ compiler to be modern if it defines __cplusplus. */ +#ifndef YYMODERN_C +# if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus) +# define YYMODERN_C 1 +# else +# define YYMODERN_C 0 +# endif #endif #ifndef YYSIZE_T @@ -862,15 +864,15 @@ do { \ YYFPRINTF Args; \ } while (/*CONSTCOND*/ 0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value, Location); \ - YYFPRINTF (stderr, "\n"); \ - } \ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value, Location); \ + YYFPRINTF (stderr, "\n"); \ + } \ } while (/*CONSTCOND*/ 0) /*------------------------------------------------------------------. @@ -878,7 +880,7 @@ do { \ | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__STDC_VERSION__) || defined (__cplusplus) +#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus) static void yy_stack_print (short int *bottom, short int *top) #else @@ -905,7 +907,7 @@ do { \ | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__STDC_VERSION__) || defined (__cplusplus) +#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else @@ -1173,7 +1175,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if defined (__STDC__) || defined (__STDC_VERSION__) || defined (__cplusplus) +#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) #else @@ -1205,105 +1207,104 @@ yysymprint (yyoutput, yytype, yyvaluep, yylocationp) case 3: /* "\"string\"" */ #line 169 "../../src/parse-gram.y" { fprintf (stderr, "\"%s\"", (yyvaluep->chars)); }; -#line 1209 "../../src/parse-gram.c" +#line 1211 "../../src/parse-gram.c" break; case 4: /* "\"integer\"" */ #line 182 "../../src/parse-gram.y" { fprintf (stderr, "%d", (yyvaluep->integer)); }; -#line 1214 "../../src/parse-gram.c" +#line 1216 "../../src/parse-gram.c" break; case 8: /* "\"%destructor {...}\"" */ #line 171 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1219 "../../src/parse-gram.c" +#line 1221 "../../src/parse-gram.c" break; case 9: /* "\"%printer {...}\"" */ #line 175 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1224 "../../src/parse-gram.c" +#line 1226 "../../src/parse-gram.c" break; case 10: /* "\"%union {...}\"" */ #line 176 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1229 "../../src/parse-gram.c" +#line 1231 "../../src/parse-gram.c" break; case 26: /* "\"%initial-action {...}\"" */ #line 172 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1234 "../../src/parse-gram.c" +#line 1236 "../../src/parse-gram.c" break; case 27: /* "\"%lex-param {...}\"" */ #line 173 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1239 "../../src/parse-gram.c" +#line 1241 "../../src/parse-gram.c" break; case 34: /* "\"%parse-param {...}\"" */ #line 174 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1244 "../../src/parse-gram.c" +#line 1246 "../../src/parse-gram.c" break; case 42: /* "\"type\"" */ #line 180 "../../src/parse-gram.y" { fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); }; -#line 1249 "../../src/parse-gram.c" +#line 1251 "../../src/parse-gram.c" break; case 46: /* "\"identifier\"" */ #line 184 "../../src/parse-gram.y" { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; -#line 1254 "../../src/parse-gram.c" +#line 1256 "../../src/parse-gram.c" break; case 47: /* "\"identifier:\"" */ #line 186 "../../src/parse-gram.y" { fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); }; -#line 1259 "../../src/parse-gram.c" +#line 1261 "../../src/parse-gram.c" break; case 49: /* "\"%{...%}\"" */ #line 178 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1264 "../../src/parse-gram.c" +#line 1266 "../../src/parse-gram.c" break; case 50: /* "\"epilogue\"" */ #line 178 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1269 "../../src/parse-gram.c" +#line 1271 "../../src/parse-gram.c" break; case 51: /* "\"{...}\"" */ #line 177 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1274 "../../src/parse-gram.c" +#line 1276 "../../src/parse-gram.c" break; case 72: /* "symbol" */ #line 184 "../../src/parse-gram.y" { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; -#line 1279 "../../src/parse-gram.c" +#line 1281 "../../src/parse-gram.c" break; case 73: /* "action" */ #line 177 "../../src/parse-gram.y" { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); }; -#line 1284 "../../src/parse-gram.c" +#line 1286 "../../src/parse-gram.c" break; case 74: /* "string_as_id" */ #line 184 "../../src/parse-gram.y" { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); }; -#line 1289 "../../src/parse-gram.c" +#line 1291 "../../src/parse-gram.c" break; case 75: /* "string_content" */ #line 169 "../../src/parse-gram.y" { fprintf (stderr, "\"%s\"", (yyvaluep->chars)); }; -#line 1294 "../../src/parse-gram.c" +#line 1296 "../../src/parse-gram.c" break; default: break; } YYFPRINTF (yyoutput, ")"); } - #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__STDC_VERSION__) || defined (__cplusplus) +#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) #else @@ -1364,7 +1365,7 @@ int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__STDC_VERSION__) || defined (__cplusplus) +#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus) int yyparse (void) #else @@ -1468,8 +1469,8 @@ YYLTYPE yylloc; yylloc.start.line = yylloc.end.line = 1; yylloc.start.column = yylloc.end.column = 0; } -/* Line 1064 of yacc.c. */ -#line 1473 "../../src/parse-gram.c" +/* Line 1066 of yacc.c. */ +#line 1474 "../../src/parse-gram.c" yylsp[0] = yylloc; goto yysetstate; @@ -2061,8 +2062,8 @@ yyreduce: default: break; } -/* Line 1260 of yacc.c. */ -#line 2066 "../../src/parse-gram.c" +/* Line 1262 of yacc.c. */ +#line 2067 "../../src/parse-gram.c" yyvsp -= yylen; yyssp -= yylen; @@ -2148,7 +2149,8 @@ yyerrlab: } else { - yydestruct ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc); yychar = YYEMPTY; } } @@ -2202,7 +2204,8 @@ yyerrlab1: YYABORT; yyerror_range[0] = *yylsp; - yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp); + yydestruct ("Error: popping", + yystos[yystate], yyvsp, yylsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp);