<div dir="ltr"><div>Respected, <br></div>> Current comment parsing can only pick up comments that:<br>
> 1. immediately precede a declaration<br>
> 2. have special starting sequence: /// for line comments and /** ...<br>
> */ for block comments.<br>
<br>
> (2) is easy to correct<div><div class="gmail_extra">can you tell me how it can be done and also does writing the function ASTContext::getCommentForDecl(<div id=":6z">) in the our parser will retrieve the comment or something else is also to be done.<br>
</div><div id=":6z">Thanking you<br></div><div id=":6z">-- surbhi<br></div><br><br><br></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 2, 2013 at 11:40 AM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Aug 1, 2013 at 10:59 PM, Arpit Sancheti<br>
<<a href="mailto:arpit.sancheti2002@gmail.com" target="_blank">arpit.sancheti2002@gmail.com</a>> wrote:<br>
> Sir, what I want to ask you is how to approach to this problem. What did you<br>
> do to parse comments and generate AST with them?<br>
<br>
Current comment parsing can only pick up comments that:<br>
1. immediately precede a declaration<br>
2. have special starting sequence: /// for line comments and /** ...<br>
*/ for block comments.<br>
<br>
(2) is easy to correct, but (1) is an architectural limitation.<br>
Documentation comments can only be attached to a declaration.  You<br>
also need to attach comments to statements.  You will need to<br>
implement this yourself.  See the ASTContext::getCommentForDecl() API.<br>
<br>
After you get the "raw" (unparsed) comment you need to parse it.  Just<br>
write a normal recursive-descent parser for comment contents.<br>
Documentation comment parsing is very Doxygen-specific, it handles<br>
Doxygen escape sequences and so on -- I think it is easier to write a<br>
parser for ASCL from scratch than to repurpose the documenation<br>
parser.<br>
<br>
> It would be very kind of you if you will reply to this asap.<br>
<br>
Please send further questions to cfe-dev so that the community can<br>
benefit from the answers.<br>
<span><font color="#888888"><br>
Dmitri<br>
<br>
--<br>
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>>*/<br>
</font></span></blockquote></div><br></div></div></div>