-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use go-generate to generate most of the go-clang code #15
Comments
So I hacked something small together https://github.com/zimmski/go-clang-phoenix I just did the basics and added generation for enums with "Kind" in their name. Example As you can see I used "Type_" instead of "TK_" as prefix. Which is in my opinion more intuitive. I am just asking if you are OK with this? Since a rewrite can be seen as completely new version. Also I will occasionally work on this rewrite over the next weeks, I cannot focus completely on it since I need to work on other things too. I would be glad if you can give me some feedback. |
that's a really great start! the |
I put that in as a TODO. A friend of mine will support me with this work so I hope we will get this done in one or two hacking sessions. Btw. generating the code makes it also possible to adapt the comments for Go see https://godoc.org/github.com/zimmski/go-clang-phoenix |
@sbinet: We are in the process of finishing the rewrite. Please take a look https://github.com/zimmski/go-clang-phoenix There are some small API problems left but nothing frightening. Most of the open issues are refactoring the code and transforming it into a generic solution. Another issue left is writing how to test and release new versions. I will demonstrate using the rewrite repository. |
sounds good. perhaps it would make sense to create a
ideally, the result could just be (re-)generated via what do you think? (names are all tentative) |
I think it makes sense to create a new organization but naming the repositories could be tricky. Right now there are some heuristics to figure out how to generate the API and some manually written functions and types. I do not think that this will go away and it can vary between Clang versions. The current plan is to refactor everything so that we can have a "go-clang-generate" main function with just the version specific heuristics. Everything else is in a general package (to convert C APIs to Go) and in a Clang specific package (general heuristics for Clang). Also, I do not think that |
ok. let's close this issue and move the discussion over at go-clang/design#1 |
it should be possible to use
go-clang
(orpython-cindex
) to generate most of the go-clang code, starting from a parsed representation of a givenCIndex
API version.This would tremendously reduce the maintenance load of keeping up with the LLVM/CIndex API churn.
Ideally, just running
go generate
ingo-clang
repository would generate the whole set of stubs (and possibly the complete bindings?) for eachCIndex
version.The text was updated successfully, but these errors were encountered: