Skip to main content



      Home
Home » Modeling » TMF (Xtext) » how to create reference for xtext
how to create reference for xtext [message #892656] Thu, 28 June 2012 22:45 Go to next message
Eclipse UserFriend
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 152 times)

[Updated on: Thu, 28 June 2012 22:52] by Moderator

Re: how to create reference for xtext [message #892658 is a reply to message #892656] Fri, 29 June 2012 00:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

can you describe the error you get?

~Christian
Re: how to create reference for xtext [message #892964 is a reply to message #892656] Mon, 02 July 2012 03:52 Go to previous message
Eclipse UserFriend
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 04:14] by 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 Jul 23 22:34:18 EDT 2025

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

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

Back to the top