Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Getting rid of fully qualified type names in ocl expressions
Getting rid of fully qualified type names in ocl expressions [message #1006546] Thu, 31 January 2013 16:00 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Hi,

In the OCL Example console (mature console) I need to use fully qualified type identifiers. Does OCL have some built-in mechanism to let me use unqualified type identifiers, e.g. Library instead of library::Library instead?

If there's no builtin mechanis, is it possible to hack the (again, mature) interpreter to find types magically, e.g. by inspecting registered EPackages?

Cheers,
Felix
Re: Getting rid of fully qualified type names in ocl expressions [message #1006561 is a reply to message #1006546] Thu, 31 January 2013 17:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The basic construction of an EcoreEnvironment takes a package registry.
You could poke as many packages as you like in to the registry.

Regards

Ed Willink


On 31/01/2013 16:00, Felix Dorner wrote:
> Hi,
>
> In the OCL Example console (mature console) I need to use fully
> qualified type identifiers. Does OCL have some built-in mechanism to
> let me use unqualified type identifiers, e.g. Library instead of
> library::Library instead?
>
> If there's no builtin mechanis, is it possible to hack the (again,
> mature) interpreter to find types magically, e.g. by inspecting
> registered EPackages?
>
> Cheers,
> Felix
>
Re: Getting rid of fully qualified type names in ocl expressions [message #1007098 is a reply to message #1006546] Mon, 04 February 2013 12:59 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Hi Ed,

qualified classifier names are not the problem. I want to dynamically resolve _unqualified_ classifier names against registered package. I could then just write "Author.allInstances()" instead of "library::Author.allInstances()". I think I could try to customize EcoreEnvironment.lookupClassifier() to implement such a dynamic cross-package lookup.

Felix
Re: Getting rid of fully qualified type names in ocl expressions [message #1007722 is a reply to message #1007098] Thu, 07 February 2013 10:07 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I think you may find lookupPackage easier. There is already a lookup for
no explicit package so you just need to broaden it.

Regards

Ed Willink


On 04/02/2013 12:59, Felix Dorner wrote:
> Hi Ed,
>
> qualified classifier names are not the problem. I want to dynamically
> resolve _unqualified_ classifier names against registered package. I
> could then just write "Author.allInstances()" instead of
> "library::Author.allInstances()". I think I could try to customize
> EcoreEnvironment.lookupClassifier() to implement such a dynamic
> cross-package lookup.
>
> Felix
Previous Topic:[Announce] Eclipse OCL 4.1.0 (Kepler) M5 is now available
Next Topic:Property::CompatibleInitialiser' constraint is not satisfied
Goto Forum:
  


Current Time: Sat Apr 20 03:42:47 GMT 2024

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

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

Back to the top