<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 12, 2013 at 1:27 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 Wed, Sep 11, 2013 at 3:51 AM, Juan Jose Lopez Villarejo<br>
<<a href="mailto:jj.lopezvillarejo@cern.ch">jj.lopezvillarejo@cern.ch</a>> wrote:<br>
> Hello, and thanks for the reply, Dimitri.<br>
><br>
> You give me half of a solution: as you point out, we would need to attach comments to statements.<br>
><br>
> Is there any developper that would be willing to do such an extension as you propose:<br>
> ASTContext::getRawCommentForStmtNoCache()<br>
> getCommentForStmt()<br>
><br>
> Alternatively, how feasible you see that we could implement such an extension (novel to clang, physicist) and that it be maintained?!<br>
<br>
</div>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>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>I don't think that adding maintenance burden to clang for each new documentation format is sustainable anyway. Best to take advantage of modular/library-based design and keep these kinds of tools out of tree.</div>
<div><br></div><div>-- Sean Silva </div></div></div></div>