<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 2:38 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Sep 12, 2013 at 11:17 PM, Sean Silva <<a href="mailto:silvas@purdue.edu">silvas@purdue.edu</a>> wrote:<br>

><br>
><br>
><br>
> On Thu, Sep 12, 2013 at 1:27 AM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>><br>
> wrote:<br>
</div><div class="im">>> Quite a few other developers have asked the same question (if Clang<br>
>> can attach comments to statements) during past year, but eventually<br>
>> did not send patches.  Nevertheless, this shows that community is<br>
>> interested in such functionality.<br>
>><br>
>> I would not call this hard to implement, but this is not a trivial<br>
>> change either: you will need to learn at least about Clang's AST,<br>
>> source location model (and how it interacts with the macros), lexer<br>
>> and parser architecture.  In addition to implementing the feature, you<br>
>> will also need to design a way to test these APIs *in clang tree*<br>
>> (without your tool) and write the tests.<br>
>><br>
><br>
> I don't think that adding maintenance burden to clang for each new<br>
> documentation format is sustainable anyway. Best to take advantage of<br>
> modular/library-based design and keep these kinds of tools out of tree.<br>
<br>
</div>Hi Sean,<br>
<br>
I was not suggesting to add this specific parsing code to Clang --<br>
this is something that should be built in a tool that uses Clang as a<br>
library.  I was talking about attaching raw comments to Stmts as a<br>
low-level building block to enable Stmt comment parsing, for any<br>
syntax used in the comment.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Ah, ok. Nevermind then.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">
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">gribozavr@gmail.com</a>>*/<br>
</div></div></blockquote></div><br></div></div>