This service is archived, please use www.eclipse.org/forums


Home » Capella » Capella Studio » XText grammar generation issue in Capella Studio
XText grammar generation issue in Capella Studio [message #3624] Wed, 30 October 2019 08:42 Go to next message
paul.bouche.irt-saintexup is currently offline  paul.bouche.irt-saintexup
Messages: 5
Registered: February 2019
Junior Member
Hi,

Before explaining my issue I will give a bit of context.

I have defined a Capella extension using KitAlpha, generated it and used it. I am now trying to use an XText grammar to specify a part of that extension, ultimately the aim is to embedd it in the Sirius UI thanks to the Altran plugin (https://altran-mde.github.io/xtext-sirius-integration.io/).

However, I have issue in Capella Studio generating my XText grammar. I have created a XText project from the Kitalpha generated ecore and I have configured the project containing the ecore as a Xtext project. This allows XText to detect the ecore file when being imported in XText.

Once my grammar is written (I extracted the import part hereafter), I try to generate the XText artifacts and I have the following issue. I added both com.irt_saintexupery.capella.vp.availabilityassessment and com.irt_saintexupery.capella.vp.availabilityassessment.model to the dependencies in the MANIFEST, both of which are in the same workspace. I also tried to force the registration of the ecore and genmodel files in the mwe2 file but it did not suceed. I will need a bit of your help since I assume it is rather a configuration issue, maybe due to KitAlpha generation or Capella Studio.

// automatically generated by Xtext
grammar com.irt_saintexupery.capella.vp.availabilityassessment.xtext.FailurePropagation with org.eclipse.xtext.common.Terminals

import "http://www.irt-saintexupery.com/capella/AvailabilityAssessment"


 
0    [main] INFO  text.xtext.generator.XtextGenerator  - Initializing Xtext generator
12   [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
182  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project org.antlr.runtime at 'archive:file:/C:/Users/paul.bouche/Documents/Apps/capella-studio-1.3.1/plugins/org.antlr.runtime_3.2.0.v201101311130.jar!/' and using 'archive:file:/C:/Users/paul.bouche/Documents/Apps/capella-studio-1.3.1/plugins/org.antlr.runtime_4.3.0.v201502022030.jar!/' instead.
195  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project com.irt_saintexupery.capella.vp.availabilityassessment.xtext at 'file:/C:/Users/paul.bouche/Documents/owncloud/Documents/Technique/ATIPPIC/Capella_Model/Capella_Model/Capella_Packages/com.irt_saintexupery.capella.vp.availabilityassessment.xtext/'
196  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project com.irt_saintexupery.capella.vp.availabilityassessment.xtext.tests at 'file:/C:/Users/paul.bouche/Documents/owncloud/Documents/Technique/ATIPPIC/Capella_Model/Capella_Model/Capella_Packages/com.irt_saintexupery.capella.vp.availabilityassessment.xtext.tests/'
196  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project com.irt_saintexupery.capella.vp.availabilityassessment.xtext.ide at 'file:/C:/Users/paul.bouche/Documents/owncloud/Documents/Technique/ATIPPIC/Capella_Model/Capella_Model/Capella_Packages/com.irt_saintexupery.capella.vp.availabilityassessment.xtext.ide/'
196  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project com.irt_saintexupery.capella.vp.availabilityassessment.xtext.ui at 'file:/C:/Users/paul.bouche/Documents/owncloud/Documents/Technique/ATIPPIC/Capella_Model/Capella_Model/Capella_Packages/com.irt_saintexupery.capella.vp.availabilityassessment.xtext.ui/'
197  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project com.irt_saintexupery.capella.vp.availabilityassessment.xtext.ui.tests at 'file:/C:/Users/paul.bouche/Documents/owncloud/Documents/Technique/ATIPPIC/Capella_Model/Capella_Model/Capella_Packages/com.irt_saintexupery.capella.vp.availabilityassessment.xtext.ui.tests/'
203  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Using resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
392  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
396  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
411  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
411  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
515  [main] ERROR xt.generator.XtextGeneratorLanguage  - [XtextLinkingDiagnostic: null:4 Couldn't resolve reference to EPackage 'http://www.irt-saintexupery.com/capella/AvailabilityAssessment'., XtextLinkingDiagnostic: null:12 Couldn't resolve reference to EClassifier 'FailurePropagationTable'., XtextLinkingDiagnostic: null:18 Couldn't resolve reference to EClassifier 'FailurePropagationRelation'., XtextLinkingDiagnostic: null:25 Couldn't resolve reference to EClassifier 'Or'., XtextLinkingDiagnostic: null:28 Couldn't resolve reference to EClassifier 'And'., XtextLinkingDiagnostic: null:31 Couldn't resolve reference to EClassifier 'Not'., XtextLinkingDiagnostic: null:32 Couldn't resolve reference to EClassifier 'Not'., XtextLinkingDiagnostic: null:35 Couldn't resolve reference to EClassifier 'FailureComparison'., XtextLinkingDiagnostic: null:39 Couldn't resolve reference to EClassifier 'FailurePort'., XtextLinkingDiagnostic: null:51 Couldn't resolve reference to EClassifier 'FailureType'., TransformationDiagnostic: null:22 Cannot create type for BooleanExpression because its EPackage is unknown. (ErrorCode: UnknownMetaModelAlias)]
518  [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow com.irt_saintexupery.capella.vp.availabilityassessment.xtext.GenerateFailurePropagation: Problem parsing 'file:/C:/Users/paul.bouche/Documents/owncloud/Documents/Technique/ATIPPIC/Capella_Model/Capella_Model/Capella_Packages/com.irt_saintexupery.capella.vp.availabilityassessment.xtext/../com.irt_saintexupery.capella.vp.availabilityassessment.xtext/src/com/irt_saintexupery/capella/vp/availabilityassessment/xtext/FailurePropagation.xtext':
XtextLinkingDiagnostic: null:4 Couldn't resolve reference to EPackage 'http://www.irt-saintexupery.com/capella/AvailabilityAssessment'.
Re: XText grammar generation issue in Capella Studio [message #3628 is a reply to message #3624] Thu, 31 October 2019 02:54 Go to previous message
arnaud.dieumegard.obeo.fr is currently offline  arnaud.dieumegard.obeo.fr
Messages: 12
Registered: July 2019
Junior Member
Hi,

It may not be the cause but I would feel more confortable in your situation having a DSL without any "-" or "_" in qualified names (com.irt_saintexupery.capella.vp.availabilityassessment.xtex t.FailurePropagation) or NSURI ( http://www.irt-saintexupery.com/capella/AvailabilityAssessme nt) or even projects names (com.irt_saintexupery.capella.vp.availabilityassessment.xtex t).

May you could try such a refactoring.

Regards,
Arnaud
Previous Topic: Create diagram programmatically
Next Topic: How to unit test diagram related operations ?
Goto Forum:
  


Current Time: Sat Mar 28 03:06:47 EST 2020

Total time taken to generate the page: 0.01599 seconds