Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » ALF generation
ALF generation [message #1453893] Mon, 27 October 2014 17:15
Francois Le Fevre is currently offline Francois Le FevreFriend
Messages: 56
Registered: October 2014
Location: Paris Saclay, France
Member
Dear all,
I am trying to generate from ALF grammar thanks to the workflow mwe2 the whole java and xtend code through the usage of a maven plugin.
With the old version of ALF grammar there is no problem at all.
With the new one: I am getting in trouble.

The major difference is that it references other package and specification files:

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.omg.org/spec/ALF/20120827"


I am getting error because the applciation is not able to locate the different external element such as:

Caused by: org.eclipse.emf.mwe.core.ConfigurationException: Couldn't find an interface org.eclipse.uml2.codegen.ecore.genmodel.GenModelPackage
        at org.eclipse.emf.mwe.utils.StandaloneSetup.addRegisterGeneratedEPackage(StandaloneSetup.java:430)
        ... 40 more



or

Caused by: org.eclipse.emf.mwe.core.ConfigurationException: Couldn't find an interface org.eclipse.papyrus.uml.alf.alf.AlfPackage
        at org.eclipse.emf.mwe.utils.StandaloneSetup.addRegisterGeneratedEPackage(StandaloneSetup.java:430)
        ... 40 more


So I have no idea how to modify the generator workflow and the Meta-inf to make the workflow working.

if you have any advice, please do not hesitate.

Francois

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var fileExtensions = "alf"
var projectName = "org.eclipse.papyrus.uml.alf"

//grammarURI has to be platform:/resource as it is not on the classpath
var grammarURI = "platform:/resource/${projectName}/src/org/eclipse/papyrus/uml/alf/Alf.xtext"
var runtimeProject = "../${projectName}"
var generateXtendStub = true
var encoding = "UTF-8"

Workflow {
    bean = StandaloneSetup {
    	//flf
    	scanClassPath = true
    	// use an XtextResourceset throughout the process, which is able to resolve classpath:/ URIs.
    	resourceSet = org.eclipse.xtext.resource.XtextResourceSet:theResourceSet {}
    	
    	// add mappings from platform:/resource to classpath:/
    	uriMap = {
    		from = "platform:/resource/org.eclipse.xtext.xbase/"
    		to = "classpath:/"
    	}
    	uriMap = {
    		from = "platform:/resource/org.eclipse.xtext.common.types/"
    		to = "classpath:/"
    	}

        

    	
    	// register current projects and its siblings for platform URI map, as they are not on the classpath.
    	platformUri = "${runtimeProject}/.."
    	// The following two lines can be removed, if Xbase is not used.
    	//registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"

    	

    	
}
Previous Topic:Custom validation for Papyrus
Next Topic:how reverse engineering ?
Goto Forum:
  


Current Time: Mon Jul 06 18:34:22 GMT 2020

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

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

Back to the top