|
Re: [TCS] Type checking: KM3+TCS or ATL [message #380495 is a reply to message #380494] |
Wed, 05 December 2007 13:10 |
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 #611001 is a reply to message #380494] |
Wed, 05 December 2007 13:10 |
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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03345 seconds