Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#mooseDescription not working with some entities with submetamodel #808

Open
NicolasAnquetil opened this issue Jul 24, 2024 · 2 comments
Open
Assignees

Comments

@NicolasAnquetil
Copy link
Contributor

load https://github.com/moosetechnology/Esope

It defines 4 metamodels with submetamodels:
FamixF77 (FamixFortran77Generator)
FamixFortran (FamixFortranUDTGenerator) -> submetamodel: FamixF77
FamixF03 (FamixFortran03Generator) -> submetamodels: FamixF77, FamixFortran
FamixEsope (FamixEsopeGenerator) -> submetamodels: FamixF77, FamixFortran

#mooseDescription works for some entities:

  • (all of FamixF77)
  • FamixF03Method mooseDescription.
  • FamixF03Use mooseDescription.

#mooseDescription does not work for some entities (error "not found in FMMetaModel"):

  • FamixFortranAttribute mooseDescription.
  • FamixFortranUserDefinedType mooseDescription.
  • FamixF03DerivedType mooseDescription.
  • FamixF03Module mooseDescription.
  • FamixEsopeSegment mooseDescription.
  • FamixEsopeCommand mooseDescription.

Problem seems to arise when an entity inherits from another one of an other mm.
For example in FamixFortran03Generator: module --|> programUnit where programUnit comes from FamixF77.
As a result FamixF03Module inherits from FamixF77ProgramUnit and asking for #mooseDescription will end up in FamixF77Model

On the other hand, in FamixFortran03Generator: method only has: method --|> #TMethod. and FamixF03Method inherits from FamixF03Model which is in the same meta-model.

So it seems to me that the definition of #mooseDescription needs to be corrected ...

@NicolasAnquetil
Copy link
Contributor Author

NicolasAnquetil commented Jul 24, 2024

So the problem comes from #metamodel (class side) where the mm is hard coded
for example:

FamixF77Entity class >> metamodel

	<generated>
	^ FamixF77Model metamodel

It is defined in Famix...Entity by default, but since some entity of a mm inherit from entities of another (sub)mm, they inherit the wrong definition of #metamodel

Still ensure what a good solution would be.
Maybe hardcode the right mm in all entities and not only Famix...Entity ?

@NicolasAnquetil
Copy link
Contributor Author

Incidently, the problem is the same if we deal with a class (FamixF03Module metamodel) or with an instance but without associated model (FamixF03Module new metamodel).

If an instance is inside a model (FamixF03Model new newModule metamodel) it works.

I came to this problem through MiQueryBrowser that uses MooseGroups and ask for their #details which looks for the #mooseDescription of a class: self entities commonSuperclass mooseDescription

(but this has not much to do with a solution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants