Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Cross reference to INT
Cross reference to INT [message #610556] Tue, 21 September 2010 16:59 Go to next message
Eclipse UserFriend
Hi,
I am creating a grammar that i built up using identifiers of integers.
What i am looking for is a way to cross-reference to integers. The xtext supports ID, but i have not found anyway to cross-reference to an integer.
regards,
Anders
Re: Cross reference to INT [message #611554 is a reply to message #610556] Tue, 21 September 2010 17:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

if you can change your grammar to somwething like this
grammar org.xtext.example.mydsl1.MyDsl1 with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/emf/2002/Ecore" as ecore

generate myDsl1 "http://www.xtext.org/example/mydsl1/MyDsl1"

Model:
	elements+=Element*
	refs+=Ref*
;

Element:
	"element" name=IntRef
;

Ref:
	"ref" ref=[Element|IntRef]
;

IntRef returns ecore::EString: INT;

it will work out of the box

~Christian
Re: Cross reference to INT [message #628697 is a reply to message #610556] Thu, 23 September 2010 13:40 Go to previous message
Eclipse UserFriend
dear christian,

Thanks for this quick answer. It solved my problem perfectly

thanks,
Anders
Previous Topic:how to serialised back a DSL ecore instance in its textual DSL representation
Next Topic:Inconsistent error markers
Goto Forum:
  


Current Time: Tue Jul 08 19:44:24 EDT 2025

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

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

Back to the top