|
Re: Instantiate elements without having them visible in the syntax [message #766193 is a reply to message #766116] |
Thu, 15 December 2011 10:46 |
Meinte Boersma Messages: 434 Registered: July 2009 Location: Leiden, Netherlands |
Senior Member |
|
|
If I understand correctly, you want the Interface type to have a feature (an EReference, in fact) which is automagically assigned the enclosing/parent Port, without that being explicit in the syntax?
Then the answer is no: during the parse, values (strings, references, etc.) are always assigned exactly once. In your case, I'd say you're better off with a util method/derived property which simply uses EMF .eContainer() to get hold of the parent Port and decorate any Interface with the correct type. Xtend with its extensions is perfectly suited for that. Also remember that while a set of types is derived from an Xtext grammar (when not using external EPackages), the main responsibility of a grammar is defining the syntax.
Xtext blogs: executable models...again? | workshop material | custom scoping with Xtend
|
|
|
Powered by
FUDForum. Page generated in 0.03670 seconds