Parsing an ocl file (complete OCL) to define operations in an environment [message #1081566] |
Wed, 07 August 2013 07:49  |
Eclipse User |
|
|
|
Hello.
I'm a developer for an Eclipse project, and I need to provide the user with the possibility of writing his own OCL operations, that will be used by my mechanisms to extract relevant information from a model.
I'm familiar with how operations can be "manually" loaded into an environment (org.eclipse.ocl.Environment) object and then executed, however I'd like to parse an ocl file (edited with the Complete OCL editor) to retrieve operations and load them into an environment of my choice.
Could I just load the xtext model contained by the ocl file inside a resource set of my choice, and then use it to define the operations in my environment ? I'm pretty sure I could manage to comprehend pieces of the metamodel used by CompleteOCL and find the information I'm looking for, but does a utility class exist for loading the operations into an environment ? Any pointers would be greatly appreciated.
Thank you for your time.
|
|
|
Re: Parsing an ocl file (complete OCL) to define operations in an environment [message #1081621 is a reply to message #1081566] |
Wed, 07 August 2013 09:15  |
Eclipse User |
|
|
|
HI
As of Juno, there is a Load Complete OCL Resource menu option for
views/editors in which the selection is adaptable to an EObject.
This support adding OCL into a/the Xtext editor. See the Complete OCL
tutorial in the OCL Documentation.
You may find that this same approach or the underlying classes are
suitable for you.
Regards
Ed Willink
On 07/08/2013 12:49, Olivier Melois wrote:
> Hello.
> I'm a developer for an Eclipse project, and I need to provide the user
> with the possibility of writing his own OCL operations, that will be
> used by my mechanisms to extract relevant information from a model.
> I'm familiar with how operations can be "manually" loaded into an
> environment (org.eclipse.ocl.Environment) object and then executed,
> however I'd like to parse an ocl file (edited with the Complete OCL
> editor) to retrieve operations and load them into an environment of my
> choice.
> Could I just load the xtext model contained by the ocl file inside a
> resource set of my choice, and then use it to define the operations
> in my environment ? I'm pretty sure I could manage to comprehend
> pieces of the metamodel used by CompleteOCL and find the information
> I'm looking for, but does a utility class exist for loading the
> operations into an environment ? Any pointers would be greatly
> appreciated.
> Thank you for your time.
|
|
|
Powered by
FUDForum. Page generated in 0.05770 seconds