Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xtext and ocl(using ocl on xtext models)
xtext and ocl [message #1854281] Wed, 10 August 2022 10:20 Go to next message
navid shm is currently offline navid shmFriend
Messages: 1
Registered: August 2022
Junior Member
I'm trying to create a simple xtext project in which:
- user defines a model based on the xtext specified grammer in a file (e.g. model.dsl)
- user defines constraints in a separate file (e.g. constraints.ocl)
- the project (which is a *.jar file or running in eclipse UI) gets these files and validates the model file (models.dsl) based on constraints file (constraints.ocl)

what I'm looking for is a way to allow user to specify custom constraints using OCL to validate the model which created by xtext editor.

I already searched but couldn't find anything on implementing such project

* note: any grammer is fine, even greeting
* I tried implementing parts of OCL in my grammer and it was not a nice experience :)
* any better idea for replacing OCL with other eclipse tools for defining constraints is acceptable

Re: xtext and ocl [message #1854289 is a reply to message #1854281] Wed, 10 August 2022 18:21 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member

The Eclipse OCL project provides OCL support that includes Xtext-based editors.

If you just want OCL constraints on your models then you should find the OCLinEcore editor is exactly what you want. (The alternatives are manual Java, or Xtext Checks language, or ...)

If you really want to implement a 'better' OCL then you are heading down a very diffcult path for which a review of what Xbase provides would be a prudent first step.


Ed Willink
Previous Topic:Xtext spelling not working on camel case words
Next Topic:how is the qualified name calculated
Goto Forum:

Current Time: Thu Jul 25 13:15:48 GMT 2024

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

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

Back to the top