[cfe-dev] Regarding parsing of comment in Clang

Arpit Sancheti arpit.sancheti2002 at gmail.com
Fri Aug 2 12:04:17 PDT 2013


Respected Sir/ Ma'am
Thanks for the information, but the question is still the same that how can
I retrieve the comments in my parser so that I can parse them.
clang::CommentOptions::ParseAllComments will start parsing all comments but
how can I get those comment in my parser. What are the function to retrieve
them or I just have include the header files in which these are define.
One more question is that ACSL have some more comment command, if I am not
wrong then those are to be first  defined in CommentCommandList.inc
Thanking You
--Surbhi


On Sat, Aug 3, 2013 at 12:02 AM, James Dennett <james.dennett at gmail.com>wrote:

> On Fri, Aug 2, 2013 at 8:58 AM, Dmitri Gribenko <gribozavr at gmail.com>
> wrote:
> > On Fri, Aug 2, 2013 at 4:58 AM, Arpit Sancheti
> > <arpit.sancheti2002 at gmail.com> wrote:
> >> Respected,
> >>> Current comment parsing can only pick up comments that:
> >>> 1. immediately precede a declaration
> >>> 2. have special starting sequence: /// for line comments and /** ...
> >>> */ for block comments.
> >>
> >>> (2) is easy to correct
> >> can you tell me how it can be done and also does writing the function
> >> ASTContext::getCommentForDecl(
> >> ) in the our parser will retrieve the comment or something else is also
> to
> >> be done.
> >
> > Look for calls to RawComment::isDocumentation().
>
> Or use the existing option to extract all comments.
> clang::CommentOptions::ParseAllComments is a good starting point for
> exploring that.
>
> -- James
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130803/6a3755dd/attachment.html>


More information about the cfe-dev mailing list