Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extending EssentialOCL - scoping/linking not working
Extending EssentialOCL - scoping/linking not working [message #1632736] Tue, 24 February 2015 12:55 Go to next message
Kuba Sz. is currently offline Kuba Sz.Friend
Messages: 2
Registered: February 2015
Junior Member
Hi,

I am trying to create a DSL that extends EssentialOCL - for my purposes this should be something very similar to OCLinEcore.
So this is why I decided to start with building a DSL directly based on the OCLinEcore grammar.

At this point I managed to run MWE2 and generate the model. I looked at org.eclipse.ocl git repo and copied EssentailOCLfragment (as this is not available as a plugin).
However, when I am running the eclipse with my new DSL, I am getting linking errors - unresolved Property/Type. I think this is a scoping problem - but I have no idea what is the exact cause.

When I am opening sample source in OCLinEcore editor everything is fine, when I am opening in my editor I am getting those errors.

package model
{
class ClassA
{
attribute name : String
{
derivation: self.oclType().name;
...


in my editor popup says "ClassCS ClassA" when over ClassA
Problems view:
Unresolved Type 'ClassA' ... Problem
and
The required feature 'essentialoclcs::BinaryOperatorCS::argument' of 'TopLevelCS::PackageCS::ClassA::name::ExpSpecificationCS::InfixExpCS::.' must be set

while in OCLinEcore editor it says: "Class model::ClassA"

Do you have an idea what is not working or what is missing in comparison with OCLinEcore? and what is the meaning of the message? Could you help me?
Re: Extending EssentialOCL - scoping/linking not working [message #1632866 is a reply to message #1632736] Tue, 24 February 2015 14:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
have a look at the customizations in OCL Dsls Runtime and Ui Module + the default extension points (scoping etc)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 24 February 2015 14:33]

Report message to a moderator

Re: Extending EssentialOCL - scoping/linking not working [message #1632966 is a reply to message #1632736] Tue, 24 February 2015 15:45 Go to previous messageGo to next message
Kuba Sz. is currently offline Kuba Sz.Friend
Messages: 2
Registered: February 2015
Junior Member
Hi Christian,

Thank you very much for your answer.
I checked everything, adjusted when needed to have the same runtime + ui configuration as in OCLinEcore, but unfortunately the problem didnt disappear.

So lets put it in a different way. Is it possible to get an AST tree when linking errors occur (if possible at all - e.g. Sample Ecore Reflective Editor cannot handle this)? I need it for code generation - editor is less important to me.

Best regards,
Kuba
Re: Extending EssentialOCL - scoping/linking not working [message #1632988 is a reply to message #1632966] Tue, 24 February 2015 16:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
at the place of the linking you have access to the node model (DefaultLinkingService)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Extending EssentialOCL - scoping/linking not working [message #1633002 is a reply to message #1632988] Tue, 24 February 2015 16:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
btw from the error message it seems you do not have

	@Override
	public void configure(Binder binder) {
		super.configure(binder);
		binder.bindConstant().annotatedWith(Names.named(org.eclipse.xtext.validation.CompositeEValidator.USE_EOBJECT_VALIDATOR)).to(false);
	}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Extending EssentialOCL - scoping/linking not working [message #1634244 is a reply to message #1632736] Wed, 25 February 2015 07:03 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Please use the OCL newsgroup for OCL discussions.

The EssentialOCLFragment is in the ocl.examples.build plugin that you
can check out from GIT. It is only needed during code development, so it
does not clutter the release plugins.

EssentialOCL is much harder to extend than Xbase because it has distinct
CS and AS. Conversion between CS and AS is currently performed by manual
visitor code supported by Attribution classes that support the Xext
Scope APIs for lookup. Auto-generation of this code from a declarative
specification is just beginning to show promise and might be available
for Mars. In the meantime you must ensure that you understnad the
Attribution classes and implement the lookups for your language.

You might find the QVTc/QVTr implementations provide a better example of
an EssentialOCL extension.

Regards

Ed Willink


On 24/02/2015 14:19, Kuba Sz. wrote:
> Hi,
>
> I am trying to create a DSL that extends EssentialOCL - for my
> purposes this should be something very similar to OCLinEcore.
> So this is why I decided to start with building a DSL directly based
> on the OCLinEcore grammar.
>
> At this point I managed to run MWE2 and generate the model. I looked
> at org.eclipse.ocl git repo and copied EssentailOCLfragment (as this
> is not available as a plugin). However, when I am running the eclipse
> with my new DSL, I am getting linking errors - unresolved
> Property/Type. I think this is a scoping problem - but I have no idea
> what is the exact cause.
>
> When I am opening sample source in OCLinEcore editor everything is
> fine, when I am opening in my editor I am getting those errors.
>
> package model
> {
> class ClassA
> {
> attribute name : String
> {
> derivation: self.oclType().name;
> ..
>
> in my editor popup says "ClassCS ClassA" when over ClassA
> Problems view:
> Unresolved Type 'ClassA' ... Problem
> and
> The required feature 'essentialoclcs::BinaryOperatorCS::argument' of
> 'TopLevelCS::PackageCS::ClassA::name::ExpSpecificationCS::InfixExpCS::.'
> must be set
>
> while in OCLinEcore editor it says: "Class model::ClassA"
>
> Do you have an idea what is not working or what is missing in
> comparison with OCLinEcore? and what is the meaning of the message?
> Could you help me?
Previous Topic:Parsing expression between slash /
Next Topic:Problem in Cross reference resolution on serialization
Goto Forum:
  


Current Time: Fri Apr 19 04:36:57 GMT 2024

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

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

Back to the top