This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Extending gcjx visitor pattern


>>>>> "Mike" == Mike Emmel <mike.emmel@gmail.com> writes:

Mike> I was wondering what people would think about extending the gcjx
Mike> visitor to also forward user data.

Mike> visit_method (model_method * method,
Mike>                 const list<ref_variable_decl> & params,
Mike>                 const ref_block &block, void * visitorData );

The reason I didn't do this is type safety.  I didn't want to add
casts all over to handle the user data.

Mike> On a similar note it would also be nice to annotate the gcjx tree with
Mike> some of my data. There is the aot class but it so far does not seem to
Mike> be the right answer.

I just use a std::map or the like for this kind of thing.  It is less
handy in some ways but has other advantages -- it is type safe and it
lets each back end maintain its own state.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]