[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use C++ types in '%union declaration'
From: |
Bob Rossi |
Subject: |
Re: How to use C++ types in '%union declaration' |
Date: |
Sun, 25 Feb 2007 13:47:07 -0500 |
User-agent: |
Mutt/1.5.12-2006-07-14 |
On Sat, Feb 24, 2007 at 01:49:26PM -0500, Joel E. Denny wrote:
> On Sat, 24 Feb 2007, Bob Rossi wrote:
>
> > How come if I do
> >
> > %union {
> > std::string *foo;
> > }
> >
> > I get,
> > error: expected specifier-qualifier-list before ‘std’
>
> This doesn't happen to me. Can you post a small but complete grammar file
> that demonstrates this? Thanks.
I see the problem now. I #include OutGrammar.h into Lexer.l.
OutGrammar.h has the C++ type (std::string) information in it.
This causes a compile error when the C lexer (Lexer.c) is being
compiled. Is there a standard work around for this? I don't see any
obvious way to make Lexer.l turn into Lexer.cxx using automake.
Anyone know how?
Thanks,
Bob Rossi
Re: How to use C++ types in '%union declaration', Hans Aberg, 2007/02/24