X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/a6b89bb2dccc04745831cb974c74ee71c22cf6a0..0ced3098fd97e1483b4ac938bdce99bfc7942539:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 1af5ec0b..6ef0775c 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -216,6 +216,13 @@ b4_syncline([@oline@], [@ofile@])[ #if ! defined (yyoverflow) || YYERROR_VERBOSE +# ifndef YYFREE +# define YYFREE free +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# endif + /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA @@ -240,8 +247,8 @@ b4_syncline([@oline@], [@ofile@])[ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ @@ -501,11 +508,11 @@ while (0) are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + ((Current).first_line = (Rhs)[1].first_line, \ + (Current).first_column = (Rhs)[1].first_column, \ + (Current).last_line = (Rhs)[N].last_line, \ + (Current).last_column = (Rhs)[N].last_column) #endif /* YYLEX -- calling `yylex' with the right arguments. */ @@ -549,7 +556,7 @@ do { \ /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ ]b4_c_function_def([yy_stack_print], [static void], @@ -800,7 +807,17 @@ b4_c_function_def([yyparse], [int], b4_parse_param) yyssp = yyss; yyvsp = yyvs; ]b4_location_if([ yylsp = yyls;])[ - goto yysetstate; +]m4_ifdef([b4_initial_action], [ +m4_pushdef([b4_at_dollar], [(*yylsp)])dnl +m4_pushdef([b4_dollar_dollar], [(*yyvsp)])dnl + /* User initialization code. */ + b4_initial_action +m4_popdef([b4_dollar_dollar])dnl +m4_popdef([b4_at_dollar])dnl +/* Line __line__ of yacc.c. */ +b4_syncline([@oline@], [@ofile@])])dnl + +[ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | @@ -983,7 +1000,7 @@ yyreduce: ]b4_location_if( [ /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);])[ + YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);])[ YY_REDUCE_PRINT (yyn); switch (yyn) ]{ @@ -1180,7 +1197,7 @@ yyerrlab1: YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; -]b4_location_if([ YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp)); +]b4_location_if([ YYLLOC_DEFAULT (yyloc, yylsp, yylerrsp - yylsp); *++yylsp = yyloc;])[ yystate = yyn;