Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO]string operations and blackboxes
[QVTO]string operations and blackboxes [message #79920] Wed, 23 April 2008 22:42 Go to next message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

Hi,

I have strings like a<K->1,T->T1> and would like to separate parameters (in
this example, K and T) from their values (1 and T1). Apparently, QVTO
implements just a fraction of the string operations proposed in the spec,
making it very difficult (if possible at all) to "tokenize" strings. So, is
this a typical case for blackboxes? If so, how to implement them? Is there
any particularity or all I have to write is a plain (java?) class
implementing only the interface declared in the qvt file? Where to put my
classes?

Thanks,

César
Re: [QVTO]string operations and blackboxes [message #79935 is a reply to message #79920] Wed, 23 April 2008 23:24 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Cesar,

We have already implemented complete String operatons set according to the
spec.
But it was committed after M6, which you are apparently using.
We will produce integration build this week, so you could make use of it.

Anyway, once the QVT standard library does not implement all you want, you
have to blackbox it.
There was already mentioned meachism in this newsgroup -
see '[QVTO] Adding custom operations for primitive data types' topic.

This is an old way of blackboxing (came from Borland initial
contribution), we
plan to generate java skeletons from QVT operations headers.

So far, there is a helper String library available in QVTO, you access it
like this

import library Strings;

but most of its routine have been implemented in StdLib already.


Regards,
/Radek

On Thu, 24 Apr 2008 00:42:32 +0200, kaiserlautern <comouraf-lixo@yahoo.fr>
wrote:

> Hi,
>
> I have strings like a<K->1,T->T1> and would like to separate parameters
> (in this example, K and T) from their values (1 and T1). Apparently,
> QVTO implements just a fraction of the string operations proposed in the
> spec, making it very difficult (if possible at all) to "tokenize"
> strings. So, is this a typical case for blackboxes? If so, how to
> implement them? Is there any particularity or all I have to write is a
> plain (java?) class implementing only the interface declared in the qvt
> file? Where to put my classes?
>
> Thanks,
>
> César



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO]string operations and blackboxes [message #79950 is a reply to message #79935] Thu, 24 April 2008 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

Thanks, Radek,

Maybe I'm gonna wait for the integration build. Using the library, I got
strange things, like:

log(self.name); => prints out: b<k->1>

log(self.name.substring(0,self.name.indexOf('<'))) => prints out:
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@f2869f (eClass:
org.eclipse.emf.ecore.impl.EClassImpl@64419f (name: Invalid_Class)
(instanceClassName: null) (abstract: false, interface: false))

Is it something I missed? I just added the import library Strings to the
transformation.

César

"Radek Dvorak" <radek.dvorak@borland.com> a écrit dans le message de
news:op.t927bqovhj1a1g@czprl-rdvorak2.emea.borl.net...
> Hi Cesar,
>
> We have already implemented complete String operatons set according to the
> spec.
> But it was committed after M6, which you are apparently using.
> We will produce integration build this week, so you could make use of it.
>
> Anyway, once the QVT standard library does not implement all you want, you
> have to blackbox it.
> There was already mentioned meachism in this newsgroup -
> see '[QVTO] Adding custom operations for primitive data types' topic.
>
> This is an old way of blackboxing (came from Borland initial
> contribution), we
> plan to generate java skeletons from QVT operations headers.
>
> So far, there is a helper String library available in QVTO, you access it
> like this
>
> import library Strings;
>
> but most of its routine have been implemented in StdLib already.
>
>
> Regards,
> /Radek
>
> On Thu, 24 Apr 2008 00:42:32 +0200, kaiserlautern <comouraf-lixo@yahoo.fr>
> wrote:
>
>> Hi,
>>
>> I have strings like a<K->1,T->T1> and would like to separate parameters
>> (in this example, K and T) from their values (1 and T1). Apparently,
>> QVTO implements just a fraction of the string operations proposed in the
>> spec, making it very difficult (if possible at all) to "tokenize"
>> strings. So, is this a typical case for blackboxes? If so, how to
>> implement them? Is there any particularity or all I have to write is a
>> plain (java?) class implementing only the interface declared in the qvt
>> file? Where to put my classes?
>>
>> Thanks,
>>
>> César
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO]string operations and blackboxes [message #79965 is a reply to message #79935] Thu, 24 April 2008 13:25 Go to previous messageGo to next message
Adolfo Sanchez-Barbudo Herrera is currently offline Adolfo Sanchez-Barbudo HerreraFriend
Messages: 260
Registered: July 2009
Senior Member
Hi Radek,

I have recently started (again ¬¬!! ) a discussion in the OCL newsgroup
about the OCL and QVTo standard libraries. I precisely named you and
colleagues to join it ;).

Since there isn't too many people working around this. It could be
interesting having several points of view, and try to align them to
improve the OMG specification... Oh they seem Ken's word ;P.

I'm glad that you a have added the Std Lib to the CVS. I'll have to
download your code to contrast it with my approach ;).

