Hello,

I'm working on getting clang parse Doxygen comments and expose them in
AST, via libclang APIs etc.

The first step is to save comments during parsing.  Most of this work
was already done by Doug Gregor, [1] but it was reverted because it
was not used. [2]  I modified this patch so that it applies to ToT.

The patch exposes raw comment text via libclang so that the feature
can be tested with c-index-test.

Other modifications include:
* Introduced LangOpt.ParseComments.  As we don't want to regress on
parsing time or increase memory footprint during normal compilation,
comments are only saved when this option is enabled.  I made this
option a LANGOPT, but maybe it should be a BENIGN_LANGOPT?

* Reworked AST serialization/deserialization because approach to that
has changed since [1] was written.

* Renamed Preprocessor::{Add,Remove}CommentHandler to match coding standards.

* Added lots of tests.

[1] 
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090629/018718.html
[2] 
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100315/028560.html

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/

Attachment: retain-comments-in-ast-v1.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to