Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Xtext and OCL references
Xtext and OCL references [message #1753480] Mon, 06 February 2017 23:07 Go to next message
Edouard R. Batot is currently offline Edouard R. BatotFriend
Messages: 100
Registered: March 2015
Senior Member
Hi,

I have a simple question Smile
I tried to play with the .xtext given in specification formalizing the EssentialOCL.

Now, I have a serious problem : why does this import :
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

doesn't rise errors but these other ones do rise "Couldn't resolve reference to EPackage ..." :
import "http://www.eclipse.org/ocl/3.1.0/Pivot" as pivot
import "http://www.eclipse.org/ocl/3.1.0/BaseCST" as base
import "http://www.eclipse.org/ocl/3.1.0/EssentialOCLCST"


Is it the address that is not right ?
Should I configure something ?

I wouldn't bother to ask if the first import was refused too, but this is confusing...
I just installed Xtext and took the file (attached) from M. Ed. (I want to have a personal AST for OCL and thought I could re-generate it from the xtext definition - maybe I'm wrong).

Thanks for attention,
have a good day.
Edouard
Re: Xtext and OCL references [message #1753489 is a reply to message #1753480] Tue, 07 February 2017 07:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The correct URI for the Pivot is http://www.eclipse.org/ocl/2015/Pivot so you are using some very obsolete sources. From your attachment:

* $Id: EssentialOCL.xtext,v 1.14 2011/05/21 14:55:09 ewillink Exp $

which is positively prehistoric. It looks as if you haven't realized that Eclipse moved from CVS to GIT years ago. The current imports are:

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "platform:/resource/org.eclipse.ocl.pivot/model/Pivot.ecore" as pivot
import "platform:/resource/org.eclipse.ocl.xtext.base/model/BaseCS.ecore" as base
import "platform:/resource/org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore"

Xtext is not good at distinguishing installed / workspace model ambiguities so imports need to be careful. A project preference suppresses warnings.

The default Xtext project structure imposes needless build clutter on the run-time, so OCL Xtext projects house all build infrastructure in the ocl.examples.build plugin.

If you want a variant OCL to 'co-exist' you need to be very sure that you use the variant nsURI EVERYWHERE.

Regards

Ed Willink
Re: Xtext and OCL references [message #1753490 is a reply to message #1753489] Tue, 07 February 2017 07:39 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Ed Willink wrote on Tue, 07 February 2017 02:26

It looks as if you haven't realized that Eclipse moved from CVS to GIT years ago.


I barely remember how to use CVS. I cannot find any references to it on OCL web pages.

https://wiki.eclipse.org/OCL/Dev/Setup#Getting_the_Sources_from_GIT was updated to declare CVS obsolete after Indigo. No clue as to the old CVS location is provided.

https://projects.eclipse.org/projects/modeling.mdt.ocl/developer lists only a GIT repo.

Where did you get the idea to use sources from CVS?

Regards

Ed Willink
Re: Xtext and OCL references [message #1753555 is a reply to message #1753490] Tue, 07 February 2017 16:47 Go to previous message
Edouard R. Batot is currently offline Edouard R. BatotFriend
Messages: 100
Registered: March 2015
Senior Member
Bonjour Ed,

I think the most honnest answer would be that I've never used Git, and I'm still on an SVN-way to deal with projects. I taught how to use Git though. I'm just not to much into the technologicalist vibe that overwhelms the coding community.

I got the source from the web, or from a colleague. We investigate OCL because it is the de-facto standard to express well-formedness rules, and I try to use as less as possible of the attached engineering complexity of the EMF thing.
Might sound stupid, or crazy, but focusing on the concept of constraints over a modeling space takes a lot of mental space already. I would like not to encumber myself too much with the side effects of the Eclipse machinery.

For now I try to automatically rebuild defective rules and I found it complicated to directly deal with the AST of eclipse.ocl. That's why I thought of using the Xtext to regenerate an easy-to-modify AST. I usually like to recreate a lighter version in order to ensure I understand deeply what's happening. But I'm getting lost on that side... So, well, I have no other option for now but to try dealing directly with the original AST : today, I modify nodes with the help of EcoreFactory.

And I'm gonna see the Git side.

Bref, thanks a lot for your help.
Edouard
Previous Topic:Query to return Classes that use a given Enumeration
Next Topic:false or null = null?
Goto Forum:
  


Current Time: Fri Apr 19 03:19:07 GMT 2024

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

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

Back to the top