[cfe-dev] Source code documentation

Douglas Gregor dgregor at apple.com
Tue Mar 9 09:03:10 PST 2010


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

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

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

	- Doug





More information about the cfe-dev mailing list