Ambiguities in xText scoping "Context" [message #1006852] |
Sat, 02 February 2013 22:26 |
Frank Tagne Messages: 7 Registered: August 2012 |
Junior Member |
|
|
Hello,
I'm dealing an scoping problem in my xtext language.
Let's see the grammar below and the associated MM (see attached)
CallService returns CallService:
{CallService}
'CallService' (=>'::'name=EString)?
'{'
('sourcePort' sourcePort=PortRef)?
('targetPort' targetPort=PortRef)?
'}';
PortRef returns PortRef: {PortRef} referencedPort=[PortEvent];
PortEvent returns PortEvent:'PortEvent'{PortEvent} (=>'::'name=EString)?;
I would like to provide scoping rules for targetPort and sourcePort in such that the targetPort's scope should not contained PortRef assigned to sourcePort ( and vis versa).
big question here is : how can i know where am i ?
To do it, i need to know where i'm : the Context. Precisly, i would like have the "PortRef" instance as Context's return in the function getScope(context, Ereference), but it's not the case.
I tried this function scope_PortRef_referencedPort(Ctx,ref) in scope, but the Context passed in my function is an instance of CallService and not of PortRef like it supposed to be.
And that despite of the fact that i put {PortRef} intructions to force that the object creation.
Am i missing something ?
i hope i was clear.
Best regards.
F.
[Updated on: Sat, 02 February 2013 22:28] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04296 seconds