[cfe-dev] using python clang.cindex library to generate bindings ?

Stefan Seefeld seefeld at sympatico.ca
Mon May 3 10:45:47 PDT 2010


On 05/01/2010 04:05 AM, Sebastien Binet wrote:
> hi there,
>
> I just noticed that llvm/clang-2.7 provides a ctypes-based library
> wrapping libCIndex.so for python.
> Is it possible, planned or adviseable to use such a thing to
> programatically generate a representation (say in json/xml) of some
> C/C++ api so it could be then used to automatically generate bindings
> in other high-level languages ?
>    

I have been looking for such a thing myself. Working on Synopsis 
(http://synopsis.fresco.org), I'm interested into CLang to generate / 
populate Synopsis' abstract semantic graph (ASG) for the parsed code, 
which I then could manipulate further using Synopsis scripts (for 
example to generate API documentation).

It seems the CIndex API is by far not rich enough for my needs, and I'm 
not sure whether that will change. I'm now looking into CLang's own AST 
et al. APIs instead, even though that's said to be much less stable than 
CIndex.

FWIW,
         Stefan

-- 

       ...ich hab' noch einen Koffer in Berlin...




More information about the cfe-dev mailing list