|Re: Reference Question for a goto like statement [message #993589 is a reply to message #993395]
||Mon, 24 December 2012 22:32
| Henrik Lindberg
Registered: July 2009
By default, the linker links an ID to a feature called "name" in the |
target. Since your target uses a feature called "label", this will not
work out of the box. Also note that the reference must be a non
I have not had to change this myself, but I think the issue has been
answered earlier in this forum.
Since your metamodel is an already existing one, I assume you can't
change it (rename "label" to "name") even if this is by far the easiest.
Not sure if it works to add a derived attribute (called "name"), but
should be very quick to find out.
I hope that helps.
Regards and Happy Holidays.
On 2012-24-12 21:03, Selim Ciraci wrote:
> I have generated an xtext project from my ecore model. In my model, I
> have an EClass called statement which has an attribute called label.
> Every statement is a subclass of this class. For example, I have a call
> statement class, and its syntax is defined as:
> call returns call
> label=EString? 'call' to=[CCElem|Estring] '(' ')'
> I want the label of s statement to be optinally defined. Now I have
> special goto like statement, where the user can refer to a statement by
> its label. So using the above syntax for call, I want to have something
> n1 call foo();
> call mbar();
> goto n1;
> The syntax for goto is defined as:
> goto returns goto
> label=EString? 'goto' st=[statement|EString]
> With this rule and the above program segment, I get an error in the goto
> line saying: Couldn't resolve reference to Statement 'n1'
> Somehow it cannot identify the statement by its label. What am I doing
> wrong? do you have any suggestions?
Powered by FUDForum
. Page generated in 0.02609 seconds