Hi folks,
Over the past few months I've been working on that famous missing interface
generator for JNA.
It started with a small and dirty hack with regexes, and became a huge and
dirty hack powered by a ANTLR parser and by the Anarres Java C
PreProcessor<http://www.anarres.org/projects/jcpp/>
(JCPP).
JNAerator (hehe) is still very buggy and has many limitations but I think it
might already be useful to JNA users who need to generate large interfaces
(it knows about defines, enums, constants, structs, callbacks, converts
comments to javadocs, has experimental expressions translation...).
I've written a first post on my blog about it :
http://ochafik.free.fr/blog/?p=121
and created a project on Google Code : http://jnaerator.googlecode.com/
I'd be interested in getting feedback on what should be the default
generated mappings (right now I'm doing a bit like gluegen : each function
that has primitive-friendly arguments gets two methods : one with
*ByReference objects and the other with primitive arrays or strings).
I'd also need to know more about the preprocessor symbols that are set by
the compilers for all of the platforms & architectures supported by JNA, as
I only have access to two compilers (Visual Studio Express C++ 2008 &
Apple's GCC 4.0, on x86_64), and it would also be great if I could get the
possible default paths of system includes on all of these platforms... (the
goal is to set things up as simply as possible, but users may still define
their include paths and preprocessor symbols by hand).
Finally, I'm still in search for anything that makes C/Objective-C parser
explode, even though it already has many known limitations (such as function
signatures of functions that return functions, amongst other niceties).
Looking forward to reading from you !
Best Regards