[cfe-dev] Adding more HTML-related facilities in Doxygen comment parsing

Dmitri Gribenko gribozavr at gmail.com
Mon Apr 28 08:23:32 PDT 2014


On Mon, Apr 28, 2014 at 4:11 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Mon, Apr 28, 2014 at 10:14 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> Parsing Doxygen is inherently intertwined with HTML parsing and
>> semantic analysis.  Doing filtering at the same level does not look
>> out of scope and mislayered.
>
> There are no 3rd party libraries or tools which already do this which
> we could then rely on? If not, where do you see this code living
> within the overall structure of the compiler? Will it continue to be a
> part of clangAST like the other comment-related code?

Hi Aaron,

As I explained in the first message in this thread, libtidy would
technically work, except: (1) it was never updated for HTML5, and does
not have formal releases, it is probably also unmaintained, and (2)
constructing an HTML DOM just to check the tag name is a superfluous
exercise in using a library just for the sake of using a library and
it will not deliver good performance either.  Apart from libtidy, I am
not aware of other libraries with suitable functionality and licence.

The HTML tables and helpers can be factored out somewhere into
clangBasic, clangHTML or even llvmSupport or llvmHTML -- this is a
bikesched that I mostly don't care about.  But Doxygen-specific
semantic analysis of HTML, as illustrated in the first post, has to
live in the same library as comment parsing.

About comment parsing living in libAST -- it is possible to move it to
a separate library, but we would have to bounce off an abstract base
class to untie the circular dependency between ASTContext and that
libClangComment.  Because currently comment parsing is living in
completely separate files in libAST, which are clearly named as such,
I don't think that comment parsing is a burden for Clang developers
working on libAST.

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>*/



More information about the cfe-dev mailing list