X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/e141f4d4bb6584bfbf13003047a2e48e9a6eab6a..9b5049bd074ec26af9e216fd95eb8d618e3601a4:/data/lalr1.cc diff --git a/data/lalr1.cc b/data/lalr1.cc index b89a6df8..deab8639 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -149,16 +149,13 @@ dnl FIXME: This is wrong, we want computed header guards. #include #include #include +]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])[ @@ -689,7 +686,7 @@ b4_percent_code_get[]dnl 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; @@ -866,7 +863,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[ } ]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 @@ -897,7 +894,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[ 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 @@ -931,14 +928,14 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[ 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;