Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "ATL 2006"

(added link to more information on rule inheritance)
(updated links to repository using Template:ATLRepositoryLink as well as some facts)
 
(2 intermediate revisions by one other user not shown)
Line 7: Line 7:
 
* several iterators in ''iterate'', ''exists'', and ''forAll'',
 
* several iterators in ''iterate'', ''exists'', and ''forAll'',
 
* [[ATL_Language_Troubleshooter#Rule_inheritance|rule inheritance]],
 
* [[ATL_Language_Troubleshooter#Rule_inheritance|rule inheritance]],
* multiple source pattern elements,
+
* multiple source pattern elements (usage examples from the newsgroup: with resolveTemp [http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/msg00445.html (1)] [http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/msg02100.html (2)]),
 
* calling super helpers,
 
* calling super helpers,
 
* etc.
 
* etc.
Line 14: Line 14:
 
If you need to use refining mode, then use ATL 2004 (see remarks section below).
 
If you need to use refining mode, then use ATL 2004 (see remarks section below).
  
[http://www.sciences.univ-nantes.fr/lina/atl/www/presentations/awme2/02%20-%20New%20announcements%20for%20ATL'2006%20(Jouault).ppt New announcements for ATL'2006] were presented at the [http://www.sciences.univ-nantes.fr/lina/atl/Events/AWME2 2nd AMMA/ATL Workshop on Model Engineering].
+
[http://atlanmod.emn.fr/www/presentations/awme2/02%20-%20New%20announcements%20for%20ATL'2006%20(Jouault).ppt New announcements for ATL'2006] were presented at the [http://atlanmod.emn.fr/Events/AWME2 2nd AMMA/ATL Workshop on Model Engineering].
  
 
==Usage==
 
==Usage==
Line 20: Line 20:
 
===Using the ATL 2006 compiler===
 
===Using the ATL 2006 compiler===
  
Support for multiple ATL compilers has been committed to CVS.
 
 
To select a compiler, the first line of the transformation must consist of a comment with the ''@atlcompiler'' tag followed by the name of the compiler.
 
To select a compiler, the first line of the transformation must consist of a comment with the ''@atlcompiler'' tag followed by the name of the compiler.
 
For instance, selecting the ATL 2006 compiler is performed by adding the following line as the very first line of the ATL file:
 
For instance, selecting the ATL 2006 compiler is performed by adding the following line as the very first line of the ATL file:
 
  -- @atlcompiler atl2006
 
  -- @atlcompiler atl2006
  
You need to install the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.eclipse.gmt.atl.atl2006/ org.eclipse.gmt.atl.atl2006] plugin in order to use the ATL 2006 compiler.
+
<strike>You need to install the {{ATLRepositoryLink|deprecated/org.eclipse.gmt.atl.atl2006/|org.eclipse.gmt.atl.atl2006}} plugin in order to use the ATL 2006 compiler.</strike> The ATL 2006 compiler is now distributed in the same plugin as the ATL 2004 compiler (as well as the ATL 2010 compiler).
  
 
To select ATL 2004 (see remarks section below), the following line can be used:
 
To select ATL 2004 (see remarks section below), the following line can be used:
 
  -- @atlcompiler atl2004
 
  -- @atlcompiler atl2004
  
Note that the default compiler is still ATL 2004 for the moment.
+
<strike>Note that the default compiler is still ATL 2004 for the moment.</strike>
 
The default compiler is invoked when there is no line matching the pattern described in this section.
 
The default compiler is invoked when there is no line matching the pattern described in this section.
  
The following [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html Java regular expression] is used in class [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.eclipse.engine/src/org/atl/eclipse/engine/AtlCompiler.java?view=markup AtlCompiler] of the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.eclipse.engine/ org.atl.eclipse.engine] plugin to parse the first line of ATL files in order to get the name of the compiler to use:
+
The following [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html Java regular expression] is used in class {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine/src/org/eclipse/m2m/atl/engine/compiler/AtlCompiler.java|AtlCompiler}} of the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine/|org.eclipse.m2m.atl.engine}} plugin to parse the first line of ATL files in order to get the name of the compiler to use:
 
   ^\p{Space}*--\p{Space}*@atlcompiler\p{Space}+([^\p{Space}]*)\p{Space}*$
 
   ^\p{Space}*--\p{Space}*@atlcompiler\p{Space}+([^\p{Space}]*)\p{Space}*$
 
Note that it can accomodate whitespaces.
 
Note that it can accomodate whitespaces.
Line 51: Line 50:
 
==Source==
 
==Source==
  
The source of ATL 2006 is provided as the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/dsls/ATL/?root=Modeling_Project ATL] [[TCS/Language Project|language project]], which contains:
+
The source of ATL 2006 is provided as the {{ATLRepositoryLink|dsls/ATL/|ATL}} [[TCS/Language Project|language project]], which contains:
* The [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/dsls/ATL/Metamodel/ATL.km3?root=Modeling_Project&view=markup ATL metamodel] in [[KM3]].
+
* The {{ATLRepositoryLink|dsls/ATL/Metamodel/ATL.km3|ATL metamodel}} in [[KM3]].
* The [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/dsls/ATL/Syntax/ATL.tcs?root=Modeling_Project&view=markup ATL concrete syntax] in [[TCS]].
+
* The {{ATLRepositoryLink|dsls/ATL/Syntax/ATL.tcs|ATL concrete syntax}} in [[TCS]].
* The [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/dsls/ATL/Compiler/ATL.acg?root=Modeling_Project&view=markup ATL compiler] in [[ACG]].
+
* The {{ATLRepositoryLink|dsls/ATL/Compiler/ATL.acg|ATL compiler}} in [[ACG]].
  
 
==Remarks==
 
