Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] mapping main or just main (Newbie question)
[QVTO] mapping main or just main (Newbie question) [message #104087] Sat, 25 April 2009 11:03 Go to next message
Toñi  Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Hi all,

I'm just starting with QVTO, and to be familiar with the tool, I'm
using the examples included in the book named "Modeling Project: A
Domain-Specific Language (DSL) Toolkit".

In the book there's a simple example for refactoring a model. I'm
writing this transformation from scratch, but something curious
happened, and I'd like to know if it is a QVT compiler problem or
there's something more.

I have started the example by using the Eclipse assitant: New >
Other> Operational QVT Transformation. As a result, a new file with
..qvto extension is created. In the created file, the assistant has
generated a skeleton similar to the following one:

transformation reset();

mapping main() {

}

Then I write the rest of the transformation code (following the book
example). Thus, the mapping main has the following implementation:

mapping main() {
model.rootObjects()[Model].groups.map resetValues();
}

However, the compiler reports an error and saying that it expects a
:= instead a . just after model.

I have solved the problem by deleting the word mapping, thus the main
is now:

main() {
model.rootObjects()[Model].groups.map resetValues();
}

My question is if this error is due to a compiler QVT implementation
problem, or if the word mapping means something that cause the
compilation error.

Thanks,
Toñi
Re: [QVTO] mapping main or just main (Newbie question) [message #104104 is a reply to message #104087] Sat, 25 April 2009 12:17 Go to previous messageGo to next message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
Hi Toni,

Just ignore the "mapping main" references in the book. They were written
using a legacy "feature" of QVT, and should all just be main() without the
mapping keyword.

Thanks,
Rich


On 4/25/09 7:03 AM, in article gsuqmn$mgm$1@build.eclipse.org, "Toñi Reina
Quintero" <reinaqu@lsi.us.es> wrote:

> Hi all,
>
> I'm just starting with QVTO, and to be familiar with the tool, I'm
> using the examples included in the book named "Modeling Project: A
> Domain-Specific Language (DSL) Toolkit".
>
> In the book there's a simple example for refactoring a model. I'm
> writing this transformation from scratch, but something curious
> happened, and I'd like to know if it is a QVT compiler problem or
> there's something more.
>
> I have started the example by using the Eclipse assitant: New >
> Other> Operational QVT Transformation. As a result, a new file with
> .qvto extension is created. In the created file, the assistant has
>
> generated a skeleton similar to the following one:
>
> transformation reset();
>
> mapping main() {
>
> }
>
> Then I write the rest of the transformation code (following the book
> example). Thus, the mapping main has the following implementation:
>
> mapping main() {
> model.rootObjects()[Model].groups.map resetValues();
> }
>
> However, the compiler reports an error and saying that it expects a
> := instead a . just after model.
>
> I have solved the problem by deleting the word mapping, thus the main
> is now:
>
> main() {
> model.rootObjects()[Model].groups.map resetValues();
> }
>
> My question is if this error is due to a compiler QVT implementation
> problem, or if the word mapping means something that cause the
> compilation error.
>
> Thanks,
> Toñi

--
Thanks,
Rich
Re: [QVTO] mapping main or just main (Newbie question) [message #104114 is a reply to message #104104] Sat, 25 April 2009 14:06 Go to previous messageGo to next message
Toñi  Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Ok,

thanks Richard. Then, I think the template for generating the
scheleton code should be modified, because the code generated by the
assistant is the one I show below, and as it can be seen, it has the
"mapping main".

transformation reset();

mapping main() {

}

Richard Gronback escribió:
> Hi Toni,
>
> Just ignore the "mapping main" references in the book. They were written
> using a legacy "feature" of QVT, and should all just be main() without the
> mapping keyword.
>
> Thanks,
> Rich
>
>
> On 4/25/09 7:03 AM, in article gsuqmn$mgm$1@build.eclipse.org, "Toñi Reina
> Quintero" <reinaqu@lsi.us.es> wrote:
>
>> Hi all,
>>
>> I'm just starting with QVTO, and to be familiar with the tool, I'm
>> using the examples included in the book named "Modeling Project: A
>> Domain-Specific Language (DSL) Toolkit".
>>
>> In the book there's a simple example for refactoring a model. I'm
>> writing this transformation from scratch, but something curious
>> happened, and I'd like to know if it is a QVT compiler problem or
>> there's something more.
>>
>> I have started the example by using the Eclipse assitant: New >
>> Other> Operational QVT Transformation. As a result, a new file with
>> .qvto extension is created. In the created file, the assistant has
>>
>> generated a skeleton similar to the following one:
>>
>> transformation reset();
>>
>> mapping main() {
>>
>> }
>>
>> Then I write the rest of the transformation code (following the book
>> example). Thus, the mapping main has the following implementation:
>>
>> mapping main() {
>> model.rootObjects()[Model].groups.map resetValues();
>> }
>>
>> However, the compiler reports an error and saying that it expects a
>> := instead a . just after model.
>>
>> I have solved the problem by deleting the word mapping, thus the main
>> is now:
>>
>> main() {
>> model.rootObjects()[Model].groups.map resetValues();
>> }
>>
>> My question is if this error is due to a compiler QVT implementation
>> problem, or if the word mapping means something that cause the
>> compilation error.
>>
>> Thanks,
>> Toñi
>
Re: [QVTO] mapping main or just main (Newbie question) [message #104194 is a reply to message #104114] Mon, 27 April 2009 13:53 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Toni,

I suggest that you use milestone or integration builds from the current
Galileo development stream.
It provides a richer set of QVT language features and also reports
deprecation
warnings on legacy constructs, so it could be helpful to get over problems
like this.

Regards,
/Radek



On Sat, 25 Apr 2009 16:06:06 +0200, Toñi Reina Quintero
<reinaqu@lsi.us.es> wrote:

> Ok,
>
> thanks Richard. Then, I think the template for generating the
> scheleton code should be modified, because the code generated by the
> assistant is the one I show below, and as it can be seen, it has the
> "mapping main".
>
> transformation reset();
>
> mapping main() {
>
> }
>
> Richard Gronback escribió:
>> Hi Toni,
>> Just ignore the "mapping main" references in the book. They were
>> written
>> using a legacy "feature" of QVT, and should all just be main() without
>> the
>> mapping keyword.
>> Thanks,
>> Rich
>> On 4/25/09 7:03 AM, in article gsuqmn$mgm$1@build.eclipse.org, "Toñi
>> Reina
>> Quintero" <reinaqu@lsi.us.es> wrote:
>>
>>> Hi all,
>>>
>>> I'm just starting with QVTO, and to be familiar with the tool, I'm
>>> using the examples included in the book named "Modeling Project: A
>>> Domain-Specific Language (DSL) Toolkit".
>>>
>>> In the book there's a simple example for refactoring a model. I'm
>>> writing this transformation from scratch, but something curious
>>> happened, and I'd like to know if it is a QVT compiler problem or
>>> there's something more.
>>>
>>> I have started the example by using the Eclipse assitant: New >
>>> Other> Operational QVT Transformation. As a result, a new file with
>>> .qvto extension is created. In the created file, the assistant has
>>>
>>> generated a skeleton similar to the following one:
>>>
>>> transformation reset();
>>>
>>> mapping main() {
>>>
>>> }
>>>
>>> Then I write the rest of the transformation code (following the book
>>> example). Thus, the mapping main has the following implementation:
>>>
>>> mapping main() {
>>> model.rootObjects()[Model].groups.map resetValues();
>>> }
>>>
>>> However, the compiler reports an error and saying that it expects a
>>> := instead a . just after model.
>>>
>>> I have solved the problem by deleting the word mapping, thus the
>>> main
>>> is now:
>>>
>>> main() {
>>> model.rootObjects()[Model].groups.map resetValues();
>>> }
>>>
>>> My question is if this error is due to a compiler QVT implementation
>>> problem, or if the word mapping means something that cause the
>>> compilation error.
>>>
>>> Thanks,
>>> Toñi
>>
Re: [QVTO] mapping main or just main (Newbie question) [message #104257 is a reply to message #104194] Wed, 29 April 2009 18:28 Go to previous message
Toñi  Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Thanks, I'll try it.

Radek Dvorak escribió:
> Hi Toni,
>
> I suggest that you use milestone or integration builds from the current
> Galileo development stream.
> It provides a richer set of QVT language features and also reports
> deprecation
> warnings on legacy constructs, so it could be helpful to get over
> problems like this.
>
> Regards,
> /Radek
>
>
>
> On Sat, 25 Apr 2009 16:06:06 +0200, Toñi Reina Quintero
> <reinaqu@lsi.us.es> wrote:
>
>> Ok,
>>
>> thanks Richard. Then, I think the template for generating the
>> scheleton code should be modified, because the code generated by the
>> assistant is the one I show below, and as it can be seen, it has the
>> "mapping main".
>>
>> transformation reset();
>>
>> mapping main() {
>>
>> }
>>
>> Richard Gronback escribió:
>>> Hi Toni,
>>> Just ignore the "mapping main" references in the book. They were
>>> written
>>> using a legacy "feature" of QVT, and should all just be main()
>>> without the
>>> mapping keyword.
>>> Thanks,
>>> Rich
>>> On 4/25/09 7:03 AM, in article gsuqmn$mgm$1@build.eclipse.org,
>>> "Toñi Reina
>>> Quintero" <reinaqu@lsi.us.es> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I'm just starting with QVTO, and to be familiar with the tool, I'm
>>>> using the examples included in the book named "Modeling Project: A
>>>> Domain-Specific Language (DSL) Toolkit".
>>>>
>>>> In the book there's a simple example for refactoring a model. I'm
>>>> writing this transformation from scratch, but something curious
>>>> happened, and I'd like to know if it is a QVT compiler problem or
>>>> there's something more.
>>>>
>>>> I have started the example by using the Eclipse assitant: New >
>>>> Other> Operational QVT Transformation. As a result, a new file with
>>>> .qvto extension is created. In the created file, the assistant has
>>>>
>>>> generated a skeleton similar to the following one:
>>>>
>>>> transformation reset();
>>>>
>>>> mapping main() {
>>>>
>>>> }
>>>>
>>>> Then I write the rest of the transformation code (following the book
>>>> example). Thus, the mapping main has the following implementation:
>>>>
>>>> mapping main() {
>>>> model.rootObjects()[Model].groups.map resetValues();
>>>> }
>>>>
>>>> However, the compiler reports an error and saying that it expects a
>>>> := instead a . just after model.
>>>>
>>>> I have solved the problem by deleting the word mapping, thus the
>>>> main
>>>> is now:
>>>>
>>>> main() {
>>>> model.rootObjects()[Model].groups.map resetValues();
>>>> }
>>>>
>>>> My question is if this error is due to a compiler QVT implementation
>>>> problem, or if the word mapping means something that cause the
>>>> compilation error.
>>>>
>>>> Thanks,
>>>> Toñi
>>>
>
Previous Topic:[ATL] pathmap access for Profiles
Next Topic:[ATL] how to judge an operation called by a call event
Goto Forum:
  


Current Time: Fri Apr 19 20:28:03 GMT 2024

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

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

Back to the top