Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Extend Ocl parser.
Extend Ocl parser. [message #655933] Wed, 23 February 2011 11:33 Go to next message
Bontemps  is currently offline Bontemps Friend
Messages: 4
Registered: February 2011
Junior Member
Hi,

We are a group of students and we working on " Extend OCLParser for Another language (CCSL) ".

we have the project OCL ( Code source OClParser).

but what's the better way for extend OclParser ?

Solution(?) : extend directly the grammar (file .g) OCL and used ANTLR ?

The file .g , is it generated with ecore ?

Thanks for your time. Razz

rapport_intermédiaire(PDF FRENCH)
http://dl.free.fr/rPL620ga8

http://www.omgmarte.org/
Re: Extend Ocl parser. [message #655998 is a reply to message #655933] Wed, 23 February 2011 17:00 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You have two options:

The old LPG 2 parser
/org.eclipse.ocl/src/org/eclipse/ocl/parser/EssentialOCL.gi evolved to
be extensible for QVT. It is internally extended for Complete OCL. This
parser in its current form will be deprecated as from Eclipse OCL 3.2
but may be resurrected as a transformation from the new parser.

The new Xtext/ANTLR parser
/org.eclipse.ocl.examples.xtext.essentialocl/src/org/eclipse /ocl/examples/xtext/essentialocl/EssentialOCL.xtext
is extended internally by:

/org.eclipse.ocl.examples.xtext.completeocl/src/org/eclipse/ ocl/examples/xtext/completeocl/CompleteOCL.xtext
/org.eclipse.ocl.examples.xtext.oclinecore/src/org/eclipse/o cl/examples/xtext/oclinecore/OCLinEcore.xtext
/org.eclipse.ocl.examples.xtext.oclstdlib/src/org/eclipse/oc l/examples/xtext/oclstdlib/OCLstdlib.xtext

you should find this a much more promising avenue for extension; and
you get an editor almost for free.

Regards

Ed Willink


On 23/02/2011 11:34, Bontemps wrote:
> Hi,
> We are a group of students and we working on " Extend OCLParser for
> Another language (CCSL) ".
> we have the project OCL ( Code source OClParser).
> but what's the better way for extend OclParser ?
>
> Solution(?) : extend directly the grammar (file .g) OCL and used ANTLR ?
> The file .g , is it generated with ecore ?
>
> Thanks for your time. :p
> rapport_intermédiaire(PDF FRENCH)
> http://dl.free.fr/rPL620ga8
>
> http://www.omgmarte.org/
Re: Extend Ocl parser. [message #656160 is a reply to message #655933] Thu, 24 February 2011 11:30 Go to previous messageGo to next message
Bontemps  is currently offline Bontemps Friend
Messages: 4
Registered: February 2011
Junior Member
hi Edward,

thank you for your reply.

We find no connection between Meta modele ecore and File .g (grammar)
What is the relation between meta modele ecore and file .g ?

Thank you in advance.
Razz
Re: Extend Ocl parser. [message #656270 is a reply to message #656160] Thu, 24 February 2011 19:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

There are too many *.g files and *.ecore to try to guess which files in
which version of which plugin interest you.

Please express youir question more precisely.

Regards

Ed Willink


On 24/02/2011 11:30, Bontemps wrote:
> hi Edward,
>
> thank you for your reply.
>
> We find no connection between Meta modele ecore and File .g (grammar)
> What is the relation between meta modele ecore and file .g ?
>
> Thank you in advance. :p
Re: Extend Ocl parser. [message #656348 is a reply to message #656270] Fri, 25 February 2011 08:44 Go to previous messageGo to next message
Bontemps  is currently offline Bontemps Friend
Messages: 4
Registered: February 2011
Junior Member
Hi,

the file ocl.g is generated by a Meta modele or hand written ?

Thank.
Re: Extend Ocl parser. [message #656361 is a reply to message #656348] Fri, 25 February 2011 09:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

There is no ocl.g.

As I wrote before:

"There are too many *.g files and *.ecore to try to guess which files in
which version of which plugin interest you.

Please express youir question more precisely."

i.e. provide the full folder path and version/origin of "ocl.g".

It appears to me that you are probably not using Eclipse OCL.

Regards

Ed Willink

On 25/02/2011 08:44, Bontemps wrote:
> Hi,
> the file ocl.g is generated by a Meta modele or hand written ?
>
> Thank.
Re: Extend Ocl parser. [message #658498 is a reply to message #656361] Tue, 08 March 2011 18:09 Go to previous messageGo to next message
Julien Deantoni is currently offline Julien DeantoniFriend
Messages: 45
Registered: July 2009
Member
Hello Ed,

I' continuing the work hardly started by my students...

I have now a working editor of my new grammar based on OCL and generated from Xtext.

As a first test we simply extended the completeOCL.ecore and its xtext grammar.

I still have a problem, and this problem appears even before the introduction of new metaclass in the ecore.

I'm not able to "import" any uml model and to have the completion. Before it was not my priority I didn't care but now, I'd like to finalize this part.

Have you got an OCL file compliant with the CompleteOCL syntax which import a uml or any other model file ?

Consider a simple model where a 'A' class contains some 'B' class instances by using the 'myB' association

I tried this :
import MyImport : 'Simple.uml' 

context A
	inv test:
		self.myB.size() <> 0


What's wrong ?
Thanks in advance !

Regards,

Julien

[Updated on: Tue, 08 March 2011 18:10]

Report message to a moderator

Re: Extend Ocl parser. [message #658506 is a reply to message #658498] Tue, 08 March 2011 18:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Julien

The UML support is work in progress.

I had hoped that with the underlying Pivot model being UML-based, that
the UML support would be much easier than the Ecore support. There is
support for pure UML, but any practical UML involves a profile, which is
not yet supported.

I'm hoping to get this in Indigo, but it will be touch and go.

You may be able to workaround the limitations by exporting your UML to
Ecore for now.

/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/ex amples/test/xtext/models/RoyalAndLoyal.ocl
(and sibling files) will provide you with an Ecore (and other) examples.

There is no completeOCL.ecore. Did you mean CompleteOCLCST.ecore?

Regards

Ed Willink

On 08/03/2011 18:09, Julien DeAntoni wrote:
> Hello Ed,
>
> I' continuing the work hardly started by my students...
>
> I have now a working editor of my new grammar based on OCL and
> generated from Xtext.
> As a first test we simply extended the completeOCL.ecore and its xtext
> grammar.
>
> I still have a problem, and this problem appears even before the
> introduction of new metaclass in the ecore.
>
> I'm not able to "import" any uml model and to have the completion.
> Before it was not my priority I didn't care but now, I'd like to
> finalize this part.
>
> Have you got an OCL file compliant with the CompleteOCL syntax which
> import a uml or any other model file ?
>
> Consider a simple model where a 'A' class contains some 'B' class
> instances by using the 'myB' association
>
> I tried this :
> import MyImport : 'Simple.uml'
> context A
> inv test:
> self.myB.size() <> 0
>
>
> What's wrong ? Thanks in advance !
>
> Regards,
>
> Julien
Re: Extend Ocl parser. [message #658512 is a reply to message #658506] Tue, 08 March 2011 19:23 Go to previous message
Julien Deantoni is currently offline Julien DeantoniFriend
Messages: 45
Registered: July 2009
Member
Hi Ed !

Sometimes I feel ambitious but I have no real needs to work on uml so I'm going to work on ecore models Rolling Eyes

It's perfect for all my tests. A little point for future readers of this post, I founded the royalandloyal.ocl in
"
/org.eclipse.ocl.examples.project.royalandloyal/oclsrc/RoyalAndLoyal/RoyalAndLoyal.ocl"


Quote:

There is no completeOCL.ecore. Did you mean CompleteOCLCST.ecore?



Exactly ! I planned to make a mix between this metamodel and mine in order to provide a formal temporal extension to OCL.

Thanks for your message.
Good luck with the UML integration.

Regards,

Julien
Previous Topic:IMP
Next Topic:OCLInvalid Error
Goto Forum:
  


Current Time: Thu Apr 18 10:00:22 GMT 2024

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

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

Back to the top