Cheers,
Adolfo.

Radek Dvorak escribió:
> Hi Cesar,
>
> We have already implemented complete String operatons set according to
> the spec.
> But it was committed after M6, which you are apparently using.
> We will produce integration build this week, so you could make use of it.
>
> Anyway, once the QVT standard library does not implement all you want,
> you have to blackbox it.
> There was already mentioned meachism in this newsgroup -
> see '[QVTO] Adding custom operations for primitive data types' topic.
>
> This is an old way of blackboxing (came from Borland initial
> contribution), we
> plan to generate java skeletons from QVT operations headers.
>
> So far, there is a helper String library available in QVTO, you access
> it like this
>
> import library Strings;
>
> but most of its routine have been implemented in StdLib already.
>
>
> Regards,
> /Radek
>
> On Thu, 24 Apr 2008 00:42:32 +0200, kaiserlautern
> <comouraf-lixo@yahoo.fr> wrote:
>
>> Hi,
>>
>> I have strings like a<K->1,T->T1> and would like to separate
>> parameters (in this example, K and T) from their values (1 and T1).
>> Apparently, QVTO implements just a fraction of the string operations
>> proposed in the spec, making it very difficult (if possible at all) to
>> "tokenize" strings. So, is this a typical case for blackboxes? If so,
>> how to implement them? Is there any particularity or all I have to
>> write is a plain (java?) class implementing only the interface
>> declared in the qvt file? Where to put my classes?
>>
>> Thanks,
>>
>> César
>
>
>
Re: [QVTO]string operations and blackboxes [message #79977 is a reply to message #79965] Thu, 24 April 2008 14:05 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Adolfo,

Thanks for pinging me, I will join the discussion.

Our StdLib is just in the first phase, building a corresponding model for
available StdLib elements (if possible ;-)).
The approach taken now it's not complete and just builds the model
programmatically,
attaches adapters to operations - call handlers, written by hand in java ->
no QVT library source yet.
It's pretty fast call dispatching and no explicit switching code.

Actually, an analogous mechanism should be used in the next phase too.
The AST library model will be created from QVT concrete syntax -> from
which
an ecore model representing the java impl will be generated.
In a next step - code generation - initially empty java operation skeletons
(later customized by the user) will be generated.
The binding of java operation impls to AST model will be done
automatically when loading the library
for execution.

Basically, the user should write just operation headers etc. in QVT and a
proper
java type binding should be generated automatically.

Perhaps sounds a bit complex, but it should not address the StdLib only
but blackbox libs
in general. Also, the gen model to use and java impl binding might be
replacable by
different kinds of impls, simple by extending a common extension point.

So at the moment, not too much to see as a complete picture of an approach
in the code yet. ;-))

Actually, a uniform model approach made the StdLib content instantly and
correctly applicable in the code-completion
which we have committed recently. So it's not a bad way to go ;-).

Regard,
/Radek



On Thu, 24 Apr 2008 15:25:54 +0200, Adolfo Sánchez-Barbudo Herrera
<adolfosbh@opencanarias.com> wrote:

