5 ms·
Shameless plug (but possibly interesting), we do something similar (but using clang) to generate a coverage report for the gobject bindings for libgit2: https:/
by jessevdk 13y ago
Shameless plug (but possibly interesting), we do something similar (but using clang) to generate a coverage report for the gobject bindings for libgit2: https://git.gnome.org/browse/libgit2-glib/tree/tools/coverage.py https://git.gnome.org/browse/libgit2-glib/tree/tools/coverag...
- SloopJon 13y agoWow. Although I was vaguely aware that Clang is tool friendly, I had no idea about libclang, let alone its Python bindings. A search for "python clang module" turned up a mention of pycparser. Any idea how it compares? I guess its main advantage is that it's pure Python.
- jessevdk 13y agoI can't really compare, because I've personally never used pycparser. The nice thing about using libclang is that you're just using the same backend as the actual compiler and you can be sure that you're going to parse complex things correctly and reliably.
- deleted 13y ago[deleted]
- ihnorton 13y agoGreat introduction to libclang and cindex from Eli Bendersky: http://eli.thegreenplace.net/2011/07/03/parsing-c-in-python-.. http://eli.thegreenplace.net/2011/07/03/parsing-c-in-python-.... (another shameless plug: libclang bindings are also available for Julia)