[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ template lalr1.cc: one use of location instead of location_type
From: |
Joel E. Denny |
Subject: |
Re: C++ template lalr1.cc: one use of location instead of location_type |
Date: |
Tue, 21 Oct 2008 10:56:17 -0400 (EDT) |
As far as I can tell, this message was never delivered, so I'm resending.
On Sat, 18 Oct 2008, Joel E. Denny wrote:
> On Sun, 31 Aug 2008, Georg Sauthoff wrote:
>
> > I noticed, that in the C++ parser template class lalr1.cc is one usage
> > of 'location' hardcoded instead of the user configurable type-synonym
> > 'location_type'.
>
> > location yyerror_range[2];
>
> > 1. just replace 'location' with 'location_type', like in the rest of the
> > lalr1.cc.
>
> Looks reasonable. I pushed the following fix. Thanks for the report.
>
> > 2. do 1. and extend yy::location with a virtual method which does this
> > computation (-> user can over-load this function if needed when
> > extending yy::location)
>
> This sounds like a new feature rather than a fix, so I think it should
> wait until after the 2.4 release. Even then, I'll probably just leave it
> up to Akim Demaille, who wrote the C++ skeletons.
>
> >From 0f0e1ace602fd8ded2457b1ea4f73c8fb2bfc6cc Mon Sep 17 00:00:00 2001
> From: Joel E. Denny <address@hidden>
> Date: Sat, 18 Oct 2008 12:46:12 -0400
> Subject: [PATCH] Fix yyerror_range for user-defined location type in C++.
>
> Reported by Georg Sauthoff at
> <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
> * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
> * THANKS (Georg Sauthoff): Add.
>
> diff --git a/THANKS b/THANKS
> index 7b16cf3..6785e2a 100644
> --- a/THANKS
> +++ b/THANKS
> @@ -34,6 +34,7 @@ Fabrice Bauzac address@hidden
> Florian Krohm address@hidden
> Frank Heckenbach address@hidden
> Frans Englich address@hidden
> +Georg Sauthoff address@hidden
> Goran Uddeborg address@hidden
> Guido Trentalancia address@hidden
> H. Merijn Brand address@hidden
> diff --git a/data/lalr1.cc b/data/lalr1.cc
> index bc371dc..927466a 100644
> --- a/data/lalr1.cc
> +++ b/data/lalr1.cc
> @@ -537,7 +537,7 @@ do { \
> /// Location of the lookahead.
> location_type yylloc;
> /// The locations where the error started and ended.
> - location yyerror_range[2];
> + location_type yyerror_range[2];
>
> /// $$.
> semantic_type yyval;
> --
> 1.5.4.3
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: C++ template lalr1.cc: one use of location instead of location_type,
Joel E. Denny <=