Re: treecc help required

James Michael DuPont <mdupont777-/[email protected]> Thu, 30 Dec 2004 01:21:02 -0800 (PST)
Newsgroups gmane.comp.gnu.dotgnu.developer
Message-ID <[email protected]>
Hi,

I have tried your code,
Looking at the Inst.h generated,
found 
#define SetNext(this__,next) \
	((*(((struct
            Instruction_vtable__*)((this__)->vtable__))->SetNext_v__))
\
		((Instruction *)(this__), (next)))

You can just add a typecast to that  :
#define SetNext(this__,next) \
	((*(((struct Instruction_vtable__
*)((this__)->vtable__))->SetNext_v__)) \
		((Instruction *)(this__), (Instruction *)(next

that can be added to the treecc generator, but am too lazy to do that.
then you can write :
	//	next = (Instruction*)bbegin;	
	next = SetNext(next,bbegin);


--- Gomi Kapoor <gomikapoor-/[email protected]> wrote:
>  One major issue which I faced coming with this
>  simple  implementation is casting between 
>  Instruction* and other derived nodes. 
>  I found that casting  between them to be very
> tedious.
>  I feel that I am  doing a basic mistake in using 
>  treecc. Would you  mind commenting on the way I have 
>  (mis)used in the attached  simple implementation.


=====
James Michael DuPont
http://introspector.sourceforge.net/


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250