Thanks Garrison.  I appreciate the example.<br><br>Josef<br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 9:59 AM, Garrison Venn <span dir="ltr"><<a href="mailto:gvenn.cfe.dev@gmail.com">gvenn.cfe.dev@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Attached is a very non-complete, and simple example which I created awhile<br>
back. Even though this it uses RecursiveASTVisitor, one can get<br>
the basics on how to use ASTConsumers from it. One caveat here is that<br>
if you do want to use RecursiveASTVisitor, you must really have a good<br>
understanding of tablegen generated header files such as DeclNodes.inc.<br>
Using these files, along with redefined macros, is where the real power<br>
of RecursiveASTVisitor manifests itself (IMHO). The second caveat is that there<br>
is no cleanup here. For example I'm including headers (such as some JIT<br>
stuff), which I do not need. This was just a quick hack which got me started.<br>
<br>
Hope this helps<br>
<font color="#888888"><br>
Garrison<br>
</font><br>
PS: This example was tested with TOT<br>
<br>
<br><br>
<br>
On Oct 31, 2011, at 9:11, josef maxim pohl wrote:<br>
<br>
> Hi there,<br>
><br>
> I am still on my search for a relatively simple example to work with which creates an AST from a source file and traverses it doing even the most rudimentary tasks.  Does anyone have such an example?  Or does anyone have any tips on how to go about building one?<br>

><br>
><br>
> What I am attempting to do is build a stand-alone application (ie not a plugin) that sets up the AST (ie build preprocessor, set appropriate options (header search, etc), initialize ParseAST routine, ...) and then use an ASTConsumer to traverse the tree.<br>

><br>
> Any feed back would be greatly appreciated.<br>
><br>
> Thanks,<br>
> Josef<br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
<br></blockquote></div><br>