4 ms·
This is neat. I used Eli Bendersky's pycparser a few years back to create a static analysis suite for C. Does your project support C99?
by mvanveen 15y ago
This is neat. I used Eli Bendersky's pycparser a few years back to create a static analysis suite for C. Does your project support C99?
- albertzeyer 15y agoWhat parts of C99? It is quite incomplete. But on the other side a bit loosely on the grammar, so it might work. I wasn't able yet to interpret any bigger projects. One goal was to interpret CPython (https://github.com/albertz/PyCPython https://github.com/albertz/PyCPython) and I got pretty far but I lost interest in it a bit (I remember that I got stuck when interpreting `goto` because there was no easy equivalent in Python, but I found a solution recently: https://github.com/albertz/playground/blob/master/py_goto.py https://github.com/albertz/playground/blob/master/py_goto.py). I successfully used this however to create ctypes interfaces for header files on the fly. E.g. https://github.com/albertz/PySDL https://github.com/albertz/PySDL uses it. And for doing some analytics, it might also work good enough.