[cfe-dev] A documentation tool based on clang AST.
Sean Silva
silvas at purdue.edu
Fri Sep 13 23:12:29 PDT 2013
On Fri, Sep 13, 2013 at 2:38 AM, Dmitri Gribenko <gribozavr at gmail.com>wrote:
> On Thu, Sep 12, 2013 at 11:17 PM, Sean Silva <silvas at purdue.edu> wrote:
> >
> >
> >
> > On Thu, Sep 12, 2013 at 1:27 AM, Dmitri Gribenko <gribozavr at gmail.com>
> > wrote:
> >> 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,
>
> I was not suggesting to add this specific parsing code to Clang --
> this is something that should be built in a tool that uses Clang as a
> library. I was talking about attaching raw comments to Stmts as a
> low-level building block to enable Stmt comment parsing, for any
> syntax used in the comment.
>
>
Ah, ok. Nevermind then.
-- Sean Silva
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130914/ea62643f/attachment.html>
More information about the cfe-dev
mailing list