In lib/FrontEnd there is quite a bit of code for printing the AST to XML. Does that work and if so how can you invoke it?<br><br>Thanks a bunch,<br>-- Octav<br><br><div class="gmail_quote">On Fri, Feb 26, 2010 at 7:18 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.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;">The AST dumper does not handle all decl kinds (nor does the AST printer, IIRC). It would be helpful if someone were to contribute a patch dumping the remaining decl kinds.<br>

<br>
Sent from my iPhone<div><div></div><div class="h5"><br>
<br>
On Feb 26, 2010, at 7:03 PM, Charles Davis <<a href="mailto:cdavis@mymail.mines.edu" target="_blank">cdavis@mymail.mines.edu</a>> wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
Octav Chipara wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Dear Chip,<br>
<br>
Thanks for the info. Is there an plug-in the exports the AST?<br>
</blockquote>
No. However, it's really not necessary. If you derive a class from<br>
ASTConsumer (from the AST library), you will be fed each top-level<br>
declaration from the AST as the parser builds it up (see<br>
ASTConsumer::HandleTopLevelDecl()). Or, you can traverse the AST all at<br>
once by implementing the HandleTranslationUnit() method (also in<br>
ASTConsumer), which receives a translation unit decl from which you can<br>
get every other node in the AST.<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I tried<br>
the ast-dump, however, it crashes:<br>
<br>
0x10490e360 Assertion failed: (0 && "Unexpected decl"), function<br>
DumpDeclarator, file StmtDumper.cpp, line 263.<br>
</blockquote>
That's not supposed to happen.<br>
<br>
Can we see the source that caused this? Put it up on pastebin or some such.<br>
<br>
Chip<br>
<br></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">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>
</blockquote>
</blockquote></div><br>