Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [TCS] Type checking: KM3+TCS or ATL
[TCS] Type checking: KM3+TCS or ATL [message #380494] Wed, 05 December 2007 12:54 Go to next message
Gustavo Cabral is currently offline Gustavo Cabral
Messages: 20
Registered: July 2009
Junior Member
Hi everyone,

I am defining the metamodel and the syntax for CSP
(http://www.usingcsp.com/).

How should I implement "type checking"? Through restrictions at the
KM3+TCS definitions (1), or implementing a CSP->Problem ATL transformation
(2)?

(1) If I restrict the KM3+TCS models to accomplish type checking, I will
have lot of work to do in both metamodel and syntax! I even think that
it may not work in some situations. :p

(2) If I relax the KM3+TCS models, I will have to define the type
checking transformation (CSP->Problem) separately. In this case,
I do not have access to the type errors during CSP coding (TGE). I
will only get the errors after I run this transformation.

What is the recommended approach?

thank you,
Gustavo Cabral
Re: [TCS] Type checking: KM3+TCS or ATL [message #380495 is a reply to message #380494] Wed, 05 December 2007 13:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: mikael.barbero.gmail.com

Hi Gustavo,

KM3+TCS restriction would certainly not allow you to define strict type
checking. An ATL transformation CSP to Problem may be the best solution
currently. For your question about viewing type errors detected by this
transformation, it is actually possible to create Eclipse markers in TGE
(the error signs in editors/problem view) with a problem model. It is
possible to call it from Java or from ANT Script.

From ANT Script:
<am3.applyMarkers model="the_problem_model_output_of_csp2probelm"
path="your/csp/model/file.csp"/>

<!-- Fail if problems were found -->
<am3.query body="Problem!Problem.allInstances()->select(e | e.severity =
#error)->size() > 0" property="thereAreErrors">
<inModel name="Problem" model="Problem"/>
<inModel name="IN" model="the_problem_model_output_of_csp2probelm"/>
</am3.query>
<fail message="There are errors in your/csp/model/file.csp"
if="thereAreErrors"/>

From Java: have a look at the class
org.eclipse.m2m.atl.engine.MarkerMaker (org.eclipse.m2m.atl.engine
plugin) and
the at the applyMarkers method in
org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit
(org.eclipse.gmt.am3.tools.ant plugin)

Hope this helps.

Best regards,
Mikael

Gustavo Cabral wrote:
> Hi everyone,
>
> I am defining the metamodel and the syntax for CSP
> (http://www.usingcsp.com/).
>
> How should I implement "type checking"? Through restrictions at the
> KM3+TCS definitions (1), or implementing a CSP->Problem ATL
> transformation (2)?
>
> (1) If I restrict the KM3+TCS models to accomplish type checking, I will
> have lot of work to do in both metamodel and syntax! I even think that
> it may not work in some situations. :p
>
> (2) If I relax the KM3+TCS models, I will have to define the type
> checking transformation (CSP->Problem) separately. In this case,
> I do not have access to the type errors during CSP coding (TGE). I
> will only get the errors after I run this transformation.
>
> What is the recommended approach?
>
> thank you,
> Gustavo Cabral
>
>
>
>



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: [TCS] Type checking: KM3+TCS or ATL [message #380497 is a reply to message #380495] Thu, 06 December 2007 06:40 Go to previous message
Gustavo Cabral is currently offline Gustavo Cabral
Messages: 20
Registered: July 2009
Junior Member
Hi Mikael,

That's what I thought! ;)
Thank you for the help and for preseting to me
this TGE Marking feature.

Regards,
Gustavo
Re: [TCS] Type checking: KM3+TCS or ATL [message #611001 is a reply to message #380494] Wed, 05 December 2007 13:10 Go to previous message
Eclipse User
Originally posted by: mikael.barbero.gmail.com

Hi Gustavo,

KM3+TCS restriction would certainly not allow you to define strict type
checking. An ATL transformation CSP to Problem may be the best solution
currently. For your question about viewing type errors detected by this
transformation, it is actually possible to create Eclipse markers in TGE
(the error signs in editors/problem view) with a problem model. It is
possible to call it from Java or from ANT Script.

From ANT Script:
<am3.applyMarkers model="the_problem_model_output_of_csp2probelm"
path="your/csp/model/file.csp"/>

<!-- Fail if problems were found -->
<am3.query body="Problem!Problem.allInstances()->select(e | e.severity =
#error)->size() > 0" property="thereAreErrors">
<inModel name="Problem" model="Problem"/>
<inModel name="IN" model="the_problem_model_output_of_csp2probelm"/>
</am3.query>
<fail message="There are errors in your/csp/model/file.csp"
if="thereAreErrors"/>

From Java: have a look at the class
org.eclipse.m2m.atl.engine.MarkerMaker (org.eclipse.m2m.atl.engine
plugin) and
the at the applyMarkers method in
org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit
(org.eclipse.gmt.am3.tools.ant plugin)

Hope this helps.

Best regards,
Mikael

Gustavo Cabral wrote:
> Hi everyone,
>
> I am defining the metamodel and the syntax for CSP
> (http://www.usingcsp.com/).
>
> How should I implement "type checking"? Through restrictions at the
> KM3+TCS definitions (1), or implementing a CSP->Problem ATL
> transformation (2)?
>
> (1) If I restrict the KM3+TCS models to accomplish type checking, I will
> have lot of work to do in both metamodel and syntax! I even think that
> it may not work in some situations. :p
>
> (2) If I relax the KM3+TCS models, I will have to define the type
> checking transformation (CSP->Problem) separately. In this case,
> I do not have access to the type errors during CSP coding (TGE). I
> will only get the errors after I run this transformation.
>
> What is the recommended approach?
>
> thank you,
> Gustavo Cabral
>
>
>
>



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: [TCS] Type checking: KM3+TCS or ATL [message #611004 is a reply to message #380495] Thu, 06 December 2007 06:40 Go to previous message
Gustavo Cabral is currently offline Gustavo Cabral
Messages: 20
Registered: July 2009
Junior Member
Hi Mikael,

That's what I thought! ;)
Thank you for the help and for preseting to me
this TGE Marking feature.

Regards,
Gustavo
Previous Topic:Bug or me ??
Next Topic:[TCS] Problem at TCS2Problem transformation
Goto Forum:
  


Current Time: Sun Sep 21 18:11:39 GMT 2014

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

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