However, some extensions have been made (see [[ATL_FAQ#How_close_is_ATL_navigation_language_from_the_OCL_2.0_standard.3F]]).

However, some extensions have been made (see [[ATL_FAQ#How_close_is_ATL_navigation_language_from_the_OCL_2.0_standard.3F]]).

−

For each type ''T'', a CVS link is given to the Java class implementing ''T'' in the ATL virtual machine.

+

This page describes how the ATL standard library is implemented in the three ATL Virtual Machines (VMs) available from ''Eclipse.org''.

+

+

__TOC__

+

+

+

== EMF VM Implementation ==

+

+

In EMFVM, the ATL standard library is mostly implemented in the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.emfvm/src/org/eclipse/m2m/atl/engine/emfvm/lib/ExecEnv.java|ExecEnv}} Java class.

+

Most types are not wrapped, and Java objects are used directly in many cases.

+

+

Some EMF-specific operations (or operations that have an EMF-specific part) are implemented in {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.emfvm/src/org/eclipse/m2m/atl/engine/emfvm/adapter/EMFModelAdapter.java|EMFModelAdapter}}

+

+

== EMFTVM Implementation ==

+

+

In [[ATL/EMFTVM|EMFTVM]], the ATL standard library is implemented in classes of the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/|org.eclipse.m2m.atl.emftvm.util}} package.

Other operations (e.g., operations on primitive types, operations on the Collection abstract type) are implemented in the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/OCLOperations.java|OCLOperations}} Java class.

+

+

== Regular VM Implementation ==

+

+

In the Regular VM, Java objects are wrapped by specific objects (instances of subclasses of {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMOclAny.java|ASMOclAny}}).

+

In the description that follows, for each type ''T'' a CVS link is given to the Java class implementing ''T'' in the Regular ATL virtual machine.

In each class, operations available from the ATL language (as opposed to implementation-specific methods) are represented as Java methods located below the following comment:

In each class, operations available from the ATL language (as opposed to implementation-specific methods) are represented as Java methods located below the following comment:

Line 20:

Line 42:

// Additional Operations

// Additional Operations

−

All of these Java classes are located in the [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ org.atl.engine.vm.nativelib] package.

+

All of these Java classes are located in the {{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/|org.atl.engine.vm.nativelib}} package, except for the model-handler-specific classes linked to in the [[#Model Elements|Model Elements]] section.

When the description given here is not complete enough, it is possible to go and read the Java implementation.

When the description given here is not complete enough, it is possible to go and read the Java implementation.

−

This way, it is possible to know, for instance: the list of available operations and their semantics (e.g. operation String.regexReplaceAll(a : String, b : String) is implemented in [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMString.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMString] using [http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String) java.lang.String.replaceAll(String a, String b)]).

+

This way, it is possible to know, for instance: the list of available operations and their semantics (e.g. operation String.regexReplaceAll(a : String, b : String) is implemented in {{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMString.java|ASMString}} using [http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String) java.lang.String.replaceAll(String a, String b)]).

−

__TOC__

−

==Primitive Types==

+

===Primitive Types===

−

===Boolean===

+

====Boolean====

−

The ''Boolean'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMBoolean.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMBoolean] Java class.

+

The ''Boolean'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMBoolean.java|ASMBoolean}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMBoolean.java|deprecated version}}) Java class.

The underlying Java type is '''boolean'''.

The underlying Java type is '''boolean'''.

−

===Integer===

+

====Integer====

−

The ''Integer'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMInteger.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMInteger] Java class.

+

The ''Integer'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMInteger.java|ASMInteger}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMInteger.java|deprecated version}}) Java class.

The underlying Java type is '''int'''.

The underlying Java type is '''int'''.

−

===Real===

+

====Real====

−

The ''Real'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMReal.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMReal] Java class.

+

The ''Real'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMReal.java|ASMReal}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMReal.java|deprecated version}}) Java class.

The underlying Java type is '''double'''.

The underlying Java type is '''double'''.

−

===String===

+

====String====

−

The ''String'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMString.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMString] Java class.

+

The ''String'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMString.java|ASMString}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMString.java|deprecated version}}) Java class.

The ''Collection'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMCollection.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMCollection] Java class.

+

The ''Collection'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMCollection.java|ASMCollection}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMCollection.java|deprecated version}}) Java class.

There is no underlying Java type for this abstract type.

There is no underlying Java type for this abstract type.

