| Extension of the standard library [message #64114] | 
Tue, 04 November 2008 04:51   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
This is a multi-part message in MIME format. 
--------------060303020002080409030408 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed 
Content-Transfer-Encoding: 7bit 
 
Hi Christian, 
 
 
I managed to extend the standard library and added custom operations to  
OCL during the development of MTL. For this, I defined a model really  
close to what you did with oclstdlib.ecore and OCLStandardLibrary.java.  
The implementation of these custom operations is in the  
EvaluationEnvironment where I overrode CallOperation. 
 
What I did not manage to do though, was to create a custom operation  
which would return a typed sequence : my best try returned a  
"Sequence(T)". This forces me to use "oclAsType" after each invocation  
to accurately type the sequence. 
 
The operation I defined is a "typed" eAllContents for EObject in order  
to retrieve only the elements of a given type in the content tree of an  
element : "eAllContents(EClassifier) : Sequence(T)". Obviously, the type  
of the sequence content is known (EClassifier). Is there any way to  
force the OCL parser to type that sequence without a subsequent call to  
oclAsType? 
 
laurent Goubet 
Obeo 
 
--------------060303020002080409030408 
Content-Type: text/x-vcard; charset=utf-8; 
 name="laurent_goubet.vcf" 
Content-Transfer-Encoding: 7bit 
Content-Disposition: attachment; 
 filename="laurent_goubet.vcf" 
 
begin:vcard 
fn:Laurent Goubet 
n:Goubet;Laurent 
org:<a href="http://www.obeo.fr/">Obeo</a> 
email;internet:laurent.goubet@obeo.fr 
url:http://www.obeo.fr 
version:2.1 
end:vcard 
 
 
--------------060303020002080409030408--
 |  
 |  
  | 
 | 
 | 
| Re: Extension of the standard library [message #64214 is a reply to message #64185] | 
Tue, 04 November 2008 09:57   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: cdamus.zeligsoft.com 
 
Hi, Laurent, 
 
No problem.  It's nice to have more requestees on board to motivate this  
enhancement.  :-D 
 
cW 
 
laurent Goubet wrote: 
> Christian, 
>  
> Yep, seems like the same as mine, thanks and sorry for not searching ;). 
>  
> Laurent Goubet 
> Obeo 
>  
> Christian W. Damus a écrit : 
>> Hi, Laurent, 
>> 
>> I think that a solution for your problem is on the plan for the 1.3  
>> release.  See https://bugs.eclipse.org/179990 for details. 
>> 
>> HTH, 
>> 
>> Christian 
>> 
>> laurent Goubet wrote: 
>>> Hi Christian, 
>>> 
>>> 
>>> I managed to extend the standard library and added custom operations  
>>> to OCL during the development of MTL. For this, I defined a model  
>>> really close to what you did with oclstdlib.ecore and  
>>> OCLStandardLibrary.java. The implementation of these custom  
>>> operations is in the EvaluationEnvironment where I overrode  
>>> CallOperation. 
>>> 
>>> What I did not manage to do though, was to create a custom operation  
>>> which would return a typed sequence : my best try returned a  
>>> "Sequence(T)". This forces me to use "oclAsType" after each  
>>> invocation to accurately type the sequence. 
>>> 
>>> The operation I defined is a "typed" eAllContents for EObject in  
>>> order to retrieve only the elements of a given type in the content  
>>> tree of an element : "eAllContents(EClassifier) : Sequence(T)".  
>>> Obviously, the type of the sequence content is known (EClassifier).  
>>> Is there any way to force the OCL parser to type that sequence  
>>> without a subsequent call to oclAsType? 
>>> 
>>> laurent Goubet 
>>> Obeo 
>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.04160 seconds