<div dir="ltr">One example you might want to look at is the clang-modernize tool which is designed to do project-wide refactoring.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 13, 2013 at 1:58 AM, Rambo <span dir="ltr"><<a href="mailto:hunanlwm@sina.cn" target="_blank">hunanlwm@sina.cn</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<br>
Now I am troubled in source to source transformation.please see a example:<br>
file name:  a.c                                              b.c<br>
                #include"b.c"                               ..........<br>
                  .......                                         sum2[i];<br>
                  sum1[i];                                    ........<br>
                  .......<br>
Now I want to transform them as followed:<br>
a.c                                              b.c<br>
#include"b.c"                               ..........<br>
.........                                         sum2[i,j];<br>
sum1[i,j];                                    ..........<br>
........<br>
The general method is transform them one by one,but if the count of files is<br>
not just two,there are many many files need to transformed,like organized by<br>
makefile.the general method is infeasible.<br>
Of course,there are some approaches to deal with it.<br>
One approach is that we transform them by the trace of include,as long as we<br>
meet a #include"**.*",we suspend the current transformation and jump to the<br>
include for transforming.This method is feasible but also have many<br>
disadvantages such as the same variables.<br>
Another approach is to merge relate files to a single file,and if relate<br>
files is too much,the final file would be very large.other questions also<br>
need to solved.<br>
I believe the all two methods are difficult to implement.What do you think?<br>
any body have a good Implementation scheme or other approaches?Thank you<br>
very much!<br>
<br>
Rambo<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/a-question-about-source-to-source-transformation-tp4036002.html" target="_blank">http://clang-developers.42468.n3.nabble.com/a-question-about-source-to-source-transformation-tp4036002.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>