very difficult, Famix was not conceived for that usage at the start but
rather to identify dependencies between "higher level entities"
(packages, classes, methods)
You could try to check the source anchors (same line between method
invocation and variable access) but that would ot be 100% correct.
Long time ago, I started a java to FAST parser
https://scm.gforge.inria.fr/svn/verveinej/verveine.extractor.FASTJava
(FAST being a specialization of FAMIX to ASTs) but I don't remember
what its status is ...
nicolas
On Thu, 2018-12-13 at 02:21 -0600, Erik Stel wrote:
Through a jdt2famix parsed model of an application
I'm trying to
follow the
usage of a (FAMIX)Parameter. How can this be done?
From a method parameter I can access its enclosing method and from
there on
find invocations within that method for example. The problem is that
there
does not seem to be a direct way to retrieve the fact that a
parameter is
part of a method invocation (both direct or as part of an
expression). It
seems I have to parse a piece of the source code (the invocation
signature
to be precise). This does not feel okay. Can anyone give some
pointers on
how to find parameter usage without resorting to parsing the source
code (if
such a solution exists)?
(Googling didn't help so far, or I'm not using the right search
parameters
;-)
Example Java source code, for which I want to follow the 'x'
parameter:
void startPoint(String x, int y) {
// Here is first 'simple' parameter usage
this.doSomething(x, y);
// Here parameter is part of an expression
this.that.doAnother("[" + x + "]");
// Parameter is part of expression again (twice)
this.doLast(x.substring(0, y) + x.substring(y + 8));
}
Cheers,
Erik
--
Sent from:
http://forum.world.st/Moose-f1310756.html
_______________________________________________
Moose-dev mailing list
Moose-dev(a)list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev --
Nicolas Anquetil
RMod team -- Inria Lille