Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Reference to non ID element from imported grammar(How to reference an element (not ID) from another grammar?)
icon5.gif  Reference to non ID element from imported grammar [message #1092106] Thu, 22 August 2013 10:35 Go to next message
cissé sékou is currently offline cissé sékouFriend
Messages: 2
Registered: August 2013
Junior Member
Hi everyone,

I'm having trouble with reference to a non ID element from an imported grammar.
I'm going to sum this up as possible.Let's say i have a first grammar:

Grammar A :

ExtendNoun :
'NOUN' name= NounName
;
NounName :
NAME +
;
terminal NAME:
'A' .. 'Z' (( '-' ) ?( 'A' .. 'Z'| '0' .. '9' ) ) *
| "'" -> "'"
;

Now I would like to reference in another grammar(B) the rule ExtendNoun from grammar A :

Grammar B (which import grammar A as Def) :

Noun :
ref=[atlasDef::ExtendNoun]
;

When doing this, the referenced element is allways null. If i get it right it should be something like :

Noun :
ref=[atlasDef::ExtendNoun|atlasDef::NounName]
;

But that is not working at all...
Does anyone see where the problem is and how i should fix it?

I appologize for my english that is not really good at all and hope you understand my problem Smile .

Many thanks,

Cisse
Re: Reference to non ID element from imported grammar [message #1092173 is a reply to message #1092106] Thu, 22 August 2013 12:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Noun :
ref=[atlasDef::ExtendNoun|NounName]
;

NounName:
... //copy from other dsl
;


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Reference to non ID element from imported grammar [message #1094947 is a reply to message #1092173] Mon, 26 August 2013 12:28 Go to previous message
cissé sékou is currently offline cissé sékouFriend
Messages: 2
Registered: August 2013
Junior Member
Thank you for your answer! It really helped me ! Smile
Previous Topic:Xbase extension methods
Next Topic:Xtext/Xtend integration in a Maven build
Goto Forum:
  


Current Time: Sat Apr 20 05:24:18 GMT 2024

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

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

Back to the top