|
|
|
|
|
|
|
|
Re: TMF Generator does not do anything [message #895974 is a reply to message #895953] |
Mon, 16 July 2012 17:51 |
Amneris T Messages: 15 Registered: June 2012 |
Junior Member |
|
|
file -> new -> Xtext project from Ecore
select genmodel, select root element -> next -> finish
in .xtext file, I change the import of the existing ecore to a platform uri
then I create several uriMaps for the platform:/plugin... models to platform:/resource/... models and add
fragment = org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment {
referencedGenModels = "platform:/resource/uriOfMyDslGenModel.genmodel"
}
to the mwe workflow because i mix generated and imported ecore models.
So my mwe workflow looks like this:
module de.test.mydsl.MyDsl
import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*
var grammarURI = "classpath:/de/test/mydsl/MyDsl.xtext"
var file.extensions = "mydsl"
var projectName = "de.test.mydsl"
var runtimeProject = "../${projectName}"
Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
uriMap = {
from = "platform:/plugin/org.eclipse.emf.ecore/model/XMLNamespace.genmodel"
to = "platform:/resource/org.eclipse.emf.ecore/model/XMLNamespace.genmodel"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.ecore/model/XMLNamespace.ecore"
to = "platform:/resource/org.eclipse.emf.ecore/model/XMLNamespace.ecore"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
to = "platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel"
to = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore"
to = "platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.ecore"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore"
to = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.ecore/model/XMLNamespace.genmodel"
to = "platform:/resource/org.eclipse.emf.ecore/model/XMLNamespace.genmodel"
}
uriMap = {
from = "platform:/plugin/org.eclipse.emf.ecore/model/XMLNamespace.ecore"
to = "platform:/resource/org.eclipse.emf.ecore/model/XMLNamespace.ecore"
}
}
component = DirectoryCleaner {
directory = "${runtimeProject}/src-gen"
}
component = DirectoryCleaner {
directory = "${runtimeProject}.ui/src-gen"
}
component = Generator {
pathRtProject = runtimeProject
pathUiProject = "${runtimeProject}.ui"
projectNameRt = projectName
projectNameUi = "${projectName}.ui"
language = {
uri = grammarURI
fileExtensions = file.extensions
// mixing generated and imported ecore models
// compare: Using Resource URIs to Import Existing EPackages at:
// http://www.eclipse.org/Xtext/documentation/2_0_0/020-grammar-language.php
fragment = org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment {
referencedGenModels = "platform:/resource/uriOfMyDslGenModel.genmodel"
}
// Java API to access grammar elements (required by several other fragments)
fragment = grammarAccess.GrammarAccessFragment {}
// generates Java API for the generated EPackages
// fragment = ecore.EcoreGeneratorFragment {}
// the serialization component
fragment = parseTreeConstructor.ParseTreeConstructorFragment {}
// a custom ResourceFactory for use with EMF
fragment = resourceFactory.ResourceFactoryFragment {
fileExtensions = file.extensions
}
// the Antlr parser
fragment = parser.antlr.XtextAntlrGeneratorFragment {
options = {
classSplitting = true
}
}
// the Ecore2Xtext specific terminal converter
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment {}
// java-based API for validation
fragment = validation.JavaValidatorFragment {
// composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
// scoping and exporting API
//fragment = scoping.ImportURIScopingFragment {}
//fragment = exporting.SimpleNamesFragment {}
// scoping and exporting API
fragment = scoping.ImportNamespacesScopingFragment {}
fragment = exporting.QualifiedNamesFragment {}
// formatter API
fragment = ecore2xtext.FormatterFragment {}
// labeling API
fragment = labeling.LabelProviderFragment {}
// outline API
fragment = outline.OutlineTreeProviderFragment {}
fragment = outline.QuickOutlineFragment {}
// java-based API for content assistance
fragment = contentAssist.JavaBasedContentAssistFragment {}
// antlr parser generator tailored for content assist
fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
options = {
classSplitting = true
}
}
fragment = builder.BuilderIntegrationFragment {}
// generator API
fragment = generator.GeneratorFragment {
generateMwe = true
generateJavaMain = true
}
// rename refactoring
fragment = refactoring.RefactorElementNameFragment {}
// provides the necessary bindings for java types integration
fragment = types.TypesGeneratorFragment {}
// generates the required bindings only if the grammar inherits from Xbase
// fragment = xbase.XbaseGeneratorFragment {}
// provides a preference page for template proposals
fragment = templates.CodetemplatesGeneratorFragment {}
// provides a compare view
fragment = compare.CompareFragment {
fileExtensions = file.extensions
}
// project wizard (optional)
// fragment = projectWizard.SimpleProjectWizardFragment {
// generatorProjectName = "${projectName}.generator"
// modelFileExtension = file.extensions
// }
// quickfix API
fragment = quickfix.QuickfixProviderFragment {}
}
}
}
do you see the error in these lines? thank you for your time!
[Updated on: Mon, 16 July 2012 17:54] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08777 seconds