Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL with Xtext Artifacts
OCL with Xtext Artifacts [message #1852180] Tue, 03 May 2022 20:26 Go to next message
Sara Moh is currently offline Sara MohFriend
Messages: 3
Registered: August 2019
Junior Member
Hi everyone,

How can I use OCL with the Generated Xtext Artifacts of my DSL?
I want to use OCL2.4 for operations like pow(x), floor(), etc.

Is there any tutorial that can help me?

Thanks,
Sara
Re: OCL with Xtext Artifacts [message #1852182 is a reply to message #1852180] Wed, 04 May 2022 04:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7663
Registered: July 2009
Senior Member
Hi

There are at least three different questions that you might be asking.

Using OCL in your own custom DSL is hard. I have previously recommended that users consider the much better integrated Xbase before tackling the difficult path of emulating the OCLinEcore and QVTr solutions.

If you just want to use OCL validation then study the tutorials in the OCL documentation.

Use of math operations such as pow() from OCL is really the, how does OCL support libraries question, that everyone agrees is necessary but nobody solves...

... until now. My OCL 2022 workshop paper will introduce an extension to allow calls of Java defined operations direct from OCL so that Java libraries can be used without needing an OCL library [1]. This requires the semantics and code generation of static operations to be sorted out [2] and then optionally allows such statics to be packaged in a library if users want the extra indirection. Interpreted execution is working on the development branch. I am just polishing off the Java code generation before releasing it for 2022-06.

[3] tracks progress on a library tutorial; the original attempt foundered on lack of statics.

Regards

Ed Willink

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=394658
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=437192
[3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=415146

Re: OCL with Xtext Artifacts [message #1860264 is a reply to message #1852182] Tue, 25 July 2023 20:01 Go to previous message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
I am very interested in the ability to call arbitrary Java functions from OCL - mostly ones I've created myself.

I just pullled the source for OCL main branch and it looks like this isn't yet part of a release. Is that correct? Is it close?

(Specifically, I did not see the content of https://git.eclipse.org/r/c/ocl/org.eclipse.ocl/+/196729/1/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/EvaluateStringOperationsTest4.java#341) in the code I downloaded.


I could really use this capability - so much so that if I can help make it happen, I'll try.

[Updated on: Tue, 25 July 2023 20:15]

Report message to a moderator

Previous Topic:Validation Delegate noy found
Next Topic:Invariant both passes and fails ??
Goto Forum:
  


Current Time: Sun Jul 14 03:08:02 GMT 2024

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

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

Back to the top