Home » Archived » M2M (model-to-model transformation) » [ATL] How to implement symbol-table building in ATL?
| | |
Re: [ATL] How to implement symbol-table building in ATL? [message #105254 is a reply to message #105214] |
Tue, 19 May 2009 06:40 |
Lucas Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Hi,
sorry, I don't have an example. Maybe you can illustrate your
problem&question a bit further, which could make it easier to find an
answer...
Lucas
Michael wrote:
> Lucas wrote:
>> Hi Michael,
>>
>> as ATL is able to use more than one source-model - why don't you
>> integrate your contextual information by means of a second source-model?
>>
>> Cheers,
>> Lucas
>>
>> Michael wrote:
>>
>>> Hi, everyone,
>>
>>> I am using ATL to convert a language La to another language Lb. The
>> transformation La2Lb, however, depends on some contextual information,
>> say the type of identifiers.
>>> Do you have any idea of how to implement such kind of context-dependent
>> transformation in ATL?
>>> Thanks.
>>> Michael.
>>
>>
> Hi Lucas:
> Do you have any example of this?
> Thanks.
> Michael.
|
|
|
Re: [ATL] How to implement symbol-table building in ATL? [message #105282 is a reply to message #105254] |
Tue, 19 May 2009 10:04 |
Mikai Yang Messages: 149 Registered: July 2009 |
Senior Member |
|
|
Hi Lucas:
My case invovles an ATL tranformation which is from language L to Java. Actually, L is also a kind of OOP language similar to Java in structure: it has classes, enclosing
fields, methods, and so on. For example, the assignment of L is in the following form:
Identifer ::= Expression.
The L assignment is expected to be translated into a Java assignment in the following form:
JavaIdentifier :: = (CastingType)JavaExpression,
where the CastingType is type of the JavaIdentifier on the left handside. This means, this translation depends on the contextual information of the identifer--its type.
According to your valueable suggestion, first, we can translate an instance of L to a model which acts as the symbol table. Then I can translate the two models ( the instance of L and the
resulting symble-table model) to the Java program.
As far as I know, this seems ok. For me, the difficulty is how to design the metamodel of the symbol table. I think that symbol-table metamodel should
contains a scope which is nestable, and the scope contains a variable. The problem is how to navigate to the appropriate scope in the second translation.
Your comments are highly appreciated.
Regards.
Michael.
expected to be translated into a java assignment.
Lucas wrote:
> Hi,
>
> sorry, I don't have an example. Maybe you can illustrate your
> problem&question a bit further, which could make it easier to find an
> answer...
>
> Lucas
>
> Michael wrote:
>> Lucas wrote:
>>> Hi Michael,
>>>
>>> as ATL is able to use more than one source-model - why don't you
>>> integrate your contextual information by means of a second source-model?
>>
>>> Cheers,
>>> Lucas
>>>
>>> Michael wrote:
>>>
>>>> Hi, everyone,
>>>
>>>> I am using ATL to convert a language La to another language Lb.
>>>> The
>>> transformation La2Lb, however, depends on some contextual
>>> information, say the type of identifiers.
>>>> Do you have any idea of how to implement such kind of context-dependent
>>> transformation in ATL?
>>>> Thanks.
>>>> Michael.
>>>
>>>
>> Hi Lucas:
>> Do you have any example of this?
>> Thanks.
>> Michael.
>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 19 08:32:52 GMT 2024
Powered by FUDForum. Page generated in 0.04612 seconds
|