Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Two different DSL and the workflow
Two different DSL and the workflow [message #650311] Mon, 24 January 2011 11:25 Go to next message
jeremie is currently offline jeremieFriend
Messages: 233
Registered: April 2010
Senior Member
Hello everyblody.

I have create two dsl.
The first descibe "Rule" objecr in a file .metarepDSL
For example :
rule  rule1 {
	author jguidoux
	date 20/11/2011
	version v1
}


the other DSL use the declared rules in the other langagge.
the extension of this language is repoDSL
this is an example :
Repository test

import rules.*

Groupe g1 {
	rule rule1
}


With xtext, no problem, the content assist works. (I can find the reference to rule1)

But in the generator, when I run the workflow, I have this message :
[CODE][
1 error:
test.repoDSL - /home/jeremie/test/com.tocea.xtext.repositoryDSL.generator/s rc/model/test.repoDSL
6: Couldn't resolve reference to Rule 'rule1'.
java.lang.RuntimeException: Problems running workflow workflow.RepositoryDSLGenerator: Validation problems:
1 error:
test.repoDSL - /home/jeremie/test/com.tocea.xtext.repositoryDSL.generator/s rc/model/test.repoDSL
6: Couldn't resolve reference to Rule 'rule1'.
/CODE]

the workflow can't find the reference to the other language.
these two file are in the same folser : 'src/model"

this is my workflow ::

module workflow.RepositoryDSLGenerator

import org.eclipse.emf.mwe.utils.*

var targetDir = "src-gen"
var fileEncoding = "UTF-8"
var modelPath = "src/model"

Workflow {

	bean = StandaloneSetup {
		registerGeneratedEPackage = "com.tocea.emf.metaRepository.model.metaRepository.MetaRepositoryPackage"
		registerGeneratedEPackage = "com.tocea.emf.metaRepository.model.repository.RepositoryPackage"
	}
	
	component = org.eclipse.xtext.mwe.Reader {
	// lookup all resources on the classpath
	// useJavaClassPath = true

	// or define search scope explicitly
		path = modelPath

		// this class will be generated by the xtext generator 
		register = com.tocea.xtext.RepositoryDSLStandaloneSetup {}
		load = {
			slot = "repository"
			type = "Repository"
		}
	}

	component = org.eclipse.xpand2.Generator {
		expand = "templates::Template::main FOR repository"
		outlet = {
			path = targetDir
		}
		fileEncoding = fileEncoding
	}
}




I hope it is possible to do that.

Thanks,

Jérémie
Re: Two different DSL and the workflow [message #650323 is a reply to message #650311] Mon, 24 January 2011 12:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

in your workflow i can find

register = com.tocea.xtext.RepositoryDSLStandaloneSetup {}


but i should find something similar rgarding the other dsl too Wink

~ Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Two different DSL and the workflow [message #650329 is a reply to message #650323] Mon, 24 January 2011 12:28 Go to previous message
jeremie is currently offline jeremieFriend
Messages: 233
Registered: April 2010
Senior Member
Thanks,

That's the solution Smile

Jérémie
Previous Topic:Slightly OT: Cleanup Problems view
Next Topic:syntatic predicates in Xtext 2.0
Goto Forum:
  


Current Time: Fri Apr 26 15:06:59 GMT 2024

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

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

Back to the top