[cfe-dev] Source code documentation

Stefan Seefeld stefan.seefeld at gmail.com
Tue Mar 9 09:20:05 PST 2010


On 03/09/2010 12:03 PM, Douglas Gregor wrote:
> On Mar 9, 2010, at 8:56 AM, Stefan Seefeld wrote:
>
>    
>> Hello,
>>
>> I have been watching the CLang project for a while, as I'm interested in
>> using it for my own project. I'm developing Synopsis
>> (http://synopsis.fresco.org), which started as a multi-language code
>> documentation tool, but became actually quite a bit more powerful.
>>
>> Synopsis is a very modular tool, written in Python, which loads
>> different parsers (Python, IDL, C, C++) to generate an internal
>> representation (parse tree, semantic graph, etc.), which then is further
>> transformed or processed, such as into API documentation, or even new
>> source code.
>>
>> I'd be very interested in using CLang as parser backend for C and C++,
>> and possibly even more for AST transformations (such as code generation).
>>      
> That would be *great*.
>    

Glad to hear that you agree. :-)

Does LLVM participate in GSoC this year ? If so, could we formulate a 
project that helps with this (quite substantial) work ?


>> I read on http://clang.llvm.org/OpenProjects.html that there are plans
>> to write a code documentation tool based on CLang, so I'd like to know
>> whether any such work has already started, so as to avoid duplicating
>> effort.
>>      
> No, there hasn't been any work in this area. It's a long-standing wish.
>    

OK.


>> Also, would anybody be interested in bindings between Synopsis and
>> CLang, even to the point of - gasp - helping ? :-)
>>      
>
> You should check out the Python bindings we have for the "CIndex" library. They'll obviously need extensions to capture enough of the AST for C++, but that's in the grand plan anyway: to provide a stable interface to explore (but not transform or modify) Clang's AST. If a documentation tool like Synopsis can't use the CIndex library for some reason, CIndex should be extended.
>    

OK, I will have a look. Given that Synopsis has its own representation 
(an ASG), I think a first step would be to translate the CIndex-based 
representation produced by CLang into ASG, so as not to disrupt too much 
at once.
Then we can look into the two representations to see whether a copy / 
translation can be avoided without breaking other features (such as 
Synopsis' support for other languages).

Thanks,
         Stefan

-- 

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




More information about the cfe-dev mailing list