template/bison/yacc.c in lrama-0.1.0 vs template/bison/yacc.c in lrama-0.2.0

- old
+ new

@@ -666,11 +666,11 @@ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ - yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \ + yyerror (<%= output.yyerror_args %>, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. @@ -800,13 +800,11 @@ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp<%= output.user_formals %>) { FILE *yyoutput = yyo; - YY_USE (yyoutput); - YY_USE (yylocationp); - YY_USE (p); +<%= output.parse_param_use("yyoutput", "yylocationp") %> if (!yyvaluep) return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN <%# b4_symbol_actions(printer) -%> switch (yykind) @@ -1197,13 +1195,11 @@ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp<%= output.user_formals %>) { - YY_USE (yyvaluep); - YY_USE (yylocationp); - YY_USE (p); +<%= output.parse_param_use("yyvaluep", "yylocationp") %> if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN @@ -1299,14 +1295,11 @@ yychar = YYEMPTY; /* Cause a token to be read. */ <%# b4_user_initial_action -%> -/* User initialization code. */ -#line <%= output.grammar.initial_action.line %> "<%= output.grammar_file_path %>" -<%= output.grammar.initial_action.translated_code %> - +<%= output.user_initial_action("/* User initialization code. */") %> #line [@oline@] [@ofile@] yylsp[0] = yylloc; goto yysetstate; @@ -1422,11 +1415,11 @@ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); - yychar = yylex (&yylval, &yylloc, p); + yychar = yylex <%= output.yylex_formals %>; } if (yychar <= <%= output.eof_symbol.id.s_value %>) { yychar = <%= output.eof_symbol.id.s_value %>; @@ -1588,11 +1581,11 @@ yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = YYENOMEM; } } - yyerror (&yylloc, p, yymsgp); + yyerror (<%= output.yyerror_args %>, yymsgp); if (yysyntax_error_status == YYENOMEM) YYNOMEM; } } @@ -1609,11 +1602,11 @@ YYABORT; } else { yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, p); + yytoken, &yylval, &yylloc<%= output.user_args %>); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error @@ -1665,11 +1658,11 @@ if (yyssp == yyss) YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, p); + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp<%= output.user_args %>); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -1706,11 +1699,11 @@ /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: - yyerror (&yylloc, p, YY_("memory exhausted")); + yyerror (<%= output.yyerror_args %>, YY_("memory exhausted")); yyresult = 2; goto yyreturnlab; /*----------------------------------------------------------. @@ -1721,19 +1714,19 @@ { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, p); + yytoken, &yylval, &yylloc<%= output.user_args %>); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, p); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp<%= output.user_args %>); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss);