help-bison
[Top][All Lists]
Advanced

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

Re: Union Type Object problem


From: Laurence Finston
Subject: Re: Union Type Object problem
Date: Sat, 07 Aug 2004 22:05:47 +0200
User-agent: IMHO/0.98.3+G (Webmail for Roxen)

I haven't had a chance to test this, but nothing else leapt out at me as a
probable cause for the error.

> >   You could just use `void*' and cast the pointers to
> >`Expression*' in the rules.  That's what I do.
> 
> I think that one might loose polymorphy that way, or only preserve it in a
> non-C++ standard way (it might not run on some C++ compilers).
> 

If I cast a pointer to void to a base type with virtual functions, and the
object pointed to is a derived type, a call to a member function on the object
 will resolve correctly.    I don't see how this loses polymorphism, nor how
it could fail to compile.

I don't see anything wrong with your solution either, beyond what you mention
yourself.  If the data members in the class were large, I might use pointers. 
I doubt that a semantic type containing five or six pointers would cause
problems on typical systems today.

Laurence



reply via email to

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