Stéphane Ducasse wrote:
A FAMIX.Access represents how a variable is accessed by a method/ function. So, if you have something like "method() { ... anObject ... }", then you will get a FAMIX.Access that has anObject variable as "accesses" and method as "accessedIn".
Please note that in FAMIX 2, the property FAMIX.Access.accesses can refer not only to structural entities (ie attributes, variables and globals) but alas also to classes or namespaces! Yet another Smalltalk oddity :)
Why oddity? In java you cannot have a field pointing to a class?
The odd thing is that for "AClass>>method BClass new" an access from AClass to BClass is created. (what probably should be called a reference to BClass...
This will change in FAMIX 3.0, accesses to classes or namespaces will be modeled with a new FAMIX.Reference entity. And FAMIX.Access.accesses restricted to structural entities only.
will you change the name because I always hated this accesses for non collection.
- what is the difference/similarity of "(candidate (idref: 37))" and
"(invokes 'yourself()')" in a "FAMIX.Invocation"?
In dynamically typed languages, it happens that we not know for sure which method is actually invoked.
even in statically type ones just cast to Object.
Euhm.... the first part of this sentence is absolutely right... on the other hand I don't really get why you added the second part. If functionality of a class A is overwritten in a subclass B and C, given an object currently cast to type A, if we call that given functionality it is possible (depending on the actual type of the object) that the version of B or C is executed.
So, in this case, we compute several "candidates". So, the "candidate" property is a collection of pointers to FAMIX.Method / Function. "invokes" on the other hand represents just the string of the call.
The same for static typing when methods are overwritten! For example the following invocation
Object o; o.toString();
would have (invokes 'toString()') and have ALL implementations of toString as candidates.
Personally I am not happy with that way of modelling invocations, but did not yet figure out how we can do better.
- what to do when there is no "(receivingVariable (idref: 24))" in a
"FAMIX.Invocation"?
There are two possibilities. Either the parser did not work for some reason, or the call is to a function, and not to a method. In any case, our analyses hardly depend on the receivingVariable information.
Third reason (and by far the most common!) is that the invocation was sent to an intermediate result rather than a variable, for example the following coll to length()
String a = "a"; String b = "b"; ("a" + "b").length();
or another example, the following call to next()
Collection coll; coll.iterator().next();
- what means "(hasClassScope false)" in a "FAMIX.Attribute"?
hasClassScope corresponds with "static" in Java.
- what is a "FAMIX.FormalParameter" and are they referenced in
"FAMIX.Invocation"?
FAMIX.FormalParameter represents parameters of a method/function. As variables, they can be the receivingVariable of an invocation.
- what is a "FAMIX.LocalVariable" and are they references in
"FAMIX.Method"?
FAMIX.LocalVariable represents a variable that is defined locally in a method or a function, so LocalVariable "belongsTo" a FAMIX.Method/ Function.
cheers, AA
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev