Skip to main content



      Home
Home » Modeling » TMF (Xtext) » xtext and ocl(using ocl on xtext models)
xtext and ocl [message #1854281] Wed, 10 August 2022 06:20 Go to next message
Eclipse UserFriend
hi
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 14:21 Go to previous message
Eclipse UserFriend
Hi

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.

Regards

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


Current Time: Tue May 20 06:50:16 EDT 2025

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

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

Back to the top