help-bison
[Top][All Lists]
Advanced

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

RE: bison %union and C++


From: Hart, Justin
Subject: RE: bison %union and C++
Date: Tue, 24 Sep 2002 09:44:52 -0400

Quick and dirty way...

Use pointers, they don't need to be initialized so they are legal for union.

Slightly different way...

Don't use %union to declare yystype.  Declare it as a class.  Then classes
are legal.

Justin Hart

-----Original Message-----
From: Oleg Smolsky [mailto:address@hidden
Sent: Monday, September 23, 2002 8:15 PM
To: address@hidden
Subject: bison %union and C++


Hello there,

here is a question that is probably asked for a millionth time....
But, I have done a lot of googling - honestly :)

Anyway, with bison 1.49b and C++ skeleton, how do I include a C++
class into the bison's types? In theory, I would like to add
std::string into the %union section, but this is prohibited by ANSI
C++.

So, is there any way to get bison to store one of my objects on its
stack?

Thanks in advance,
Oleg Smolsky



_______________________________________________
address@hidden http://mail.gnu.org/mailman/listinfo/help-bison




reply via email to

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