#include <stdexcept>
#include <string>
#include <iostream>
+]b4_locations_if([#include "location.hh"])[
#include "stack.hh"
]b4_namespace_open[
-]b4_locations_if([ class position;
- class location;])[
]b4_variant_if([b4_variant_define])[
]b4_namespace_close[
-]b4_locations_if([#include "location.hh"])[
-
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
symbol_type yyla;]b4_locations_if([[
/// The locations where the error started and ended.
- stack_symbol_type yyerror_range[2];]])[
+ stack_symbol_type yyerror_range[3];]])[
/// $$ and @@$.
stack_symbol_type yylhs;
}
]b4_locations_if([[
- yyerror_range[0].location = yyla.location;]])[
+ yyerror_range[1].location = yyla.location;]])[
if (yyerrstatus_ == 3)
{
/* If just tried and failed to reuse lookahead token after an
code. */
if (false)
goto yyerrorlab;]b4_locations_if([[
- yyerror_range[0].location = yystack_[yylen - 1].location;]])b4_variant_if([[
+ yyerror_range[1].location = yystack_[yylen - 1].location;]])b4_variant_if([[
/* $$ was initialized before running the user action. */
yy_destroy_ ("Error: discarding", yylhs);]])[
/* Do not reclaim the symbols of the rule which action triggered
if (yystack_.size () == 1)
YYABORT;
]b4_locations_if([[
- yyerror_range[0].location = yystack_[0].location;]])[
+ yyerror_range[1].location = yystack_[0].location;]])[
yy_destroy_ ("Error: popping", yystack_[0]);
yypop_ ();
YY_STACK_PRINT ();
}
]b4_locations_if([[
- yyerror_range[1].location = yyla.location;
- YYLLOC_DEFAULT (error_token.location, (yyerror_range - 1), 2);]])[
+ yyerror_range[2].location = yyla.location;
+ YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[
/* Shift the error token. */
error_token.state = yyn;