I am looking for a library or tools which offer functionality to build up a data structure which I can use to find variable or method declarations that are used in a class in another scope.
example code:
class A
{
public void methodA()
{
B external = new B();
external.methodB(); // I would like to know the name/location where this method is declared. something like: classB.java ... line 3
}
}
class B
{
public void methodB()
{
}
}`
Would Rascal be a good candidate to retrieve this kind of information? I have been using the tool before. As far as I know, I can create an AST but this will not have enough information to determine the scope of where certain variables/methods are declared. If this would not be the right candidate, any ideas on alternatives? My list of candidates I am currently looking into are: Antlr/symtab; JavaParser/JavaSymbolSolver; Spoon; Rascal; JDT