help-bison
[Top][All Lists]
Advanced

[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 20:02:01 -0500
User-agent: Mutt/1.5.12-2006-07-14

On Mon, Feb 26, 2007 at 12:19:18AM +0100, Hans Aberg wrote:
> On 25 Feb 2007, at 19:47, Bob Rossi wrote:
> >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?
> 
> Does file OutGrammar.h have '#include <string>' in it?

No, it does not. OutGrammar.h is generated from the %union in the
OutGrammar.y file. I figured out that if I changed the lexer file from
Lexer.l to Lexer.ll that it generates Lexer.cc instead of Lexer.c.

This solves my problem.

Thanks for your help,
Bob Rossi




reply via email to

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