[cfe-commits] [PATCH] Lexer for structured comments
Dmitri Gribenko
gribozavr at gmail.com
Fri Jun 22 15:01:08 PDT 2012
On Fri, Jun 22, 2012 at 11:21 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> Hello,
>
> The attached patch implements a lexer for structured comments. Highlights:
>
> * The lexer is Doxygen-oriented. I know that we should be loose in
> what we accept in comments, but I mainly focused on Doxygen
> constructs.
>
> * Embedded HTML lexer produces very "fat" tokens, e.g., "<tag>" or
> 'attr="value"' are single tokens. This can be changed later to more
> fine-grained tokens if needed.
>
> * Markdown and automatic link generation (to function declarations)
> are not supported. I think that these should be added at parser level
> with regexps.
>
> Please review.
Here's an updated patch that includes a simple parser. BriefParser
extracts the \brief paragraph if it can find it. Otherwise it returns
the first paragraph.
There is also a new libclang API to do that:
CXString clang_Cursor_getBriefCommentText(CXCursor C);
Relevant modifications also done to c-index-test so that this feature
is testable (tests also added).
Please review.
Dmitri
--
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 <gribozavr at gmail.com>*/
More information about the cfe-commits
mailing list