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@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@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@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev