Documentation Language: Swift

Structure

MTLExpression

A thin wrapper around AQL expressions for MTL template evaluation.

struct MTLExpression

Overview

MTL expressions delegate all evaluation to the Acceleo Query Language (AQL), which provides a rich expression system for model navigation, collection operations, and standard library functions.

Overview

MTL uses AQL for all expression evaluation, including:

Example Usage

// Literal expression
let literalExpr = MTLExpression(AQLLiteralExpression(value: "Hello"))

// Variable reference
let varExpr = MTLExpression(AQLVariableExpression(name: "model"))

// Navigation
let sourceExpr = MTLExpression(AQLVariableExpression(name: "element"))
let navExpr = MTLExpression(AQLNavigationExpression(
    source: sourceExpr.aqlExpression,
    property: "name"
))

// String interpolation
let interpolExpr = MTLExpression(AQLStringInterpolationExpression(
    parts: [
        AQLStringInterpolationExpression.Part(literal: "Name: "),
        AQLStringInterpolationExpression.Part(literal: "", expression: navExpr.aqlExpression)
    ]
))

Topics

Operators

?
==(_:_:)

Compares two MTL expressions for equality.

Initializers

?
init(_:)

Creates a new MTL expression wrapping an AQL expression.

Instance Properties

V
aqlExpression

The underlying AQL expression that will be evaluated.

Instance Methods

F
evaluate(in:)

Evaluates the expression within the specified MTL execution context.

F
hash(into:)

Hashes the essential components of the expression into the given hasher.

Default Implementations

Relationships

Conforms To