comp.lang.ada
 help / color / mirror / Atom feed
From: "cl1" <cwlambert76@yahoo.com>
Subject: Re: issue with implementing a visitor design pattern
Date: Sat, 17 Jan 2004 17:05:24 -0600
Date: 2004-01-17T17:05:24-06:00	[thread overview]
Message-ID: <100jg918ftt427e@corp.supernews.com> (raw)
In-Reply-To: OdKdnWfUk9xjM5XdRVn-gg@comcast.com

after having read all the info given here in the newsgroup on this. I
definately open to implementing it with the generics, but
i would like to have it working with the set up i have now. I have written
lots of notes on what i have done so far and getting
it to work in the format i have now would better help me explain why i
changed when i post my writtings to the internet.

here is a link to some example source:
http://www.geocities.com/cwlambert76/preorder_visitor.adb.txt
it contains example code of both packages i have written so far.

what i have so far is a parse tree, along with an Accept_Visitor() operation
for each node. and an abstract
Visitor in my parse_tree_pkg with a Visit() operation for each node. i want
to implement the different types of tree traversal
only once(preorder, inorder, etc.) that is why i have created the
preorder_visitor_pkg. and any visitor that needs to "visit" the
parse tree can pick its traversal method by subclassing the appropriate
visitor package and overiding the Visit_Operation for
each node, and in turn not have to implement the actual traversal itself.
Now i know this may not be the best way to implement
this, at this point the only way to catch that a Visit_Operation() isn't
implemented is at runtime (not good). However this has
been a great learning process for me, and i would like to be able to share
my learning experiances with everyone. So once i
have this working then I will be more than happy to refactor my code to a
higher quality version, and i would greatly
appreciate all of your help in doing so.

Thanks,
Charles Lambert





      parent reply	other threads:[~2004-01-17 23:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-15 19:22 issue with implementing a visitor design pattern cl1
2004-01-17  3:41 ` Robert I. Eachus
2004-01-17 21:24   ` Robert A Duff
2004-01-24 20:38     ` Dale Stanbrough
2004-01-24 21:44       ` Robert A Duff
2004-01-26  8:34         ` Dmitry A. Kazakov
2004-01-26 20:18           ` Robert A Duff
2004-01-27  8:36             ` Dmitry A. Kazakov
2004-02-01  0:32               ` Georg Bauhaus
2004-01-17 23:05   ` cl1 [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox