X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/8200219a2a98c54a72cd744abbb656e18bd33ccf..ad6f84e550b78816b5591fc174883e49720deca8:/data/lalr1.cc diff --git a/data/lalr1.cc b/data/lalr1.cc index a3f7567a..cd54b6c3 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -1,7 +1,6 @@ # C++ skeleton for Bison -# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 2002-2010 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +34,7 @@ m4_divert_push(0)dnl b4_defines_if( [@output(b4_spec_defines_file@)@ b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++], - [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009]) + [2002-2010]) dnl FIXME: This is wrong, we want computed header guards. [ /* C++ LALR(1) parser skeleton written by Akim Demaille. */ @@ -47,14 +46,8 @@ dnl FIXME: This is wrong, we want computed header guards. #include #include -#include "stack.hh" - -]b4_namespace_open[ - class position; - class location; -]b4_namespace_close[ - #include "location.hh" +#include "stack.hh" /* Enabling traces. */ #ifndef YYDEBUG @@ -305,7 +298,7 @@ b4_percent_code_get([[provides]])[]dnl ])dnl @output(b4_parser_file_name@)@ b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++], - [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009]) + [2002-2010]) b4_percent_code_get([[top]])[]dnl m4_if(b4_prefix, [yy], [], [ @@ -554,7 +547,7 @@ do { \ /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. - location_type yyerror_range[2]; + location_type yyerror_range[3]; /// $$. semantic_type yyval; @@ -724,7 +717,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; error (yylloc, yysyntax_error_ (yystate, yytoken)); } - yyerror_range[0] = yylloc; + yyerror_range[1] = yylloc; if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an @@ -759,7 +752,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; if (false) goto yyerrorlab; - yyerror_range[0] = yylocation_stack_[yylen - 1]; + yyerror_range[1] = yylocation_stack_[yylen - 1]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ yypop_ (yylen); @@ -791,7 +784,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; if (yystate_stack_.height () == 1) YYABORT; - yyerror_range[0] = yylocation_stack_[0]; + yyerror_range[1] = yylocation_stack_[0]; yydestruct_ ("Error: popping", yystos_[yystate], &yysemantic_stack_[0], &yylocation_stack_[0]); @@ -800,10 +793,10 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; YY_STACK_PRINT (); } - yyerror_range[1] = yylloc; + yyerror_range[2] = yylloc; // Using YYLLOC is tempting, but would change the location of // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + YYLLOC_DEFAULT (yyloc, yyerror_range, 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); @@ -1092,7 +1085,7 @@ b4_error_verbose_if([int yystate, int yytoken], dnl @output(b4_dir_prefix[]stack.hh@)@ b4_copyright([Stack handling for Bison parsers in C++], - [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])[ + [2002-2010])[ #ifndef BISON_STACK_HH # define BISON_STACK_HH