| Extending OCL MDT using Xtext [message #908955] |
Thu, 06 September 2012 05:46  |
Fi Fi Messages: 126 Registered: March 2010 |
Senior Member |
|
|
Dear all,
I try to extend OCL MDT (in my specific context) using xtext.
Briefly,
I define this grammar (I make just the import part)
grammar fa.zy.myocl.MyOCL with org.eclipse.ocl.examples.xtext.completeocl.CompleteOCL
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.eclipse.org/ocl/3.1.0/Pivot" as pivot
import "http://www.eclipse.org/ocl/3.1.0/EssentialOCLCST" as essentialocl
import "http://www.eclipse.org/ocl/3.1.0/CompleteOCLCST" as completeocl
import "platform:/resource/fa.zy.myocl/model/MyOCLCST.ecore"
in the workflow, I define:
Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerGeneratedEPackage = "org.eclipse.ocl.examples.pivot.PivotPackage"
registerGeneratedEPackage = "org.eclipse.ocl.examples.xtext.essentialocl.essentialOCLCST.EssentialOCLCSTPackage"
registerGeneratedEPackage = "org.eclipse.ocl.examples.xtext.completeocl.completeOCLCST.CompleteOCLCSTPackage"
registerGenModelFile = "platform:/resource/fa.zy.myocl/model/MyOCLCST.genmodel"
}
I have this famous problem:
2257 [main] ERROR ipse.xtext.generator.LanguageConfig - [
TransformationDiagnostic: null:11 Cannot find compatible feature oImport in sealed EClass MyOCLDocumentCS from imported package http://www.eclipse.org/myocl/MyOCLCST: The type 'MyOCLDocumentCS' does not have a feature 'oImport'. (ErrorCode: CannotCreateTypeInSealedMetamodel),
--It repeated for each model element--
2265 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module org.xtext.ocl.temporalocl.TemporalOCL: java.lang.reflect.InvocationTargetException
Please Help me
thanks
|
|
|
|
|
|
|
|
|
|
|
| Re: Extending OCL MDT using Xtext [message #910779 is a reply to message #910719] |
Mon, 10 September 2012 07:33   |
Ed Willink Messages: 3185 Registered: July 2009 |
Senior Member |
|
|
Hi
Currently only the OCLstdlib editor uses JVM references, so only the
OCLstdlib plugins and build script have the necessary declarations.
I found them slightly difficult to get right.
So either diff the OCLstdlib and CompleteOCL
manifest/plugin/.classpath/.project/*.mwe to see the differences
Or search the OCLstdlib artefacts for "jvm"
Or follow advice in the Xtext documentation, and messages on this newsgroup
to activate JVM references.
Regards
Ed Willink
On 10/09/2012 10:21, Fy Za wrote:
> Dear Ed,
> thank you for reply.
> I tried to use exactly the same approach as developing CompleteOCL,
> In Eclipse Juno, I
>
> 1) create xtext project
>
> 2)import plugins dependencies (org....completeocl_3.2.0, org.essentialocl_3.2.0,
> org........base_3.2.0 and org......pivot_3.2.0)
>
> 3)create a new folder named model and I put in my .ecore
>
> 4)I generate the gen model
>
> and when I try to generate the model code, many errors in the generator mwe2 are shown like (Couldn't resolve reference to JvmType 'Generator' and Couldn't resolve reference to JvmIdentifiableElement 'pathRtProject'.)
>
> I join the main project in this message
> please help me to correct these errors and generate my editor code.
>
> Thanks
|
|
|
|
|
| Re: Extending OCL MDT using Xtext [message #1043856 is a reply to message #1043363] |
Thu, 18 April 2013 03:44  |
ModelGeek Mising name Messages: 351 Registered: June 2011 |
Senior Member |
|
|
after adding specific operation to Standard library, i would like OCL editor to recognize newly added operations(intellisense) and i would also like to validate the ocl statement which will use newly added operations.
So to implement above mentioned functionality, do you think i will need extension of OCL grammer?
thanks for support!
Regards,
|
|
|
Powered by
FUDForum. Page generated in 0.01990 seconds