8 messages in net.java.dev.jna.usersRe: [jna-users] JNAerator : parses C ...
FromSent OnAttachments
Olivier ChafikFeb 15, 2009 11:51 pm 
Nikolas LotzFeb 16, 2009 2:31 am 
Olivier ChafikFeb 16, 2009 11:18 am 
Stefan EndrullisFeb 17, 2009 1:47 am 
Paul LoyFeb 17, 2009 1:54 am 
Stefan EndrullisFeb 17, 2009 2:30 am 
Timothy WallFeb 17, 2009 4:40 am 
Olivier ChafikFeb 23, 2009 5:13 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] JNAerator : parses C (and Objective-C) and outputs JNA (and Rococoa) interfacesActions...
From:Stefan Endrullis (ste@endrullis.de)
Date:Feb 17, 2009 2:30:10 am
List:net.java.dev.jna.users

Paul Loy schrieb:

Hi Oliver,

this is something I had toyed with doing myself in the past. As Stefan says, people (and I count myself as one) would be interested in improving it.

I like your approach to it. When I was looking into doing it I was going to preprocess and then using ANTLR to parse it! Although mine would have been a bigger hack as I was going to run gcc on a Process to perform the preprocessing. The Anarres C PreProcessor looks like a much more elegant way to do this!

Sounds interesting. I didn't know that there is already a C preprocessors written in Java. That's really something to consider! Then you would able to evaluate #if statements, resolve type definitions with respect to included files, etc. IMO, it sounds like a perfect solution.

Thanks for the tip, Paul!

Regards, Stefan

I've been looking at wrapping GTK in Java using JNA for quite some time. I think I'll fire up my mac and see how this baby does on that!

Thanks,

Paul.

On Tue, Feb 17, 2009 at 9:47 AM, Stefan Endrullis <ste@endrullis.de <mailto:ste@endrullis.de>> wrote:

Hi Olivier,

thanks for creating JNAerator. Now that there is an open source platform for this kind of tools I hope more and more people, who also want to map large C libraries, will join and improve the project.

I would suggest to link the project on the JNA website, even if it's an alpha version, but many people could be interested in it and are willing to improve it instead of writing their own perl or sed scripts. :)

Regards, Stefan

Olivier Chafik schrieb: > 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 > -- > Olivier > http://ochafik.free.fr/

--------------------------------------------------------------------- To unsubscribe, e-mail: user@jna.dev.java.net <mailto:user@jna.dev.java.net> For additional commands, e-mail: user@jna.dev.java.net <mailto:user@jna.dev.java.net>

--------------------------------------------- Paul Loy pa@keteracel.com <mailto:pa@keteracel.com> http://www.keteracel.com/paul