Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with cross reference
Problem with cross reference [message #1706162] Mon, 24 August 2015 10:05 Go to next message
Florian Dunz is currently offline Florian DunzFriend
Messages: 4
Registered: August 2014
Junior Member
Hi,

I've got a problem with cross referencing which I don't understand.

This grammar does work:
Mosa:
	name=STRING
        mobeReferences+=[mobe::Mobe]*
;


While this does not:
Mosa:
	name=STRING
	steps+=Step*
;

Step:
	mobeReference=[mobe::Mobe]
;


The file I use to test looks like this:
"Name"
step1


The error says:
Couldn't resolve reference to Mobe 'step1'.


The mobe grammer looks like this:
Mobe:
	'name' name=STRING
;


What am I missing? Shouldn't this end up doing the same?
Thanks.
Re: Problem with cross reference [message #1706186 is a reply to message #1706162] Mon, 24 August 2015 13:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
https://christiandietrich.wordpress.com/2015/03/19/xtext-and-strings-as-cross-references/

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem with cross reference [message #1706188 is a reply to message #1706186] Mon, 24 August 2015 14:52 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

@christian You are right, Florian should use the STRING rule as the concrete syntax for the cross reference. But it does not explain why example 1 works for him and example 2 doesn't.

@florian I tried your example and both grammars work for me. Are you sure there is nothing else causing the problem? Make sure your test setup for both cases is exactly the same.
Re: Problem with cross reference [message #1706189 is a reply to message #1706186] Mon, 24 August 2015 14:52 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

Double post, sorry =P

[Updated on: Mon, 24 August 2015 14:53]

Report message to a moderator

Re: Problem with cross reference [message #1706191 is a reply to message #1706189] Mon, 24 August 2015 15:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
yes. there must be something else wrong in the scoping.

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem with cross reference [message #1706295 is a reply to message #1706191] Tue, 25 August 2015 13:37 Go to previous message
Florian Dunz is currently offline Florian DunzFriend
Messages: 4
Registered: August 2014
Junior Member
The scoping was indeed the problem. Thanks for your time. I'll also have a look at the link.
Previous Topic:Xtext project in pure e4 applciation
Next Topic:Error in Generating Xtext Artifacts
Goto Forum:
  


Current Time: Tue Sep 24 09:30:33 GMT 2024

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

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

Back to the top