[cfe-dev] source traversing with clang......

Reid Kleckner reid.kleckner at gmail.com
Thu Jan 13 10:36:41 PST 2011

You probably want the RecursiveASTVisitor.  I think the best docs for
it are the comments at the top of the header file.  Someone should
turn that into a quick little HTML doc, but it's been too long since I
used it to be useful with it.


On Thu, Jan 13, 2011 at 8:13 AM, jignesh vasoya <jigneshvasoya at gmail.com> wrote:
> Hi,
> I want to traverse source code of "C" language.
> i want to extract all the "for loops" in given C file. After extraction loop
> body i want to visit its body statements.
> then i want to extract all the functions one by one in the given source
> file.
> i want to do these using clang.
> what will be better? writing clang-plugin or separate program like whole
> program analysis?
> i may need to visit each and every statement of the function.
> how can i write AST walker that can walk through all the node?
> is there any sub type walker for loops and functions only(means that will
> visit only loops of functions)?
> --
> ___________________________________________________________________________
> -----------------------------------------------------------------------------------------------------------------------------
> Jignesh Vasoya
> 9962248684
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list