Documentation Language: Swift

Framework

AQL

A pure Swift implementation of the https://eclipse.dev/acceleo/documentation/ for model querying.

Overview

AQL provides a powerful expression language for querying and navigating ECore models. It supports navigation, collection operations, string manipulation, and type operations, making it ideal for model-driven engineering tasks.

This implementation follows the https://eclipse.dev/acceleo/documentation/ and is based on https://www.omg.org/spec/OCL/ semantics, whilst providing a type-safe Swift API for integration with the ECore metamodelling framework.

Key Features

Quick Example

import AQL
import ECore

// Create execution context
let engine = ECoreExecutionEngine(models: ["model": myModel])
let context = AQLExecutionContext(executionEngine: engine)

// Parse a query
let parser = AQLParser()
let query = try parser.parse("self.attributes->select(a | a.isRequired)")

// Evaluate against a model element
let result = try await query.evaluate(in: context, self: myClass)

Topics

Essentials

A
Getting Started with AQL

Learn how to add AQL to your project and write your first model queries.

A
Understanding AQL

Learn the fundamental concepts of the Acceleo Query Language.

Execution

C
AQLExecutionContext

Execution context for Acceleo Query Language (AQL) expressions.

Expressions

P
AQLExpression

Protocol for AQL expressions that can be evaluated within an execution context.

S
AQLNavigationExpression

Represents property navigation (e.g., object.property or object.reference).

S
AQLCollectionExpression

Represents collection operations in AQL (select, reject, collect, etc.).

S
AQLLiteralExpression

Represents a literal value (String, Integer, Boolean, Real, null).

S
AQLVariableExpression

Represents a variable reference in AQL.

S
AQLLetExpression

Represents let expressions for local variable bindings in AQL.

Structures

S
AQLBinaryExpression

Represents binary operations in AQL (arithmetic, comparison, logical).

S
AQLCallExpression

Represents method/operation calls in AQL.

S
AQLConditionalExpression

Represents conditional expressions (if-then-else) in AQL.

S
AQLStringInterpolationExpression

Represents AQL string interpolation: 'some text ${expression} more text'.

S
AQLUnaryExpression

Represents unary operations in AQL (logical negation, numeric negation).

Enumerations

E
AQLExecutionError

Errors that can occur during AQL execution.

See Also

Related Documentation