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

exportOn: gives an MSE file with ref: String instead of a ref: <integer> #19

Open
fuhrmanator opened this issue Feb 1, 2021 · 7 comments

Comments

@fuhrmanator
Copy link
Contributor

I'm experimenting with generating metamodels using FamixNG. I generated an MSE from it using 'FamixTypeScriptMetamodel.mse' asFileReference writeStreamDo: [ :writeStream | FamixTSModel metamodel exportOn: writeStream ], and got some results that don't look like they respect the grammar (see the (type: (ref: String))) line below). Because of this, my parser can't read it. Is this a bug? Maybe my metamodel is missing some entities (I can't find anything with (name 'String'))?

(
	(FM3.Package (id: 1)
		(name 'Tagging')
		(classes
			(FM3.Class (id: 2)
				(name 'Category')
				(abstract false)
				(package (ref: 1))
				(superclass (ref: 3))
				(properties
					(FM3.Property (id: 4)
						(name 'name')
						(class (ref: 2))
						(container false)
						(derived false)
						(multivalued false)
						(type (ref: String)))
					(FM3.Property (id: 5)
						(name 'markedTags')
						(class (ref: 2))
						(container false)
						(derived false)
						(multivalued true)
						(opposite (ref: 6))
						(type (ref: 7)))))

I'm attaching the entire MSE file of the Metamodel for more info (there are other cases where ref: is Number, etc.
FamixTypeScriptMetamodel.mse.txt

@fuhrmanator
Copy link
Contributor Author

fuhrmanator commented Feb 2, 2021

I've worked around this by adding a third reference type at profcfuhrmanets/mse-tools@7a4bbc4#diff-396fec23ee78598e7f93579e822b7c0b4c5ab540d5a8916da6f26d6e3851ff0cR13

I was using the EBNF I found in https://www.researchgate.net/publication/265428652_MSE_and_FAMIX_30_an_Interexchange_Format_and_Source_Code_Model_Family

Is there a newer version of the MSE Grammar specified like this (easy to use with PEG tools in Javascript)?

@badetitou
Copy link
Member

Hello,

No, I think you find the fix.
There are several types that are not exported but exist in the format.

  • Object (that is something we cannot export nor retrieve)
  • Character
  • Number
  • Fraction
  • String
  • Symbol
  • Boolean

Those types are used for the Fame Properties (not a relation between two models entities)
So, the ones generated with:

defineProperties
    myEntity property: #propertyName type: #String

@badetitou
Copy link
Member

(Still, we should document this better in format description, and in the metamodel generation)

@badetitou
Copy link
Member

Also,

Note that this kind of problem only happens when you want to generate the mse of a metamodel.

'FamixTypeScriptMetamodel.mse' asFileReference writeStreamDo: [ :writeStream | FamixTSModel metamodel exportOn: writeStream ]

When generating the mse of a model, those types are used to determine how to export the value of the properties

@fuhrmanator
Copy link
Contributor Author

Thanks for the info. I will update my MSE parser.

fuhrmanator added a commit to profcfuhrmanets/mse-tools that referenced this issue Feb 2, 2021
@NicolasAnquetil
Copy link
Contributor

hummmm
AFAIK, there are only 3 (or 4?) known types in Fame:

  • String
  • Boolean
  • Number
  • maybe Object
    The other ones (Fraction, Character, ...) should not be part of a metamodel

@jecisc
Copy link
Member

jecisc commented Feb 4, 2021

The metamodel knows only those 4.

Number can be a fraction in the model and String can be a symbol in the model.
Don't know for characters.

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

4 participants