[cfe-dev] Range for CXFile

Milian Wolff mail at milianw.de
Sat Jan 10 12:32:46 PST 2015


On Saturday 10 January 2015 14:05:06 Jacob Carlborg wrote:
> On 2015-01-10 00:08, Milian Wolff wrote:
> > It won't work. Think about something like this:
> > 
> > // TODO: rewrite this file
> > 
> > /**
> > 
> >   * @file fubar
> >   */
> > 
> > /**
> > 
> >   * this does bar
> >   */
> > 
> > void bar();
> > 
> > if I understand the docs about the Documentation API correctly, I will
> > only
> > get access to the very last comment, as only stuff that "represents a
> > documentable entity" can be passed to clang_Cursor_getParsedComment. Or am
> > I missing something?
> 
> That might be correct, I didn't look so closely.
> 
> Your original question that your approach doesn't work for included
> files. If you visits all nodes in the tree shouldn't you eventually hit
> the nodes from the included files? In the tool I have that uses libclang
> I need to explicitly filter out nodes from included files.

Yes, for nodes/cursors that is true. But comments don't have a cursor, do 
they? So I need to tokenize the include files separately. Which is apparently 
not possible currently - if I understand you correctly?

> Alternatively you could just parse the included files separately.

This is too time consuming. We explicitly don't want to run clang N times, if 
once would suffice.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de



More information about the cfe-dev mailing list