Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » 2 DSLs, importURI + importedNamespace in one grammar?
2 DSLs, importURI + importedNamespace in one grammar? [message #901677] Tue, 14 August 2012 05:53
Michael Bischoff is currently offline Michael BischoffFriend
Messages: 14
Registered: August 2012
Junior Member
Hello,
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?

Best regards,
Michael


(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


Previous Topic:Coloring Comments
Next Topic:NullPointerException reading Xtext model outside of Eclipse
Goto Forum:
  


Current Time: Sat Feb 29 05:17:39 GMT 2020

Powered by FUDForum. Page generated in 0.04063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top