Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Where is cardinality stored in the ecore model?
Where is cardinality stored in the ecore model? [message #1839225] Wed, 17 March 2021 20:19 Go to next message
M D is currently offline M DFriend
Messages: 33
Registered: January 2021
Member
I'm trying to find where the cardinality of rules are stored. I assumed it was stored in the ecore model, but has not been able to find anything
Re: Where is cardinality stored in the ecore model? [message #1839226 is a reply to message #1839225] Wed, 17 March 2021 20:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Grammar information is in the parser and the xtextbin file which can be accessed by yourdslgrammaraccess

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Where is cardinality stored in the ecore model? [message #1839227 is a reply to message #1839226] Wed, 17 March 2021 20:26 Go to previous messageGo to next message
M D is currently offline M DFriend
Messages: 33
Registered: January 2021
Member
Thanks!
Re: Where is cardinality stored in the ecore model? [message #1839233 is a reply to message #1839227] Thu, 18 March 2021 05:42 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The cardinality/multiplicity is maintained as the upper/lower/unique/ordered attributes of an Ecore ETypedElement and if you maintain the *.ecore file manually you have direct control.

If you let Xtext auto-generate the *.ecore only those aspects that have a grammar expression can possibly be configured. Thus Xtext cannot possibly know how to set ordered or unique, so you are pretty much limited to singletons "=" and sequences "+=".

Auto-generated *.ecore is great if your models are simple, but disastrous if you actually care about the details. Personally I always use manual *.ecore files.

Regards

ED Willink
Previous Topic:hot deployment with gradle
Next Topic:Required steps to create Language Server with Maven
Goto Forum:
  


Current Time: Tue Apr 16 09:06:51 GMT 2024

Powered by FUDForum. Page generated in 0.02852 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top