Suppose I have the following code
class A{
public void f(int i, int j){
// line
}
}
what I want to do is to
- parse the code using JDT parser;
- take an input string, e.g.
i + j
, from somewhere, parse the string using JDT parser and get an AST of typeExpression
; and - resolve the type of that
Expression
AST and get it's typeint
.
1 and 2 seem easy enough. But I couldn't figure out how 3 can be done in JDT. Has anyone any idea?
Thanks.