Extending gcjx visitor pattern

Mike Emmel mike.emmel@gmail.com
Tue Dec 6 12:43:00 GMT 2005


On 12/6/05, Ranjit Mathew <rmathew@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mike Emmel wrote:
> > I was wondering what people would think about extending the gcjx
> > visitor to also forward
> > user data.
> >
> > I.e visit_method (model_method * method,
> >                 const list<ref_variable_decl> & params,
> >                 const ref_block &block)
> >
> > would becomes
> >
> > visit_method (model_method * method,
> >                 const list<ref_variable_decl> & params,
> >                 const ref_block &block, void * visitorData );
>
> If I understand you correctly, you want the Visitor to
> say:
>
>   someObject->visit (this, opaqueBlob);
>
> and then the visited object (Visitee?) to call back
> the appropriate visit_snafu() method like:
>
>   visitorObject->visit_snafu (this, foo, bar, opaqueBlob);
>
> Right?
>
>
> > On a similar note it would also be nice to annotate the gcjx tree with
> > some of my data. There is the aot class but it so far does not seem to
> > be the right answer.
>
> Note that you would then need to worry about different
> Visitors clashing over what to put/expect in these
> per-node annotations.
>
> Wouldn't it be simpler to maintain a map of node->nodeData
> as you walk the model tree and then use this in
> your visit_snafu() methods?
>
> Thanks,
> Ranjit.
>

Well right now there instance variables of the visitor so I only need a map for
global data there is the aot_class support but I think it needs to be
changed some
not sure how yet. For the mapping it would probably be nice to have a
bit more support
for a global database. Agian its way to early for me to know what
exactly this needs to be.

> - --
> Ranjit Mathew      Email: rmathew AT gmail DOT com
>
> Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFDlWqmYb1hx2wRS48RAjniAKCAKq5QGW/IcnHXsI4zMG58D1w3qACfS7L5
> O+vU/0qXdDiTS+EKS0PzOyU=
> =MFqN
> -----END PGP SIGNATURE-----
>



More information about the Java mailing list