|2 DSLs, importURI + importedNamespace in one grammar? [message #901677]
||Tue, 14 August 2012 05:53
| Michael Bischoff
Registered: August 2012
I've now built my first DSL, and all is working fine.
I've followed the tutorial //christiandietrich.wordpress.com/category/xtext/ to implement another DSL, which builds on top of the first, to implement features I do not want in the core DSL.
Now I have to reference objects built with my first grammar (let's call it grammar A) from the second (grammar B). This works great, using the default implementation of the importedNamespace approach. (I have also extended ImportedNamespaceAwareLocalScopeProvider to support local implicit imports as shown in //www.eclipse.org/forums/index.php/t/359674/).
At this point, I want the ability to add global definitions to grammar B. These could be either explicit imports (preferred) or implicit imports (as mentioned in //blogs.itemis.de/stundzig/archives/795). In both approaches however, it seems to me that the importURI approach would be more suitable.
My problem is that whenever I try to mix importURI with the importedNamespace features in a single grammar, I get all kinds of exceptions. Some posts indicate that in fact it should be possible to do that.
It would be sufficient for me if importURIs always import grammar B files only and importedNamespace always references objects of the main DSL, grammar A.
Is there any guideline, how to achieve this?
(In case anyone is interested, my WIP DSL is here: //github.com/jpaw/bonaparte-dsl.git
grammar A is de.jpaw.bonaparte.dsl (working), grammar B is de.jpaw.persistence.dsl (WIP))
P.S.: https removed, could not post message before
Powered by FUDForum
. Page generated in 0.01656 seconds