Extending gcjx visitor pattern

Mike Emmel mike.emmel@gmail.com
Sun Dec 4 14:09:00 GMT 2005


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 );

Not sure if void * is right but  if the visitor can pass some current
data through on the stack it makes the code cleaner and gets rid of a
lot of local state that needs to be allocated on the heap and tracked.

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.

Mike



More information about the Java mailing list