Acquiring of ASTs with bindings out of eclipse [message #1750394] |
Tue, 20 December 2016 16:30 |
Martin Meciar Messages: 1 Registered: December 2016 |
Junior Member |
|
|
Hello,
I am trying to use JDT outside of eclipse to acquire informational / data flow (just by using static code analysis).
I know how to use ASTParser.createAST( .java file ) and I am able to successfully obtain bindings in scope of one file (and therefore do static code analysis inside that one file).
I would like to use ASTParser.createASTs( .java files ) and acquire ASTs that would have bindings even to the other trees. Or even better - even across the imports (so I can track flows). I have searched a lot and tried hard, but I haven't found feasible solution nor tutorial for this method. Any hints / solutions / tutorials please?
Example:
File => A.java
'
package demoA;
import demoB.B;
public class A {
[code][/code]private String x;
private String Greet(B b, int c) {
b.ChangeValue(x, c);
return x;
}
}
'
File => B.java
'
package demoB;
public class B {
public static void ChangeValue(String x, int c) {
if (c > 5)
x = "Not even close so far ...";
}
}
'
My dreamed result for method A.Greet(demoB.B, int c) =>
method A.Greet(demoB.B, int c) has following flow
- b as input
- change of this.x inside of b.ChangeValue depending on value c
- this.x as output
|
|
|
Powered by
FUDForum. Page generated in 0.04624 seconds