|Re: Import And Scoping [message #1009084 is a reply to message #1009078]
||Thu, 14 February 2013 11:58
| Alexander Nittka
Registered: July 2009
The comparison with java does not work out!|
a) not the file B.java extends the the file A.java, but the class B defined in B.java extends the class A in A.java
b) you don't use an import mechanism in java, but qualified names. The imports are only used to allow short names instead of the fully qualified names.
c) getABC() can be used in C because the scoping walks up the type hierarchy.
a) and b) is exactly what Xtext's qualified name fragment does for you. Resources (model files) export elements under a qualified name, other resources can reference these elements without explicitly having to import the containing files (as needed with the URI import).
c) you'll have to implement yourself using scoping because Xtext does not attach any meaning to a reference defined in the grammar.
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to firstname.lastname@example.org
Powered by FUDForum
. Page generated in 0.01994 seconds