1 message in net.java.dev.jna.users[jna-users] Re: Java Structure code g...
FromSent OnAttachments
Dan RolloSep 10, 2008 9:04 pm 
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:[jna-users] Re: Java Structure code generator from C++ .h files Actions...
From:Dan Rollo (bh@att.net)
Date:Sep 10, 2008 9:04:39 pm
List:net.java.dev.jna.users

Another grammar compiler option would be javacc (and jjtree): https://javacc.dev.java.net

And there's also a C and C++ grammar in the grammar repo: https://javacc.dev.java.net/servlets/ProjectDocumentList?folderID=110

Dan

<snip> ....You can then use ANTLR (http://www.antlr.org/)to parse this file. There will
be a grammar somewhere for c++. Thenfrom the tree that ANTLR gives you back, you
can generate the JNAmappings. You'll notice in the preprocessor output that
there are #comments which start each block of functions, structs or
typedefs.You'll need to map these to the relevant libraries.

I only looked at C as I've looked into this a while back. Decidedthat it was too
much work. C++ would be even harder as you'd then haveClass prototypes to deal
with, not to mention generics... urgh! I wouldsuggest getting a C one working
first, mainly because the JNA communitywould love you, but also because it'll be
easier and less frustratingfor you. </snip>