<div dir="ltr">Hey Daniel,<div><br></div><div>Thanks for your optimism! I sure hope it's prescient.</div><div><br></div><div>The code does not need to be compile-able, but it does need to be at least some-what parseable. From what I've seen, some errors will not prevent clang from building an AST, albeit an incomplete one. However, the renaming tool will only be able to rename symbols that are contained in the AST, and if the AST doesn't contain some symbols, perhaps because some includes were missing and gosh darnit clang just has no idea what the heck is a DWORD??</div>
<div><br></div><div>Basically, in order for it to be renamed, a symbol must be understood by clang. And how Clang works around various error conditions is beyond my knowledge - you'll have to go check the source!</div>
<div><br></div><div>Incidentally, I seem to recall that there is a section in the dragon book that talks about error recovery in parsers. I didn't read that section (or book), but I imagine someone working on clang has.</div>
<div><br></div><div>I'm confident that did not answer your question entirely, so I apologize. </div><div><br></div><div>-Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 12:18 AM, Daniel Albuschat <span dir="ltr"><<a href="mailto:d.albuschat@gmail.com" target="_blank">d.albuschat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">Hi there,</div><div class="gmail_extra"><br></div><div class="gmail_quote">
2014-07-25 22:01 GMT+02:00 Amin Shali <span dir="ltr"><<a href="mailto:amshali@google.com" target="_blank">amshali@google.com</a>></span>:<div class=""><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">

<div>Folks,</div><div><br></div><div>At Google we are working on a tool and set of APIs for refactoring C++ programs based on LibTooling. Particularly, we have targeted rename refactoring for C++ as our first step. </div>




<div><br></div><div>In our first iteration we want to offer two things:</div><div>1- A command line tool similar to clang-format which will semantically rename a symbol (specified by a position in a file) in a set of input files.</div>




<div>2- An API for doing the above task which can effectively be used to provide this functionality for any editor (Emacs, Vim, CodeMirror, etc.).</div><div></div></div></div></blockquote></div></div><br></div><div class="gmail_extra">

This is something that C++ developers are definitely lacking. Just image how neat it could be to rename some legacy class or method name in the LLVM or clang codebase that has been bugging you ever since. :-) If it can be used broadly, it could become a "game changer" in C/Objective C/C++ code quality, e.g. for large frameworks like Qt, KDE, the Linux kernel.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I have one question that might be important to others that are interested, too:</div><div class="gmail_extra">Will this only work on a codebase that can be compiled (or at least strictly parsed) with clang, or is it more "fuzzy", so it will work with e.g. a codebase that uses windows.h (that, afaik, can not be compiled with clang - please correct me if I'm wrong)?</div>

<div class="gmail_extra">This might be a general LibTooling-question, though.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Greetings,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Daniel Albuschat</div>

</div>
<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></blockquote></div><br></div>