> Hi Radek,
>
> I have recently started (again ¬¬!! ) a discussion in the OCL newsgroup
> about the OCL and QVTo standard libraries. I precisely named you and
> colleagues to join it ;).
>
> Since there isn't too many people working around this. It could be
> interesting having several points of view, and try to align them to
> improve the OMG specification... Oh they seem Ken's word ;P.
>
> I'm glad that you a have added the Std Lib to the CVS. I'll have to
> download your code to contrast it with my approach ;).
>
> Cheers,
> Adolfo.
>
> Radek Dvorak escribió:
>> Hi Cesar,
>> We have already implemented complete String operatons set according to
>> the spec.
>> But it was committed after M6, which you are apparently using.
>> We will produce integration build this week, so you could make use of
>> it.
>> Anyway, once the QVT standard library does not implement all you want,
>> you have to blackbox it.
>> There was already mentioned meachism in this newsgroup -
>> see '[QVTO] Adding custom operations for primitive data types' topic.
>> This is an old way of blackboxing (came from Borland initial
>> contribution), we
>> plan to generate java skeletons from QVT operations headers.
>> So far, there is a helper String library available in QVTO, you access
>> it like this
>> import library Strings;
>> but most of its routine have been implemented in StdLib already.
>> Regards,
>> /Radek
>> On Thu, 24 Apr 2008 00:42:32 +0200, kaiserlautern
>> <comouraf-lixo@yahoo.fr> wrote:
>>
>>> Hi,
>>>
>>> I have strings like a<K->1,T->T1> and would like to separate
>>> parameters (in this example, K and T) from their values (1 and T1).
>>> Apparently, QVTO implements just a fraction of the string operations
>>> proposed in the spec, making it very difficult (if possible at all) to
>>> "tokenize" strings. So, is this a typical case for blackboxes? If so,
>>> how to implement them? Is there any particularity or all I have to
>>> write is a plain (java?) class implementing only the interface
>>> declared in the qvt file? Where to put my classes?
>>>
>>> Thanks,
>>>
>>> César
>>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO]string operations and blackboxes [message #79991 is a reply to message #79950] Thu, 24 April 2008 14:16 Go to previous message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi César,

The String operations using positions are 1 based, as well as with
collections.
The strange log record you can see is caused by 0 index at

self.name.substring(0,self.name.indexOf('<'))

so this call results in OclInvalid instance, as it can't give any result.

But you have made a good point, we have to log it meaningfully ;-)

/Radek


On Thu, 24 Apr 2008 12:22:13 +0200, kaiserlautern <comouraf-lixo@yahoo.fr>
wrote:

> Thanks, Radek,
>
> Maybe I'm gonna wait for the integration build. Using the library, I got
> strange things, like:
>
> log(self.name); => prints out: b<k->1>
>
> log(self.name.substring(0,self.name.indexOf('<'))) => prints out:
> org.eclipse.emf.ecore.impl.DynamicEObjectImpl@f2869f (eClass:
> org.eclipse.emf.ecore.impl.EClassImpl@64419f (name: Invalid_Class)
> (instanceClassName: null) (abstract: false, interface: false))
>
> Is it something I missed? I just added the import library Strings to the
> transformation.
>
> César
>
> "Radek Dvorak" <radek.dvorak@borland.com> a écrit dans le message de
> news:op.t927bqovhj1a1g@czprl-rdvorak2.emea.borl.net...
>> Hi Cesar,
>>
>> We have already implemented complete String operatons set according to
>> the spec.
>> But it was committed after M6, which you are apparently using.
>> We will produce integration build this week, so you could make use of
>> it.
>>
>> Anyway, once the QVT standard library does not implement all you want,
>> you have to blackbox it.
>> There was already mentioned meachism in this newsgroup -
>> see '[QVTO] Adding custom operations for primitive data types' topic.
>>
>> This is an old way of blackboxing (came from Borland initial
>> contribution), we
>> plan to generate java skeletons from QVT operations headers.
>>
>> So far, there is a helper String library available in QVTO, you access
>> it like this
>>
>> import library Strings;
>>
>> but most of its routine have been implemented in StdLib already.
>>
>>
>> Regards,
>> /Radek
>>
>> On Thu, 24 Apr 2008 00:42:32 +0200, kaiserlautern
>> <comouraf-lixo@yahoo.fr> wrote:
>>
>>> Hi,
>>>
>>> I have strings like a<K->1,T->T1> and would like to separate
>>> parameters (in this example, K and T) from their values (1 and T1).
>>> Apparently, QVTO implements just a fraction of the string operations
>>> proposed in the spec, making it very difficult (if possible at all) to
>>> "tokenize" strings. So, is this a typical case for blackboxes? If so,
>>> how to implement them? Is there any particularity or all I have to
>>> write is a plain (java?) class implementing only the interface
>>> declared in the qvt file? Where to put my classes?
>>>
>>> Thanks,
>>>
>>> César
>>
>>
>>
>> -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Previous Topic:[ATL]problems with called rules
Next Topic:Open Atl Editor Through Line Code
Goto Forum:
  


Current Time: Mon Oct 21 14:45:48 GMT 2019

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

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

Back to the top