Looking up code references in FAMIX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking up code references in FAMIX

Stephan Eggermont-3
While building up the FAMIX model from the Delphi AST,
we need to connect the references to the correct entities.
We first did this with referenced types, but are now trying to
build up the call graph.

We know in Delphi that everything we want to reference
has been defined earlier, so we need to look up references
in the FAMIX model we build up so far. Currently we do that
by searching through all entities, building up moosenames.
This is very slow, and error-prone, since we should
actually use the hierarchical scope of the current code point.

We would like to be able to ask the scopingEntity to resolve
the names we encounter into a famixNamedEntity. We think
this functionality is more general, and would like to implement
it. We believe we can make an algorithm that has the right
behaviour for smalltalk, c, java and Delphi (and likely others).

To do this we'd need to add referenced scopes to scopingentity.
Do you agree this is a good idea, or do you have other
suggestions to make these connections?

Diego & Stephan
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Looking up code references in FAMIX

Nicolas Anquetil

Ifg I understand correctly, you are talking about symbol resolution?

Yuriy started to work on a generic symbol resolver in FAST.
Maybe he can give some light on what he did and the design decisions he
made?

However, things may not be as simple as one might expect.
There are specificities linked to each language semantic:

- Java and others have visibility (public, protected, private) that
other languages (smalltalk) do not have. Java also has visibility
"default package" that might be uniq to it
- C++ has friend classes
- ...

nicolas

On 07/09/2013 10:48 AM, Stephan Eggermont wrote:

> While building up the FAMIX model from the Delphi AST,
> we need to connect the references to the correct entities.
> We first did this with referenced types, but are now trying to
> build up the call graph.
>
> We know in Delphi that everything we want to reference
> has been defined earlier, so we need to look up references
> in the FAMIX model we build up so far. Currently we do that
> by searching through all entities, building up moosenames.
> This is very slow, and error-prone, since we should
> actually use the hierarchical scope of the current code point.
>
> We would like to be able to ask the scopingEntity to resolve
> the names we encounter into a famixNamedEntity. We think
> this functionality is more general, and would like to implement
> it. We believe we can make an algorithm that has the right
> behaviour for smalltalk, c, java and Delphi (and likely others).
>
> To do this we'd need to add referenced scopes to scopingentity.
> Do you agree this is a good idea, or do you have other
> suggestions to make these connections?
>
> Diego & Stephan
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
Nicolas Anquetil -- RMod research team (Inria)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Looking up code references in FAMIX

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
Nicolas wrote:
>Ifg I understand correctly, you are talking about symbol resolution?

Yes, that's correct.

Though all languages have different semantics for symbol resolution,
they seem to be composed out of a small set of 'essential abstractions'
- nesting rules (Delphi has nested functions)
- interface vs implementation
- visibility restrictors
- strictness (having to define first vs first use defines)
- order (first one vs last one wins, aliasing)
And perhaps some specifics (smalltalk blocks, friend)?

Stephan
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev