Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » eOpposite with xtext(I 'd like to introduce an eOpposite with xtext)
eOpposite with xtext [message #517948] Tue, 02 March 2010 15:20 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Hello,
I 'd like to introduce an eOpposite relation
like in the model in the picture.
please help me.

http://img35.imageshack.us/img35/7070/capturepe.png

[Updated on: Tue, 02 March 2010 15:21]

Report message to a moderator

Re: eOpposite with xtext [message #517954 is a reply to message #517948] Tue, 02 March 2010 15:34 Go to previous messageGo to next message
Flowqi is currently offline FlowqiFriend
Messages: 14
Registered: March 2010
Junior Member
Why dont you just use eContainer()?
e.g:

Arc:
'arc' 'weight' weight = INT
'kind' kind = ArcKind
'outgoings' '{' outgoings += [Node]* '}'
;

Node:
'node' name = ID
;

if you invoke eContainer() on a Node in something like a Validator, you would get a reference to its Arc
Re: eOpposite with xtext [message #517962 is a reply to message #517954] Tue, 02 March 2010 15:40 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
thank you
but
wih your solution , you can't introduce a join between outcomings and source.
we should have a relation between outcomings and source,
also I dont like in the textual model introduce these outcomings.

[Updated on: Tue, 02 March 2010 15:43]

Report message to a moderator

Re: eOpposite with xtext [message #517965 is a reply to message #517948] Tue, 02 March 2010 15:42 Go to previous messageGo to next message
tunisiano  is currently offline tunisiano Friend
Messages: 3
Registered: March 2010
Junior Member
i'm just trying to resolve a such problem, i've changed the Xpand in my way but not xtext there's always problems in it..
is there someone who has an example in which he transformes eOposite into xText ??
Thanks
Re: eOpposite with xtext [message #518065 is a reply to message #517965] Tue, 02 March 2010 22:15 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi everybody,

it is recommended to use imported metamodels if you want to use opposite
references. If you want to stick with generated metamodels, have a look
at the Xtext FAQ to learn about the post processor:
http://wiki.eclipse.org/Xtext/FAQ#How_can_I_control_the_Xtex t_meta_model_inference.C2.A0.3F

Please note the emf contract that both sides of the referenced have to
exist in the concrete syntax because it is required to create a proxy
for either of them.

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=282486

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 02.03.10 16:42, schrieb tunisiano:
> i'm just trying to resolve a such problem, i've changed the Xpand in my
> way but not xtext there's always problems in it..
> is there someone who has an example in which he transformes eOposite
> into xText ??
> Thanks
Previous Topic:Xtext: Howto define function calls AND parentheses
Next Topic:Problem with imports when parsing inside a standalone java class
Goto Forum:
  


Current Time: Tue Mar 19 05:11:10 GMT 2024

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

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

Back to the top