X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b0937b2259b424f74f79ceafdc1a110af35d405a..6d441fc378923011574bb48a23cfcfd4f2e536a3:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 462af2e2..4cf0b05f 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -190,7 +190,7 @@ b4_location_if([#define yylloc b4_prefix[]lloc])])[ ]m4_ifdef([b4_stype], [b4_syncline([b4_stype_line], [b4_filename]) typedef union b4_stype yystype; -/* Line __line__ of __file__. */ +/* Line __line__ of yacc.c. */ b4_syncline([@oline@], [@ofile@])], [typedef int yystype;])[ # define YYSTYPE yystype @@ -212,7 +212,7 @@ typedef struct yyltype /* Copy the second part of user declarations. */ ]b4_post_prologue -/* Line __line__ of __file__. */ +/* Line __line__ of yacc.c. */ b4_syncline([@oline@], [@ofile@])[ #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -261,17 +261,17 @@ union yyalloc [}; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ ]b4_location_if( [# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX)], + + 2 * YYSTACK_GAP_MAXIMUM)], [# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX)])[ + + YYSTACK_GAP_MAXIMUM)])[ /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ @@ -302,7 +302,7 @@ union yyalloc YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) @@ -577,8 +577,9 @@ do { \ [[int yyrule], [yyrule]])[ { int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %d), ", - yyrule - 1, yyrline[yyrule]); + unsigned int yylineno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); @@ -912,8 +913,6 @@ yybackup: } else { - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } @@ -989,7 +988,7 @@ yyreduce: b4_actions } -/* Line __line__ of __file__. */ +/* Line __line__ of yacc.c. */ b4_syncline([@oline@], [@ofile@]) [ yyvsp -= yylen; @@ -1073,13 +1072,7 @@ yyerrlab: #endif /* YYERROR_VERBOSE */ yyerror (]b4_yyerror_args["syntax error"); } - goto yyerrlab1; - -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -1107,7 +1100,13 @@ yyerrlab1: /* Else will try to reuse lookahead token after shifting the error token. */ + goto yyerrlab1; + +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ +yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) @@ -1198,7 +1197,7 @@ b4_token_defines(b4_tokens) m4_ifdef([b4_stype], [b4_syncline([b4_stype_line], [b4_filename]) typedef union b4_stype yystype; -/* Line __line__ of __file__. */ +/* Line __line__ of yacc.c. */ b4_syncline([@oline@], [@ofile@])], [typedef int yystype;]) # define YYSTYPE yystype