|Problem with Flex/Bison and C/C++ firstname.lastname@example.org (Christoph B.) (2006-03-22)|
|Re: Problem with Flex/Bison and C/C++ email@example.com (John Millaway) (2006-03-27)|
|Re: Problem with Flex/Bison and C/C++ cfc@shell01.TheWorld.com (Chris F Clark) (2006-03-27)|
|Re: Problem with Flex/Bison and C/C++ firstname.lastname@example.org (2006-03-27)|
|From:||email@example.com (Hans Aberg)|
|Date:||27 Mar 2006 01:27:40 -0500|
|Posted-Date:||27 Mar 2006 01:27:40 EST|
In article 06-03-077, "Christoph B."
> First, my YYSTYPE union looked like this:
> So my question is if there is a simple way to have all the tokens as
> strings and integers and have nonterminals with more complicated C++
> data types. Is there a way to define the data format for nonterminals
> outside from YYSTYPE?
One can do it, but not yet officially using Bison, though it is on the
agenda. Right now, using %union only admits C++ POD types (essentially C
legacy types), as the parser implementation uses C/C++ union. If you do
not use %union, you can define YYSTYPE to any C++ type, but there are some
problems with placing the C++ code. Therefore, I use a special Bison tweak
for that, hoping that eventually it should become a part of Bison. But if
you are programming conservatively, you may not need this, but you can
attempt to use Bison's official C++ skeleton file.
Return to the
Search the comp.compilers archives again.