[cfe-dev] Python bindings and status of clang-c API

Ted Kremenek kremenek at apple.com
Wed Jan 26 15:23:56 PST 2011

Hi Stuart,

Most of the CXCursor kinds have been demand added.  Feel free to flesh out additional ones as needed, and submit patches for review.


On Jan 26, 2011, at 12:32 PM, Stuart Carnie wrote:

> Hi all,
> I notice the cindex module is very outdated, so I decided to have a play last night and added a significant amount of the missing CursorKind statics as well as the start of exposing CXType.  In my experimentation, I've noticed is that there appears to be many missing CXCursorKind enums in the clang-c/Index.h header.  As an example, I declared a small function in a test file:
> void f0(int a0, int a1) {
> start_over:
>     f1();
> }
> There are 3 children of f0, kinds being CXCursor_ParmDecl, CXCursor_ParmDecl, CXCursor_UnexposedStatement.  I assume the 3rd node is the function body.  I don't think the python code is doing anything wrong when visiting the children.  I looked at MakeCSCursor(Stmt *S, ...) in CXCursor.cpp (libclang) and noticed that the function is are largely un-implemented.  I can walk down and find the CallExpr (f1();).
> Is this an area I could do some work in?  Having complete python bindings for the entire AST would be a great way to learn clang...
> Cheers,
> Stu
> Stuart Carnie, CTO
> manomio | in retro we trust!
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110126/3d2238bf/attachment.html>

More information about the cfe-dev mailing list