Re: using yacc union in managed c++
- From: Chris Dodd <cdodd@xxxxxxx>
- Date: 13 Apr 2007 01:35:14 -0400
"ras" <rastrahm@xxxxxxxxx> wrote in news:07-04-032@xxxxxxxxxxxxxx:
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
pointer type).
Chris Dodd
cdodd@xxxxxxx
.
- References:
- using yacc union in managed c++
- From: ras
- using yacc union in managed c++
- Prev by Date: Re: Free x86 C compiler wanted
- Next by Date: Re: using yacc union in managed c++
- Previous by thread: using yacc union in managed c++
- Next by thread: Re: using yacc union in managed c++
- Index(es):
Relevant Pages
|
|