From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4687ad82921cf6ad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-17 15:11:31 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "cl1" Newsgroups: comp.lang.ada Subject: Re: issue with implementing a visitor design pattern Date: Sat, 17 Jan 2004 17:05:24 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <100jg918ftt427e@corp.supernews.com> References: <100dqeul3pqiua0@corp.supernews.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:4509 Date: 2004-01-17T17:05:24-06:00 List-Id: 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