Add Pacakge imports to the OclParser [message #534917] |
Thu, 20 May 2010 15:34 |
Eclipse User |
|
|
|
Originally posted by: philipp.berger.student.hpi.uni-potsdam.de
Hey guys,
I just tried to parse an OCL expression like
....self.oclAsType(MyType1)..., so I got a type not found exception,
which I could fix by giving the full qualified name of the class
....self.oclAsType(org::packageTwo::MyType1)...
This constraint is defined for an EClass in PackageOne, this package has
no references to PackageTwo, but I like to handle subclasses from
PackageTwo in the constraint.
This problem occured while using the org.eclipse.emf.importer.rose for
porting models. In the Rose context all expressions are defined without
full qualified names, but after importing the class visibility seems to
be changed.
So my question, is it possible to bind severall packages to the
OclParser to avoid full qualified names?
|
|
|
Re: Add Pacakge imports to the OclParser [message #534950 is a reply to message #534917] |
Thu, 20 May 2010 18:38 |
Ed Willink Messages: 7671 Registered: July 2009 |
Senior Member |
|
|
Hi Philipp
You don't make clear whether you are using a CompleteOCL document or a
casual EssentialOCL query.
For an EssentialOCL query it is your responsibility/capability to
configure the package registry, so it may be possible with some
imagination, but probably requires a lookup algorithm change.
For CompleteOCL, http://www.omg.org/issues/issue14599.txt suggests the
addition of an import declaration, although I had envisaged that
import 'uri'
would load a meta-model, requiring full package qualification.
The OCL specification makes extensive (almost exclusive) use of
unqualified names so perhaps:
import 'uri#/Package1'
should make Package1::Type1 avaialable as just Type1 and
import myuri : 'uri#/Package1'
should make Package1::Type1 available as just myuri::Type1.
The new Xtext editor supports the latter.
Regards
Ed Willink
On 20/05/2010 16:34, Philipp Berger wrote:
> Hey guys,
> I just tried to parse an OCL expression like
> ....self.oclAsType(MyType1)..., so I got a type not found exception,
> which I could fix by giving the full qualified name of the class
> ....self.oclAsType(org::packageTwo::MyType1)...
>
> This constraint is defined for an EClass in PackageOne, this package has
> no references to PackageTwo, but I like to handle subclasses from
> PackageTwo in the constraint.
>
> This problem occured while using the org.eclipse.emf.importer.rose for
> porting models. In the Rose context all expressions are defined without
> full qualified names, but after importing the class visibility seems to
> be changed.
>
>
> So my question, is it possible to bind severall packages to the
> OclParser to avoid full qualified names?
|
|
|
Powered by
FUDForum. Page generated in 0.05766 seconds