Extending OCL MDT using Xtext [message #908955] |
Thu, 06 September 2012 05:46  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #1220536 is a reply to message #1220524] |
Thu, 12 December 2013 07:18  |
Eclipse User |
|
|
|
Hi
Please use the OCL newsgropup for OCL queries.
The Essential OCL grammar is extended by:
- the OCL Stnadard Library grammar
- the Complete OCL grammar
- the OCL in Ecore grammar
- the QVT core grammar
- the QVT imp[erative grammar
- the QVT relations grammar
any of which can be examined for examples.
The QVTd examples are probably moe appropriate for you since you want a
separate project.
The OCL grammar APIs are not yet stable or documented and sadly not yet
nearly as easy to use as Xbase...
Regards
Ed Willink
On 12/12/2013 10:56, Stefan Mijatov wrote:
> Hi Ed,
>
> is there a way to integrate OCL grammar into my own, so that I can
> define an OCL constraint directly in my language, instead of having a
> reference to one in an *.ocl file?
>
> And how could I do that, if possible?
>
> Thanks a lot in advance,
> Stefan
|
|
|
Powered by
FUDForum. Page generated in 0.06032 seconds