[cfe-commits] [PATCH] Lexer for structured comments

Dmitri Gribenko gribozavr at gmail.com
Fri Jun 22 15:19:11 PDT 2012


On Fri, Jun 22, 2012 at 3:01 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 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.

Now with a patch.

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>*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: comments-lexer-v2.patch
Type: application/octet-stream
Size: 71432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120622/6d355ec1/attachment.obj>


More information about the cfe-commits mailing list