[cfe-dev] A documentation tool based on clang AST.

Sean Silva silvas at purdue.edu
Fri Sep 13 23:13:13 PDT 2013


On Fri, Sep 13, 2013 at 2:46 AM, David Röthlisberger <david at rothlis.net>wrote:

> On 13 Sep 2013, at 07:17, Sean Silva wrote:
> >
> > On Thu, Sep 12, 2013 at 1:27 AM, Dmitri Gribenko <gribozavr at gmail.com>
> wrote:
> >> On Wed, Sep 11, 2013 at 3:51 AM, Juan Jose Lopez Villarejo <
> jj.lopezvillarejo at cern.ch> wrote:
> >> > Hello, and thanks for the reply, Dimitri.
> >> >
> >> > You give me half of a solution: as you point out, we would need to
> attach comments to statements.
> >> >
> >> > Is there any developper that would be willing to do such an extension
> as you propose:
> >> > ASTContext::getRawCommentForStmtNoCache()
> >> > getCommentForStmt()
> >> >
> >> > Alternatively, how feasible you see that we could implement such an
> extension (novel to clang, physicist) and that it be maintained?!
> >>
> >> Quite a few other developers have asked the same question (if Clang
> >> can attach comments to statements) during past year, but eventually
> >> did not send patches.  Nevertheless, this shows that community is
> >> interested in such functionality.
> >>
> >> I would not call this hard to implement, but this is not a trivial
> >> change either: you will need to learn at least about Clang's AST,
> >> source location model (and how it interacts with the macros), lexer
> >> and parser architecture.  In addition to implementing the feature, you
> >> will also need to design a way to test these APIs *in clang tree*
> >> (without your tool) and write the tests.
> >
> > 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.
>
> Hi Sean
>
> Could you please clarify what you mean? I don't think anyone is
> proposing to put Juan Jose's tool in-tree. The proposal is to add a
> mechanism for retrieving comments immediately preceding a statement --
> would that be something you'd accept in-tree?
>
>
See my response to Dmitri.

-- Sean Silva


> Thanks,
> Dave.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130914/52902832/attachment.html>


More information about the cfe-dev mailing list