|Setting the key value for a map from imported ecpre model [message #1032278]
||Tue, 02 April 2013 20:09
| Roza Ghamari
Registered: January 2013
I am writing a DSL for my ecore model in which I have references to map of <String, eObject>. The problem I have is that the DSL needs to follow the older versions of this languages so when I define a parser rule for map I cannot set the key. So my parser rule for map is
objMap returns MyEcoreEMap:
value = object
But as you can guess I get the error of having conflicts between key index 0 and 1 as the key string is not in the rule.
What I need is to set the key automatically based on the eObject.toString().
How can I solve this? I tried to modify the setTypedValue of the MyEcoreEmapImpl class (so that it sets the key automatically to eobject.toString() ) but that'd not the methods called for setting the value. I don't know which method is called when a map is used.
I think a post processing step with lazy linker may do it. But I don't have any idea how to do it and how it'd look like.
I really appreciate your help! Thanks.
[Updated on: Tue, 02 April 2013 22:24]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.11041 seconds