Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Best Practices for Xtext

Sascha Edwin Zander edited this page Sep 26, 2017 · 2 revisions

Cross References between 2 DSLs 1

If you are using 2 different Xtext grammars and one depends from the other you must add referencedResource = Resource path to genfile to the mwe2 file in the language section. Then you need to add the dependency to the plugin.xml Then you must import it with import "nsuri" as shortMetaModelName and now you can reference it with shortMetaModelName::ClassName.

IMPORTANT: the importing DSL may show you a warning with the content "The imported package refers to elements in the package registry instead of using the instances from the workspace". DON'T USE the quick fix because it leads to an error in the generator!

For further information visit Christian Dietrich's Blog

references

1: https://christiandietrich.wordpress.com/tag/cross-reference/