Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to create reference for xtext
how to create reference for xtext [message #892656] Fri, 29 June 2012 02:45 Go to next message
zwzhao Missing name is currently offline zwzhao Missing nameFriend
Messages: 3
Registered: June 2011
Junior Member
hi
i am a newer of xtext . and do not know how to use referenec in xtext file. i had upload my ecore file(a pic) , in ecore file Connection -> iNodeConnection it is include two reference (source and target), how to define it in xtext file?
this is a fragment of my xtext file :

grammar org.talend.metalanguage.jobscript.JobScript with org.eclipse.xtext.common.Terminals

import "platform:/resource/.../model/xmlmap.ecore" as xmlmapFile

XmlMapData returns xmlmapFile::XmlMapData:
{xmlmapFile::XmlMapData}
'addXMLMapData'
'{'
('addInputTree' '{' inputTrees += XMLInputTree'}')*
('addOutputTree' '{' outputTrees+=XMLOutputTree'}')*
('addVarTable' '{' varTables+=XMLVarTable '}')*
('addConnections' '{' connections+= XMLConnection'}')*
'}'
;

XMLConnection returns xmlmapFile::Connection:
{xmlmapFile::Connection}
('addSourceNode' '{' source= [xmlmapFile::AbstractNode]'}')?
('addTargetNode' '{' target= [xmlmapFile::AbstractNode]'}')?
;


seems the red code not correct.


BR
zwzhao
  • Attachment: ecore.JPG
    (Size: 54.92KB, Downloaded 105 times)

[Updated on: Fri, 29 June 2012 02:52]

Report message to a moderator

Re: how to create reference for xtext [message #892658 is a reply to message #892656] Fri, 29 June 2012 04:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13365
Registered: July 2009
Senior Member
Hi,

can you describe the error you get?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: how to create reference for xtext [message #892964 is a reply to message #892656] Mon, 02 July 2012 07:52 Go to previous message
zwzhao Missing name is currently offline zwzhao Missing nameFriend
Messages: 3
Registered: June 2011
Junior Member
hi
thank you for your reply . my problem is how to manage correctly the references
. We found few help on internet, and with this, we wrote partially this script above.
Is there some example (script + definition + code sample) somewhere ?"
by the way we use actually "only" the version 1.0.1 of xtext.
BR
zwzhao

[Updated on: Mon, 02 July 2012 08:14]

Report message to a moderator

Previous Topic:Xtext 2.3 - what's in? what's out?
Next Topic:How to use xtext inferred JVM model outside of xtext project?
Goto Forum:
  


Current Time: Wed Feb 26 15:20:33 GMT 2020

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

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

Back to the top