help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %union problem in 2.4 version


From: Cleto Martin Angelina
Subject: Re: %union problem in 2.4 version
Date: Wed, 25 Mar 2009 16:47:12 +0100

Thanks a lot, Joel.

The problem is now solved. Your reference to the manual's section was
enough. I'm sorry about my stupid question, it was a silly thing. I only had
to change the %{ ... }% block for a %code top and %code requires blocks
before %union declaration.

Regards,
Cleto

On Wed, Mar 25, 2009 at 3:13 PM, Joel E. Denny <address@hidden>wrote:

> Hi Cleto,
>
> On Wed, 25 Mar 2009, Cleto Martin Angelina wrote:
>
> > Recently, i'm having troubles compiling my parser, which worked in bison
> > 2.3. The output message is:
> >
> > Parser.y:42: error: ISO C++ forbids declaration of ‘Invocation’ with no
> type
> > Parser.y:42: error: expected ‘;’ before ‘*’ token
> > Parser.y:43: error: ISO C++ forbids declaration of ‘Parameter’ with no
> type
> > Parser.y:43: error: expected ‘;’ before ‘*’ token
> > Parser.y:44: error: ISO C++ forbids declaration of ‘vector’ with no type
> > Parser.y:44: error: invalid use of ‘::’
> > Parser.y:44: error: expected ‘;’ before ‘<’ token
> >
> > And header's .y file is:
> >
> > %{
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include "Driver.h"
> > %}
>
> Without seeing the rest of your code, I can't be sure, but try changing
> the above to the following:
>
>  %code require {
>     #include <stdio.h>
>    #include <stdlib.h>
>    #include "Driver.h"
>  }
>
> If you don't need the std library includes in your .hh file, you might
> move them into a "%code {...}" or a "%code top {...}".  See the section
> "3.1.2 Prologue Alternatives" in the Bison 2.4 manual for a complete
> discussion.
>
> > I've read about that in this mailing list, but i'm really lost. I don't
> know
> > which features have changed in 2.4 version that are affecting my project.
> > Can anyone guide me?.
>
> For a list of changes over recent Bison releases, see NEWS in your Bison
> distribution.  In particular, see the entry "Handling of traditional Yacc
> prologue blocks" under the 2.3a heading.




-- 
---------------------------
Cleto Martín Angelina
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]