<br><br><div class="gmail_quote">On Thu, Aug 16, 2012 at 4:14 PM, Journeyer J. Joh <span dir="ltr"><<a href="mailto:oosaprogrammer@gmail.com" target="_blank">oosaprogrammer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello list,<br>
<br>
I am recently reading the source code of the Clang/LLVM with gdb.<br>
Among others I read about the AST Parsing these days. But finding the<br>
result of this parsing is difficult for me.<br>
<br>
I'd like to know where I can find the result of AST Parsing.<br>
<br>
I found where the AST Parsing is commited. It's shown below.<br>
<br>
break clang::ParseAST<br>
break clang::Parser::ParseTopLevelDecl<br>
break clang::Parser::ParseExternalDeclaration<br>
break clang::Parser::ParseDeclarationOrFunctionDefinition<br>
break clang::Parser::ParseDeclOrFunctionDefInternal<br>
break clang::Parser::ParseDeclarationSpecifiers<br>
break clang::Parser::ConsumeToken<br>
break clang::Parser::ParseDeclGroup<br>
break clang::Parser::ParseDeclarator<br>
break clang::Parser::ParseDeclaratorInternal<br>
break clang::Parser::ParseDirectDeclarator<br>
break clang::Parser::ParseFunctionDeclarator<br>
break clang::Sema::ActOnStartFunctionDeclarator<br>
break clang::Parser::ParseParameterDeclarationClause<br>
break clang::Parser::ParseDeclarationSpecifiers<br>
break clang::Parser::ParseDeclarator<br>
break clang::Parser::ParseFunctionDefinition<br>
break clang::Parser::ParseCompoundStatementBody<br>
break clang::Parser::ParseStatementOrDeclaration<br>
break clang::Parser::ParseDeclaration<br>
break clang::Parser::ParseExprStatement<br>
<br>
This is my break points used in gdb.<br>
<br>
I was able to trace the parsing of the C source code,<br>
BUT I couldn't find the result of this AST Parsing.<br>
<br>
I'd like to know where I can find the result of this AST Parsing.<br>
I'd like to find it using gdb.<br>
<br>
Or, I wonder if there is any way for me to print out the Parsed AST.<br>
Any utility or compiler options?<br></blockquote><div>You can use </div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="courier new, monospace">clang -cc1 -ast-dump filename.cpp <i>[header search and other options]</i></font><i> </i></div>
</div></blockquote><div class="gmail_quote"><div>or</div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="courier new, monospace">clang-check -ast-dump filename.cpp -- <i>[header search and other options]</i></font></div>
</div></blockquote>to dump the AST parsed from <font face="courier new, monospace">filename.cpp</font><font face="arial, helvetica, sans-serif">. You can also use </font><font face="courier new, monospace">-ast-dump-filter</font><font face="arial, helvetica, sans-serif"> for both to filter dumped declarations by a certain substring in name.</font><br>
<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you very much in advance.<br>
<br>
Have a good day!<br>
<span class="HOEnZb"><font color="#888888">--<br>
----------------------------------------<br>
Journeyer J. Joh<br>
o o s a p r o g r a m m e r<br>
a t<br>
g m a i l  d o t  c o m<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>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Best regards,</div><div>Alexander Kornienko</div><br>