Alex,
This is not what you did. You took an internal implementation
dictionary and added the values to the model:
importer classes is dictionary that is meant to be used internally and
not from outside like you did. When you merge meta and instance side,
you will have both the Smalltalk instance class and the Smalltalk meta
class pointing to the same FAMIXClass object, so if you will simply
iterate over the values, you will get twice the FAMIXClass.
Please take a look at the MooseCompositeImporterTask>>basicRun
Cheers,
Doru
On Wed, Nov 23, 2011 at 5:02 PM, Alexandre Bergel
<alexandre.bergel(a)me.com> wrote:
This is pretty confusing :-)
If I do "model add: famixClass" I do not see a good reason for having twice the
same famixClass in model.
Cheers,
Alexandre
On 23 Nov 2011, at 12:47, Tudor Girba wrote:
Hi,
You are confused :).
The problem is in the way you add the classes to the model. You should
use the InstallElementsOperator which deals with the merging issue.
Check the following code:
model := MooseModel new.
model sourceLanguage: ( FAMIXSmalltalkSourceLanguage new ).
importTask := MooseImportClassesTask new.
importTask importerClass: SmalltalkImporter.
importTask importingContext: (MooseImportingContext new
importClass ; importAttribute ; importMethod ;
mergeClassAndMetaclass ; yourself).
importTask addClass: LANNode.
importer := importTask run.
(InstallElementsOperator
with: importer
on: model) run.
(model allClasses reject: #isStub)
Cheers,
Doru
On Wed, Nov 23, 2011 at 4:16 PM, Alexandre Bergel
<alexandre.bergel(a)me.com> wrote:
Hi!
Maybe I am confused with something. Why the following expression return 2 and not 1?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| model importTask importer |
model := MooseModel new.
model sourceLanguage: ( FAMIXSmalltalkSourceLanguage new ).
importTask := MooseImportClassesTask new.
importTask importerClass: SmalltalkImporter.
importTask importingContext: (MooseImportingContext new
importClass ; importAttribute ; importMethod ;
mergeClassAndMetaclass ; yourself).
importTask addClass: LANNode.
importer := importTask run.
model addAll: importer classes.
(model allClasses reject: #isStub) size
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Apparently, LANNode is twice in the model.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev