[cfe-dev] Source code documentation

Douglas Gregor dgregor at apple.com
Tue Mar 9 13:17:49 PST 2010


On Mar 9, 2010, at 12:20 PM, Stefan Seefeld wrote:

> 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 ?

Yes and yes!

>>> 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).


That makes sense. Comment parsing will all be done within Synopsis, I assume?

	- Doug



More information about the cfe-dev mailing list