[Soot-list] Help: How to change the source code by Soot

Eric Bodden eric.bodden at mail.mcgill.ca
Fri May 30 08:15:04 EDT 2008


Hi Yu.

What Bart says is all correct however I am not sure if it's the
easiest way. First of all are you sure that you want to produce source
code again in the end? What's the reason? If you really need to
produce source code then it might be cleaner to do pure AST rewriting.
This you can do in the frontend, e.g. using JastAdd. In general if you
don't require the analysis capabilities that Soot provides then Soot
is probably not the tool you want to use for this kind of task.

Eric

2008/5/30 Yu Zhang <upupsky at gmail.com>:
> Dear all,
>
> I want to know whether Soot can work based on Jave Source code.
>
> For example, after some analysis based on Soot, I want to add some
> information into the source code.
> The orginial source code is as below:
> public class Temp
> {
>     public void test() {
>         int x = 0;
>     }
> }
>
> And I want add some code into it, like:
> public class Temp
> {
>     public void test() {
>         int x = 0;
>         System.out.println(x);  //this in the code I want to add
>     }
> }
>
> How can I do with it?
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list