How do I store the rhs of an assignation

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

How do I store the rhs of an assignation

Damien Cassou
Hi,

I'm working on analyzing Python source-code with Moose. In Python, one
can write:


   import re as regex

and this means "declare a local variable named 'regex' and put a
reference to the PyModule named 're' inside". How can I model that in
the mse file please?


Thanks


--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How do I store the rhs of an assignation

Nicolas Anquetil

- jus t be clear:
FAMIXLocalVariable represents a local variable in the scope of a
behavioural entity.
it means the local variable must be in a function or something like
that, not local to a package

- currently there are no associations far what you want
   the 4 associations are:
   - inheritance, from type to type
   - access, from behavioural (function, method) to variable
   - invocation, from behavioural to behavioural
   - reference, from container (package, class, behavioural) to container

so, no way to create a link from a variable to a container with current
FAMIX

2 solutions:
- you create a new association
- you use reference and put the link from the owner of the variable to
the package

we can discuss more if you need help

nicolas

On 28/01/2015 14:48, Damien Cassou wrote:

> Hi,
>
> I'm working on analyzing Python source-code with Moose. In Python, one
> can write:
>
>
>     import re as regex
>
> and this means "declare a local variable named 'regex' and put a
> reference to the PyModule named 're' inside". How can I model that in
> the mse file please?
>
>
> Thanks
>
>

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

Re: How do I store the rhs of an assignation

Tudor Girba-2
Hi,

You should not abuse Reference. Instead, as Nicolas suggested, you should create an own association.

Cheers,
Doru



On Fri, Feb 6, 2015 at 9:52 AM, Nicolas Anquetil <[hidden email]> wrote:

- jus t be clear:
FAMIXLocalVariable represents a local variable in the scope of a behavioural entity.
it means the local variable must be in a function or something like that, not local to a package

- currently there are no associations far what you want
  the 4 associations are:
  - inheritance, from type to type
  - access, from behavioural (function, method) to variable
  - invocation, from behavioural to behavioural
  - reference, from container (package, class, behavioural) to container

so, no way to create a link from a variable to a container with current FAMIX

2 solutions:
- you create a new association
- you use reference and put the link from the owner of the variable to the package

we can discuss more if you need help

nicolas


On 28/01/2015 14:48, Damien Cassou wrote:
Hi,

I'm working on analyzing Python source-code with Moose. In Python, one
can write:


    import re as regex

and this means "declare a local variable named 'regex' and put a
reference to the PyModule named 're' inside". How can I model that in
the mse file please?


Thanks



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



--

"Every thing has its own flow"

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