Re: using yacc union in managed c++



"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

.



Relevant Pages

  • Re: CDO 1.2.1 Personal Distribution Lists
    ... it is union - I simply use it because I use strings as dynamic arrays. ... DL using OutlookSpy (click IMessage, select the prop, click the button next ... > Do the length chars come out in Big Endian or Little Endian arrangement? ...
    (microsoft.public.win32.programmer.messaging)
  • Re: A Logical Model for Lists as Relations
    ... initial algebra mumbo-jumbo, ... Lists are to strings as sets are to bunches. ... and intersections and union on sets rather than union on elements. ...
    (comp.databases.theory)
  • using yacc union in managed c++
    ... 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 ...
    (comp.compilers)
  • Re: Discussion about transformation TSP to UniqueTSP
    ... are there possible simillar strings in Q1 and Q2? ... The set of strings Q is *defined* as the union of Q1 and Q2. ... if first symbol eq '0' return answer for HCP ...
    (comp.theory)
  • Re: union of non-re sets
    ... I don't know much in this area, but I think the language ... Their union is the language ... except using finite strings instead of integers. ...
    (comp.theory)