How to make DSL editor distinguish between EAttribute and EReference [message #1427521] |
Sat, 20 September 2014 06:04  |
Eclipse User |
|
|
|
Hello,
Please I have and issue and I need some pointing, this my grammar (JIT ecore generation DSL )and it's compiling and merely working, the only issue is that I can't construct an EAttribute as always the content proposal only proposes the created Eclasses and does not proposes the data types that I want to use (MyDataType) as the eType is a cross reference and the eAttributeType is a derived reference.
so I want to get a content proposal with the defined types as well as the created Eclasses, and depending on the choice and EAttribute or an EReference is created.
I know about overriding the ProposalProvider, but here It seems that the grammar is missing somthing, since when I commented the EReference and kept the EAttribute I still get the error.
Student
age:String <=== getting error here as it can't resolve String
School
students:Student
MyEStructuralFeature returns ecore::EStructuralFeature:
{ecore::EAttribute} name=ID ':' (eType=[ ecore::EDataType|MyDefaultDataType] (defaultValueLiteral=MyValue)?)
| {ecore::EReference} name=ID ':' (eType=[ecore::EClass])
;
MyEClass returns ecore::EClass:
{ecore::EClass} name=ID (NEWLINE eStructuralFeatures+=MyEStructuralFeature)+;
MyDataType returns ecore::EDataType:
{EBoolean} name='Boolean'
| {EInteger} name='Integer'
| {ENumber} name='Number'
| {EString} name='String'
| {UUID} name='UUID';
MyDefaultDataType:
'Boolean' | 'Integer' | 'Number' | 'String' | 'UUID';
Thank you
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to make DSL editor distinguish between EAttribute and EReference [message #1428271 is a reply to message #1428259] |
Sun, 21 September 2014 11:07  |
Eclipse User |
|
|
|
Yes Christian,
I have a requirement to implement an ecore DSL with a specific layout to give something like
Customer
name:String
cutomers:* Customer
and this model should be seen as an ecore model on the fly, no code generation behind
so what would be seen if the DSL file opened by a ecore reflective editor something like :
EClass : Customer //EClass here
name : EString //EAttribute
customers : Customer //EReference
what is complicating my life is this on the fly modification to get the ecore MM ( thus the remove)
thanks and I will dig in the xcore code may be I will find somthing.
|
|
|
Powered by
FUDForum. Page generated in 0.04437 seconds