Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Extending OCL : visitor problems
Extending OCL : visitor problems [message #809868] Wed, 29 February 2012 06:28 Go to next message
Damien Lenci is currently offline Damien Lenci
Messages: 2
Registered: February 2012
Junior Member
Hello,

I'm a student currently working on extending OCL with another language : CCSL (INRIA project under the tutoring of Julien Deantoni)

I'm having trouble understanding the role of the different visitors (PreOrder, PostOrder, Left2Right, Scope).
Is there any document explaining how they work or how to allow them visiting the new elements introduced in CCSL?

Thanks in advance,
Damien Lenci
Re: Extending OCL : visitor problems [message #809981 is a reply to message #809868] Wed, 29 February 2012 09:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4008
Registered: July 2009
Senior Member
Hi

No there is no documentation; one of many jobs to do before promotion.
They should be extensible; see the EssentialOCL CS accept methods that
all do a getAdapter downcast. The Visitor infrastructure is
auto-generated by Acceleo templates in the build plugin. The accept
methods could probably be autogenerated too now that Bug 326130 has been
fixed. Raise bugs for anything that isn't extensible.

The PreOrder phase establishes the major structural objects with names,
aware that child objects do not exist, the visit may drop Continuations
to be resolved in a polled fashion.

Then the PostOrder finishes off, the original intention being to resolve
references, but the complex nature of operation template parameters
means that most references are actualy resolved during PreOrder
continuations.

During the PostOrder traversal the Left2Right visitor is dispatched to
sort out expressions which can be fully resolved in a left-to-right
traversal.

The ScopeVisitor provides the ScopeAdapter that returns scope specific
names.

These are all manually written and being gradually simplified; the
intention is to autogenerate all the above from an OCL-like, perhaps
QVTr, definition of the visible names in a scope and the CST to AST
mapping. This modeled definition will replace the synthesized
attributes/environment definitions in the OCL spec. The same
auto-generation should support at least QVTr and QVTc. Once
auto-generated, the polled continuations should be resolvable in a
deterministic fashion. One day the CST to AST mapping may be defined by
OCL equations so that the Impact Analyzer can be used to perform a fast
incremental update.

Regards

Ed Willink

On 29/02/2012 11:28, Damien Lenci wrote:
> Hello,
>
> I'm a student currently working on extending OCL with another language
> : CCSL (INRIA project under the tutoring of Julien Deantoni)
>
> I'm having trouble understanding the role of the different visitors
> (PreOrder, PostOrder, Left2Right, Scope).
> Is there any document explaining how they work or how to allow them
> visiting the new elements introduced in CCSL?
>
> Thanks in advance,
> Damien Lenci
Re: Extending OCL : visitor problems [message #810012 is a reply to message #809868] Wed, 29 February 2012 10:07 Go to previous messageGo to next message
Damien Lenci is currently offline Damien Lenci
Messages: 2
Registered: February 2012
Junior Member
Thanks for your quick reply!

I will look further into the Acceleo templates to see if i can generate what i need.

Damien Lenci
Re: Extending OCL : visitor problems [message #810082 is a reply to message #810012] Wed, 29 February 2012 12:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4008
Registered: July 2009
Senior Member
Hi

Remember that OCLinEcore/CompleteOCL/OCLstdlib are all extensions of
EssentialOCL, so if you want yet another extension of EssentialOCL you
can use one of the existing extensions as an example.

Regards

Ed Willink

On 29/02/2012 15:07, Damien Lenci wrote:
> Thanks for your quick reply!
>
> I will look further into the Acceleo templates to see if i can
> generate what i need.
>
> Damien Lenci
Re: Extending OCL : visitor problems [message #830393 is a reply to message #810082] Tue, 27 March 2012 11:14 Go to previous messageGo to next message
Julien DeAntoni is currently offline Julien DeAntoni
Messages: 30
Registered: July 2009
Member
Hi Ed,

I extended CompleteOCL with the notion of event (ECLDocument), I have first results without any modification of existing projects.

I want to be able to make my own import to add library of event relations. This imports are contained in the root class and the concrete syntax is not ambiguous with the one of OCL.
However I'm not able to get elements from my library conjointly with the existing management of the OCL import.
(In fact I have to choose if myScopeProvider is extending CompleteOCLScopeProvider (from CompleteOCL) or AbstractDeclarativeScopeProvider (from the xtext).

If it extends CompleteOCLScopeProvider, I do not know how/where to add the EObject to be considered like "in the scope" of the whole specification...

How do you think I can deal with this ?

thanks,

julien
Re: Extending OCL : visitor problems [message #830416 is a reply to message #830393] Tue, 27 March 2012 11:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4008
Registered: July 2009
Senior Member
Hi Julien

I'm afraid that you are on your own.

Migrating the scope providers to be auto-generated from a model is high
on my priority list. You will then be able to specify your extended name
visibility model for use with your extended grammar; similarly
auto-generation of CST to AST mapping.

If you want to reuse any of the OCL name resolution you should extend
CompleteOCLScopeProvider, but perhaps use
org.eclipse.ocl.examples.xtext.oclstdlib.scoping as inspiration since
OCL stdlib extends EssentialOCL with embedded OCL without everything
being pushed up to the Base CST model.

If you're at EclipseCon we can probably talk this evening.

Regards

Ed Willink

On 27/03/2012 11:14, Julien DeAntoni wrote:
> Hi Ed,
>
> I extended CompleteOCL with the notion of event (ECLDocument), I have
> first results without any modification of existing projects.
> I want to be able to make my own import to add library of event
> relations. This imports are contained in the root class and the
> concrete syntax is not ambiguous with the one of OCL.
> However I'm not able to get elements from my library conjointly with
> the existing management of the OCL import.
> (In fact I have to choose if myScopeProvider is extending
> CompleteOCLScopeProvider (from CompleteOCL) or
> AbstractDeclarativeScopeProvider (from the xtext).
>
> If it extends CompleteOCLScopeProvider, I do not know how/where to add
> the EObject to be considered like "in the scope" of the whole
> specification...
>
> How do you think I can deal with this ?
>
> thanks,
>
> julien
Re: Extending OCL : visitor problems [message #830619 is a reply to message #830416] Tue, 27 March 2012 18:01 Go to previous message
Julien DeAntoni is currently offline Julien DeAntoni
Messages: 30
Registered: July 2009
Member
Hi Ed,

thanks for the hint I will have a look at the stdlib scoping files for inspiration Smile

I'm unfortunately not in EclipseCon Sad but I should be at the next omg meeting perhaps talking about the OCL extension.

Enjoy your week !
Best regards

j.
Previous Topic:How to do a transformation from Person to Families
Next Topic:Pivot OCL
Goto Forum:
  


Current Time: Mon Jul 28 14:26:38 EDT 2014

Powered by FUDForum. Page generated in 0.01799 seconds