On 4 January 2018 at 09:50, Etienne Robillard <tkad...@yandex.com> wrote: > Hi, > > I will be creating a repository for this: > https://bitbucket.org/tkadm30/cffi-libclang > > The goal is to generate a AST object from a C header by preprocessing with > clang -E then compile the python bindings with CFFI... > > ffi.cdef(open('uwsgi.h').read()) # <-- XXX need to modify internal parsing > code to use clang.cindex! > > ffi.dlopen('/usr/local/lib/libuwsgi.so') > > > Right now the parsing of the C source file is done by pycparser, but i would > like to use the clang.cindex module. > > What do you think?
Presumably that will introduce a dependency on some clang module? You mention clang.cindex - but the only clang package I can find on PyPI says "OBSOLETE. LLVM-CLANG NOW PUBLISHES PYTHON PACKAGE. JUST ADD THE OFFICIAL llvm-3.7 repo in your apt." but doesn't provide binaries or explain how to install clang on, say, Windows (to pick an example relevant to me :-)). As a fork/extension for cffi, I have no particular opinion (I'm unlikely to ever use it). But the advantage of pycparser is that it's cross-platform and pure Python, so I doubt this will be acceptable for inclusion into CFFI itself. Paul -- https://mail.python.org/mailman/listinfo/python-list