Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Reference DSL a in second DSL b (solved)
Reference DSL a in second DSL b (solved) [message #669954] Thu, 12 May 2011 07:46
Sven Kasten is currently offline Sven KastenFriend
Messages: 8
Registered: May 2011
Junior Member
Hello everybody,

I am new to the XText modeling world. I already have done the beginner tutorials and created an DSL with different XPand templates etc.

Now I wan't to create two DSLs where DSL2 (presentation) uses elements of DSL1 (domain). Later at runtime I want to write two files: one for the domain-model and a second one for the presentation model. In the presentation-model I want to import the domain-model to use the elements of it.

For this I created two XText-projects plus generators. In the first I defined my Domain-modeling-language. I tested it as Eclipse App and it works of course. Then I exported it as plugin to the modeling-eclipse-distribution (the distribution package from the xtext-eclipse side build on eclipse galileo).

After that I created my presentation-modeling-language. The first lines of the language are the following:
grammar a.b.PDL with a.b.DDL

import "h**p://www.b.a/DDL"

generate pDL "h**p://www.b.a/PDL"

ViewModel :
	(imports+=DomainModel)*
	(views+=View)*;
	
Import :
	'import' importURI=STRING;


To resolve the dependencies I simply added the three projects of DSL1 to the "Required plugins" of the plugin.xml.

Now when I try to run the Presentation-language-project as Eclipse App I get:
0    [Thread-1] WARN  org.eclipse.xtext.service.AbstractGenericModule  - Trying to use method public java.lang.Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> a.b.AbstractPDLUiModule.bindIContentProposalProvider() for configuration failed


I don't know if this is the correct way. I have read about the DSL linking on different sites and tried the plugin-dependency-thing by myself.

Is this the correct way to do this? Is there a correct and comprehensive documentation for this?


Edit: Okay I solved my Problem by myself. I was wrong with the "(imports+=DomainModel)*". It should be of couse an "Import" instead of the "DomainModel". Also I changed the extended grammar back to standard Terminals and added "<registerGeneratedEPackage value="a.b.dDL.DDLPackage"/>" to the workflow. Now all things work fine! Smile


Thanks for the help!
Sven


PS: I had to remove the links in the code to post this message. h**p means http of course! Wink

[Updated on: Thu, 12 May 2011 08:57]

Report message to a moderator

Previous Topic:[XText] Two levels of grammar?
Next Topic:[XText] Problems getting grammar working
Goto Forum:
  


Current Time: Fri Apr 26 22:49:00 GMT 2024

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

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

Back to the top