Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Bidirectional imports
Bidirectional imports [message #1742679] Tue, 06 September 2016 11:22 Go to next message
Eclipse UserFriend
Hey everyone,

I have developed two DSLs, let's call them A and B. They work quite independently, however, there are supposed to be some cross references from one language to the other as well.

In the beginning of development there have only been cross references in one direction, so A imported B and referenced some of its elemets. That construct worked without any issues. However, when I tried to do the same the other way around, so that B imported A as well, I would get several errors related to initialization when starting the language's Eclipse instance.

Here an extract of the log:
Caused by: java.lang.NullPointerException
	at com.lang.controller.controller.impl.ControllerPackageImpl.init(ControllerPackageImpl.java:1297)
	at com.lang.controller.controller.ControllerPackage.<clinit>(ControllerPackage.java:59)
	... 196 more
Root exception:
java.lang.ExceptionInInitializerError
	at com.lang.autogen.autogen.impl.AutogenPackageImpl.init(AutogenPackageImpl.java:83)
	at com.lang.autogen.autogen.AutogenPackage.<clinit>(AutogenPackage.java:58)

Is there any way to allow imports in both directions? I have also tried to outsource the relevant parts to a third language, but obviously that resulted in a cycle, so that the same problem occurred. I can see that such cycles aren't desirable, but I cannot think of any other way allowing cross references bidirectionally. Does anyone have an idea?

Greets
Martin
Re: Bidirectional imports [message #1742690 is a reply to message #1742679] Tue, 06 September 2016 12:17 Go to previous message
Eclipse UserFriend
you should create a external metamodel or a common parent language for the affected types and use them in both dsls
Previous Topic:The method x() of type y must override a superclass method
Next Topic:xtext add cross reference in expression
Goto Forum:
  


Current Time: Wed Jul 23 17:54:10 EDT 2025

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

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

Back to the top