|
|
Re: Xtext & Sirius Integrate Problems [message #1737131 is a reply to message #1737087] |
Wed, 06 July 2016 03:18 |
Nicholas Kong Messages: 59 Registered: July 2016 Location: China |
Member |
|
|
Christian Dietrich wrote on Tue, 05 July 2016 15:11yes bidi refs are not supported well.
in your grammar / the inferred grammar you have only one direction now?
if yes mark the other direction as transient via org.eclipse.xtext.serializer.sequencer.ITransientValueService
Thanks for your answer, Christain.
The edge "/father" & "/mother" is set the 'Derived' property in Ecore.
But this reference is not appearance in Xtext, the grammar as this:
// automatically generated by Xtext
grammar org.eclipse.sirius.sample.basicfamily.Dsl with org.eclipse.xtext.common.Terminals
import "platform:/resource/org.eclipse.sirius.sample.basicfamily/model/basicfamily.ecore"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
Family returns Family:
{Family}
'Family'
name=ID
'{'
('members' '{' members+=Person ( "," members+=Person)* '}' )?
'}';
Person returns Person:
Man | Woman;
Man returns Man:
{Man}
'Man'
name=ID
'{'
('children' '(' children+=[Person|STRING] ( "," children+=[Person|STRING])* ')' )?
('parents' '(' parents+=[Person|STRING] ( "," parents+=[Person|STRING])* ')' )?
'}';
Woman returns Woman:
{Woman}
'Woman'
name=ID
'{'
('children' '(' children+=[Person|STRING] ( "," children+=[Person|STRING])* ')' )?
('parents' '(' parents+=[Person|STRING] ( "," parents+=[Person|STRING])* ')' )?
'}';
As you said "mark the other direction as transient via org.eclipse.xtext.serializer.sequencer.ITransientValueService", what should I do for this.
Would you please give me more detail introduction?
Note:
I have attached the source code.
Thanks a lot.
[Updated on: Wed, 06 July 2016 03:25] Report message to a moderator
|
|
|
Re: Xtext & Sirius Integrate Problems [message #1737136 is a reply to message #1737131] |
Wed, 06 July 2016 04:44 |
|
i am not sure what you need as details
@SuppressWarnings("restriction")
public class MyTransientValueService extends LegacyTransientValueService {
@Override
public ValueTransient isValueTransient(EObject semanticObject, EStructuralFeature feature) {
if (feature == YourDslPackage.Literals.ABC_XYZ) {
return ValueTransient.YES;
}
return super.isValueTransient(semanticObject, feature);
}
}
def Class<? extends ITransientValueService> bindITransientValueService2() {
MyTransientValueService
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
|
|
|
|
Powered by
FUDForum. Page generated in 0.03172 seconds