Framework
ATL
A pure Swift implementation of the https://eclipse.dev/atl/ for model-to-model transformations.
Overview
ATL provides a declarative approach to model transformation, allowing you to specify how elements in a source model should be transformed into elements in a target model. The transformation rules are pattern-matched against the source model, and corresponding target elements are created automatically.
This implementation follows the https://eclipse.dev/atl/documentation/ and is related to the https://www.omg.org/spec/QVT/ standard, whilst providing a modern Swift API for integration with the ECore metamodelling framework.
Key Features
-
Declarative transformations: Define rules that match source patterns and produce targets
-
Matched rules: Automatically applied to all matching source elements
-
Called rules: Explicitly invoked for imperative control flow
-
Lazy rules: Create target elements on-demand
-
Helpers: Define reusable query operations
-
OCL expressions: Full support for guards, bindings, and navigation
Quick Example
import ATL
import ECore
// Parse the transformation
let parser = ATLParser()
let module = try await parser.parse(URL(fileURLWithPath: "Class2Table.atl"))
// Create and configure the virtual machine
let vm = ATLVirtualMachine(module: module)
try await vm.registerSourceMetamodel(umlMetamodel, as: "UML")
try await vm.registerTargetMetamodel(dbMetamodel, as: "DB")
try await vm.registerSourceModel(classModel, as: "IN")
// Execute and get results
let result = try await vm.execute()
let tableModel = result.targetModels["OUT"]
Topics
Essentials
Learn how to add ATL to your project and create your first model transformation.
Learn the fundamental concepts of the Atlas Transformation Language.
Transformation Execution
Actor responsible for executing ATL transformations.
Execution context for ATL transformations, coordinating between ATL constructs and the ECore execution framework.
Statistics tracking ATL transformation execution performance and behaviour. Comprehensive execution statistics for ATL transformation monitoring.
Modules and Rules
Represents an ATL (Atlas Transformation Language) module.
Represents an ATL matched rule for declarative transformation.
Represents an ATL called rule for imperative transformation.
Represents an ATL helper function.
Expressions
Protocol for ATL expressions that can be evaluated within transformation contexts.
Represents property navigation expressions in ATL.
Represents an ATL collection operation expression.
Represents literal value expressions in ATL.
Parsing
Parser for ATL (Atlas Transformation Language) files
Model Adapters
Adapter for ATL source models to conform to ECore IModel interface.
Adapter for ATL target models to conform to ECore IModel interface.
Factory for creating model adapters from ATL execution context.
Errors
Errors that can occur during ATL expression evaluation.
Errors that can occur during ATL parsing
Classes
A resource for managing ATL modules with XMI serialization support.
Protocols
Protocol for type-erased ATL helper storage.
Protocol for ATL rule types (matched and called rules).
Protocol for imperative statements in ATL called rules.
Structures
Represents binary operation expressions in ATL.
Represents an ATL collection literal expression.
Conditional expression for if-then-else constructs.
Error context for tracking issues during ATL execution.
Parses ATL/OCL expressions from Eclipse ATL XMI format.
Serializes ATL/OCL expressions to Eclipse ATL XMI format.
Represents helper function invocation expressions in ATL.
Type-erased wrapper for ATL helpers to enable parser instantiation.
Represents an ATL iterate expression with complex syntax.
ATL Lambda Expression for OCL iterator operations.
Lazy binding for deferred property assignment in ATL transformations.
Represents let expressions in ATL/OCL for local variable bindings.
Method call expression for OCL-style method invocations.
Represents an ATL operation call expression.
Represents a parameter for ATL helpers and called rules.
Performance metrics for detailed analysis.
Represents a property binding in ATL target patterns.
Represents the source pattern of an ATL matched rule.
Represents a target pattern for element creation in ATL rules.
Trace link between source and target elements in ATL transformations.
Represents an ATL/OCL tuple expression with typed fields.
Represents type literal expressions in ATL/OCL.
Unary operation expression for not, minus, etc.
Represents a variable reference expression in ATL.
Parses Eclipse ATL XMI format into ATL modules.
Serializes ATL modules to Eclipse ATL XMI format.
Statistics about element creation in target models.
Enumerations
Binary operators supported in ATL expressions.
Collection operations supported by ATL expressions.
A phantom type representing an ATL expression that can never be instantiated.
Errors that can occur during ATL model operations.
Errors that can occur during ATL resource operations.
Unary operators supported in ATL expressions.
Errors that can occur during expression parsing.