[cfe-dev] a question about source to source transformation

Rambo hunanlwm at sina.cn
Wed Nov 13 01:58:17 PST 2013


Hi everyone,
Now I am troubled in source to source transformation.please see a example:
file name:  a.c                                              b.c
                #include"b.c"                               ..........
                  .......                                         sum2[i];
                  sum1[i];                                    ........
                  .......
Now I want to transform them as followed:
a.c                                              b.c  
#include"b.c"                               ..........
.........                                         sum2[i,j];
sum1[i,j];                                    ..........
........
The general method is transform them one by one,but if the count of files is
not just two,there are many many files need to transformed,like organized by
makefile.the general method is infeasible.
Of course,there are some approaches to deal with it.
One approach is that we transform them by the trace of include,as long as we
meet a #include"**.*",we suspend the current transformation and jump to the
include for transforming.This method is feasible but also have many
disadvantages such as the same variables.
Another approach is to merge relate files to a single file,and if relate
files is too much,the final file would be very large.other questions also
need to solved.
I believe the all two methods are difficult to implement.What do you think?
any body have a good Implementation scheme or other approaches?Thank you
very much!

Rambo





--
View this message in context: http://clang-developers.42468.n3.nabble.com/a-question-about-source-to-source-transformation-tp4036002.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list