<div dir="ltr"><div>Hi,<br></div><div><br></div><div>I'm not really clear on why would you need to obfuscate C++ code, but check out clang-format (<a href="http://clang.llvm.org/docs/ClangFormat.html">http://clang.llvm.org/docs/ClangFormat.html</a>), might help you with what you need.</div>
<div><br></div><div>As far as I know there is no direct way to write the AST back to C++ code, and so I think you'll need to make do with the Rewriter and/or tooling::Replacement classes. See the doxygen documentation for details.</div>
<div><br></div><div>Gabor</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/21 saman parser <span dir="ltr"><<a href="mailto:esmi.saman@gmail.com" target="_blank">esmi.saman@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello All<br>
I'm new in clang and llvm please help me.<br>
I'm writing a c++ code obfuscator. I'm applying some data and control<br>
obfuscations.<br>
So I know how to parse code and build AST tree.. but I don't know how to<br>
convert my modified AST tree to code again. can anyone write a sample code?<br>
clang is a jungle of code and it's hard to find a way by just reading codes.<br>
thanks in advanced..<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/building-Code-from-clangAST-tp4032234.html" target="_blank">http://clang-developers.42468.n3.nabble.com/building-Code-from-clangAST-tp4032234.html</a><br>
Sent from the Clang Developers mailing list archive at Nabble.com.<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>
</blockquote></div><br></div>