However, all concrete collection types are implemented by sub-classes of [http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html java.util.Collection].

However, all concrete collection types are implemented by sub-classes of [http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html java.util.Collection].

−

===Bag===

+

====Bag====

−

The ''Bag'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMBag.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMBag] Java class.

+

The ''Bag'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMBag.java|ASMBag}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMBag.java|deprecated version}}) Java class.

The ''OrderedSet'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMOrderedSet.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMOrderedSet] Java class.

+

The ''OrderedSet'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMOrderedSet.java|ASMOrderedSet}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMOrderedSet.java|deprecated version}}) Java class.

The ''Sequence'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMSequence.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMSequence] Java class.

+

The ''Sequence'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMSequence.java|ASMSequence}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMSequence.java|deprecated version}}) Java class.

The ''Set'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMSet.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMSet] Java class.

+

The ''Set'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMSet.java|ASMSet}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMSet.java|deprecated version}}) Java class.

Model elements are handled as a special case in a model-handler-specific way.

+

+

==== EMF-specific ====

+

+

These operations are implemented in {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.drivers.emf4atl/src/org/eclipse/m2m/atl/drivers/emf4atl/ASMEMFModelElement.java|ASMEMFModelElement}}:

+

+

* EClass.allInstances()

+

* EClass.allInstancesFrom(String)

+

* EClassifier.newInstance()

+

* EClassifier.newInstanceIn(String)

+

* EClassifier.getInstanceById(String, String)

+

+

Additionally, ATL will look for a called operation in the underlying EObject using Java reflection. This makes many operations (i.e., those for which type translation is implemented for arguments and returned value) from Ecore, as well as from a specific implementation of EObject available.

+

+

==== MDR-specific ====

+

+

These operations are implemented in {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.drivers.mdr4atl/src/org/eclipse/m2m/atl/drivers/mdr4atl/ASMMDRModelElement.java|ASMMDRModelElement}}:

+

+

* Classifier.allInstances()

+

* Classifier.allInstancesFrom(String)

+

* Classifier.newInstance()

+

* Classifier.getElementById(String, OclAny)

+

* Classifier.getElementsById(String, OclAny)

+

In addition, a few MOF-specific operations are made available, but other operations are generally not available (there is no similar mechanism to what is supported in the EMF-specific version described above):

The types described in this section are not part of the OCL 2.0 specification.

The types described in this section are not part of the OCL 2.0 specification.

−

===Map===

+

====Map====

−

The ''Map'' OCL type is implemented by the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org.eclipse.m2m.atl/deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMMap.java?root=Modeling_Project&rev=HEAD&content-type=text/vnd.viewcvs-markup ASMMap] Java class.

+

The ''Map'' OCL type is implemented by the {{ATLRepositoryLink|plugins/org.eclipse.m2m.atl.engine.vm/src/org/eclipse/m2m/atl/engine/vm/nativelib/ASMMap.java|ASMMap}} ({{ATLRepositoryLink|deprecated/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMMap.java|deprecated version}}) Java class.

EMFTVM Implementation

Most operations on concrete collections are implemented in the corresponding Java classes: Lazy{Bag,List,OrderedSet,Set}.java respectively for OCL collection types Bag, Sequence, OrderedSet, Set.
Other operations (e.g., operations on primitive types, operations on the Collection abstract type) are implemented in the OCLOperations Java class.

Regular VM Implementation

In the Regular VM, Java objects are wrapped by specific objects (instances of subclasses of ASMOclAny).
In the description that follows, for each type T a CVS link is given to the Java class implementing T in the Regular ATL virtual machine.
In each class, operations available from the ATL language (as opposed to implementation-specific methods) are represented as Java methods located below the following comment:

// Native Operations Below

In some of these classes, there are two additional comments delimiting:

When the description given here is not complete enough, it is possible to go and read the Java implementation.
This way, it is possible to know, for instance: the list of available operations and their semantics (e.g. operation String.regexReplaceAll(a : String, b : String) is implemented in ASMString using java.lang.String.replaceAll(String a, String b)).

Additionally, ATL will look for a called operation in the underlying EObject using Java reflection. This makes many operations (i.e., those for which type translation is implemented for arguments and returned value) from Ecore, as well as from a specific implementation of EObject available.

In addition, a few MOF-specific operations are made available, but other operations are generally not available (there is no similar mechanism to what is supported in the EMF-specific version described above):