|using yacc union in managed c++ email@example.com (ras) (2007-04-11)|
|Re: using yacc union in managed c++ firstname.lastname@example.org (Chris Dodd) (2007-04-13)|
|Re: using yacc union in managed c++ email@example.com (George Neuner) (2007-04-13)|
|From:||Chris Dodd <firstname.lastname@example.org>|
|Date:||13 Apr 2007 01:35:14 -0400|
|Posted-Date:||13 Apr 2007 01:35:14 EDT|
"ras" <email@example.com> wrote in news:firstname.lastname@example.org:
> Is there a way to implement the union in a managed c++ yacc parser?
> visual studio compiler complains about the union, so for strings i
> created an array and returned the index of the string via yylval. but
> i need to return operators, floating point numbers, etc. and this
> seems klutzy. got any better ideas?
There are basically two choices -- you either ensure that the union is
a valid POD type (all the fields are types that don't have constructors or
destructors), or you can not use the %union directive at all and instead
#define YYSTYPE to be some non-union type (usually some kind of smart
Return to the
Search the comp.compilers archives again.