glr2.cc: pass references to yyreportAmbiguity

* data/skeletons/glr2.cc (yyreportAmbiguity): Use references.
This commit is contained in:
Akim Demaille
2020-12-26 14:15:06 +01:00
parent 92dc8bf23b
commit 8a22b557b9

View File

@@ -1788,8 +1788,8 @@ public:
#endif #endif
YYRESULTTAG YYRESULTTAG
yyreportAmbiguity (semantic_option* yyx0, yyreportAmbiguity (const semantic_option& yyx0,
semantic_option* yyx1, ]b4_namespace_ref[::]b4_parser_class[& yyparser]b4_locations_if([, location_type *yylocp])[) const semantic_option& yyx1, ]b4_namespace_ref[::]b4_parser_class[& yyparser]b4_locations_if([, const location_type& yyloc])[)
{ {
YYUSE (yyx0); YYUSE (yyx0);
YYUSE (yyx1); YYUSE (yyx1);
@@ -1797,13 +1797,13 @@ public:
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
std::cerr << "Ambiguity detected.\n"; std::cerr << "Ambiguity detected.\n";
std::cerr << "Option 1,\n"; std::cerr << "Option 1,\n";
yyreportTree (*yyx0, 2); yyreportTree (yyx0, 2);
std::cerr << "\nOption 2,\n"; std::cerr << "\nOption 2,\n";
yyreportTree (*yyx1, 2); yyreportTree (yyx1, 2);
std::cerr << '\n'; std::cerr << '\n';
#endif #endif
yyparser.error (]b4_locations_if([*yylocp, ])[YY_("syntax is ambiguous")); yyparser.error (]b4_locations_if([yyloc, ])[YY_("syntax is ambiguous"));
return yyabort; return yyabort;
} }
@@ -2602,7 +2602,7 @@ private:
{ {
case 0:]b4_locations_if([[ case 0:]b4_locations_if([[
yyresolveLocations (yys, 1);]])[ yyresolveLocations (yys, 1);]])[
return yystateStack.yyreportAmbiguity (yybest, yyp, yyparser]b4_locations_if([, yylocp])[); return yystateStack.yyreportAmbiguity (*yybest, *yyp, yyparser]b4_locations_if([, *yylocp])[);
break; break;
case 1: case 1:
yymerge = true; yymerge = true;