|Xtext Grammar - usage of 'returns' [message #1046691]
||Mon, 22 April 2013 08:39
| rohit ahuja
Registered: February 2013
Below is a part of my grammar in which i am getting some error.
Assignment returns Parameter:
name=AssignmentName '=' defaultValue=INT ';'
// The Parameter rule, is actually part of an existing ecore model, which is defined as
//name - EString
//defaultValue - INT
AssignmentName returns EString :
// i need something like [Instance].[Parameter] and the concatenated thing to go to name, but if use
//var=[Instance]'.'param=[Parameter], it doesnt work, so i have put in a validator to check it,
is there any direct way?
I have two queries:
1) is stated above
2)I am getting an error as
"Cannot find compatible feature name in sealed EClass Parameter
from imported package http.........:
The existing feature 'name' has an incompatible type 'EString'
[java.lang.String]. The expected type is 'EString'."
I am confused as to why this message is, even though the message says both are EString.
I think i am missing something. Can anyone please help?
Thanks in Advance,
|Re: Xtext Grammar - usage of 'returns' [message #1047034 is a reply to message #1046691]
||Mon, 22 April 2013 17:50
| Christian Dietrich
Registered: July 2009
this makes no sense to me a EString is for datatypes/terminals only and not for EObjects
from your post i am not quite sure what you actually want to do.
Maybe you want todo something like
param=[Parameter|PName] '=' defaultValue=INT ';'
PName: ID "." ID;
with propery naming or adoptions to scoping/nameing it will work out of the box
(giving the params the name <instancename>.<paramname>
Powered by FUDForum
. Page generated in 0.06868 seconds