Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » prefix on Qualified Name(Xtext 2.0)
prefix on Qualified Name [message #716172] Tue, 16 August 2011 15:34 Go to next message
Lucy Sakhnenko is currently offline Lucy SakhnenkoFriend
Messages: 41
Registered: March 2011
Member
Hi,

I'm trying to have a prefixed qualified name. For example:

Model:
	def=Def
	ref=Ref
;

Def:
	'def:' name=QualifiedName
;

QualifiedName:
	'*'ID
;

Ref:
	'ref:' ref=[Def]
;


I can write "def: *a" without any problems, but if I try "ref: *a" , I get the error: "Couldn't resolve reference to Def 'a'." . It always ignores the prefix.

How can I overcome this?

Thanks!
Re: prefix on Qualified Name [message #716192 is a reply to message #716172] Tue, 16 August 2011 16:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi,

first the grammar should look

Ref:
'ref:' ref=[Def|QualifiedName]
;

if that does not hep
try to debug org.eclipse.xtext.naming.IQualifiedNameConverter.DefaultImpl

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 16 August 2011 16:22]

Report message to a moderator

Re: prefix on Qualified Name [message #716197 is a reply to message #716192] Tue, 16 August 2011 16:28 Go to previous messageGo to next message
Lucy Sakhnenko is currently offline Lucy SakhnenkoFriend
Messages: 41
Registered: March 2011
Member
I didn't understand why the reference should be like that, but it works!

Thank you!
Re: prefix on Qualified Name [message #716203 is a reply to message #716197] Tue, 16 August 2011 16:34 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi ref=[Def] is short for ref=[Def|ID] which means "link to a Def and parse an ID"
so ref=[Def|QUalifiedName] is "link to a Def and parse a QUalifiedName"
Since *ID cannot be represented as an ID you have to parse a QUalifiedName


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:problem with commonFilter and plugin export
Next Topic:MWE2 workflow generated import: "import org.eclipse.xtext.parsetree.*"
Goto Forum:
  


Current Time: Tue Apr 20 12:29:28 GMT 2021

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

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

Back to the top