==Remarks==

Latest revision as of 05:46, 4 June 2013

< To: ATL

Introduction

ATL 2006 is the name of a new version of ATL. It features a new, faster, compiler as well as new possiblities:

  • several iterators in iterate, exists, and forAll,
  • rule inheritance,
  • multiple source pattern elements (usage examples from the newsgroup: with resolveTemp (1) (2)),
  • calling super helpers,
  • etc.

The current version does not support refining mode yet. If you need to use refining mode, then use ATL 2004 (see remarks section below).

New announcements for ATL'2006 were presented at the 2nd AMMA/ATL Workshop on Model Engineering.

Usage

Using the ATL 2006 compiler

To select a compiler, the first line of the transformation must consist of a comment with the @atlcompiler tag followed by the name of the compiler. For instance, selecting the ATL 2006 compiler is performed by adding the following line as the very first line of the ATL file:

-- @atlcompiler atl2006

You need to install the org.eclipse.gmt.atl.atl2006 plugin in order to use the ATL 2006 compiler. The ATL 2006 compiler is now distributed in the same plugin as the ATL 2004 compiler (as well as the ATL 2010 compiler).

To select ATL 2004 (see remarks section below), the following line can be used:

-- @atlcompiler atl2004

Note that the default compiler is still ATL 2004 for the moment. The default compiler is invoked when there is no line matching the pattern described in this section.

The following Java regular expression is used in class AtlCompiler of the org.eclipse.m2m.atl.engine plugin to parse the first line of ATL files in order to get the name of the compiler to use:

 ^\p{Space}*--\p{Space}*@atlcompiler\p{Space}+([^\p{Space}]*)\p{Space}*$

Note that it can accomodate whitespaces.

Calling super helpers

The super keyword lets you call helpers with the same name defined on a super type of the current type.

Suppose you have the following metamodel:

class A {}
class B extends A {}

Then you can write:

helper context A def: test() : Integer = 1;
helper context B def: test() : Integer = super.test() + 1;

Source

The source of ATL 2006 is provided as the ATL language project, which contains:

Remarks

The initial version of ATL was released in 2004 and is therefore named ATL 2004. However, ATL 2004 has evolved between 2004 and 2006. Moreover, minor evolutions may still be made to ATL 2004 (e.g., bug corrections).

Back to the top