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/Howtos"

< ATL
m (added reference to ATL page)
(added reference to TCS)
Line 7: Line 7:
  
 
There are several possibilies.
 
There are several possibilies.
The solution we detail here uses ATL.
+
We only detail some of them here.
 +
 
 +
===Using ATL===
  
 
You can specify a query over your model in ATL.
 
You can specify a query over your model in ATL.
Line 14: Line 16:
 
The [http://www.eclipse.org/gmt/am3/zoos/atlanticRasterZoo/ atlanticRaster zoo] is also using this technique.
 
The [http://www.eclipse.org/gmt/am3/zoos/atlanticRasterZoo/ atlanticRaster zoo] is also using this technique.
 
It first transforms KM3 metamodels into DOT models with the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/KM32DOT.atl?rev=HEAD&content-type=text/vnd.viewcvs-markup KM32DOT.atl] transformation.
 
It first transforms KM3 metamodels into DOT models with the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/KM32DOT.atl?rev=HEAD&content-type=text/vnd.viewcvs-markup KM32DOT.atl] transformation.
It then uses [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/DOT2Text.atl?rev=HEAD&content-type=text/vnd.viewcvs-markup DOT2Text.atl] to query a String, which corresponds to the generated DOT code, from the DOT model .
+
It then uses [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/DOT2Text.atl?rev=HEAD&content-type=text/vnd.viewcvs-markup DOT2Text.atl] to query a String from the DOT model.
 +
This string corresponds to the generated DOT code.
 
Then, the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/build.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup build.xml] ant scripts makes use of the [[AM3_Ant_Tasks#am3.saveModel|am3.saveModel]] task with an ATL extractor pointing to the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/DOT2Text.atl?rev=HEAD&content-type=text/vnd.viewcvs-markup DOT2Text.atl] transformation.
 
Then, the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/build.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup build.xml] ant scripts makes use of the [[AM3_Ant_Tasks#am3.saveModel|am3.saveModel]] task with an ATL extractor pointing to the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AM3/org.eclipse.am3.zoos.atlanticRaster/build/DOT2Text.atl?rev=HEAD&content-type=text/vnd.viewcvs-markup DOT2Text.atl] transformation.
 +
 +
===Using TCS===
 +
 +
[[TCS]] (Textual Concrete Syntax) is a tool enabling the specification of textual syntaxes for metamodels.
 +
Once such a syntax has been specified, models can be serialized to text files.
 +
 +
One advantage of TCS is that text can also be parsed into models.
 +
It is therefore possible to use the same specification to enable the definition of models with any text editor.

Revision as of 05:30, 30 June 2006

This page contains a list of problems related to ATL usage. It gives hints towards solutions and links to examples.

How do I generate text from models?

There are several possibilies. We only detail some of them here.

Using ATL

You can specify a query over your model in ATL. An example of this is available in the UML2Java transformation.

The atlanticRaster zoo is also using this technique. It first transforms KM3 metamodels into DOT models with the KM32DOT.atl transformation. It then uses DOT2Text.atl to query a String from the DOT model. This string corresponds to the generated DOT code. Then, the build.xml ant scripts makes use of the am3.saveModel task with an ATL extractor pointing to the DOT2Text.atl transformation.

Using TCS

TCS (Textual Concrete Syntax) is a tool enabling the specification of textual syntaxes for metamodels. Once such a syntax has been specified, models can be serialized to text files.

One advantage of TCS is that text can also be parsed into models. It is therefore possible to use the same specification to enable the definition of models with any text editor.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.