This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Extending gcjx visitor pattern
- From: Mike Emmel <mike dot emmel at gmail dot com>
- To: java at gcc dot gnu dot org
- Date: Sun, 4 Dec 2005 08:09:30 -0600
- Subject: Extending gcjx visitor pattern
- References: <3e9035250512040558t44c30074x4f6122b5c06b1e89@mail.gmail.com>
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